PER Firmware
Loading...
Searching...
No Matches
ethernet.c File Reference

Implementation of the ethernet thread for wireless data acquisition. More...

#include <stdint.h>
#include "w5500/socket.h"
#include "common/phal_F4/gpio/gpio.h"
#include "common/rtos/rtos.h"
#include "main.h"
#include "spmc.h"
#include "ethernet.h"
Include dependency graph for ethernet.c:

Functions

static bool is_linked (void)
 
static bool init_w5500 (void)
 
static bool init_udp (void)
 
static void eth_ready_periodic (void)
 
void ethernet_periodic (void)
 

Variables

static constexpr uint8_t DAQ_UDP_SOCKET_NUM = 0
 
static constexpr uint16_t DAQ_UDP_SOCKET_PORT = 5005
 
static ethernet_config_t config
 
static ethernet_state_t current_state = ETHERNET_STATE_HW_INIT
 
static ethernet_state_t next_state = ETHERNET_STATE_HW_INIT
 

Detailed Description

Implementation of the ethernet thread for wireless data acquisition.

Author
Luke Oxley (lcoxl.nosp@m.ey@p.nosp@m.urdue.nosp@m..edu)
Eileen Yoon (eyn@p.nosp@m.urdu.nosp@m.e.edu)
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Function Documentation

◆ eth_ready_periodic()

static void eth_ready_periodic ( void )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ethernet_periodic()

void ethernet_periodic ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_udp()

static bool init_udp ( void )
static
Here is the caller graph for this function:

◆ init_w5500()

static bool init_w5500 ( void )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_linked()

static bool is_linked ( void )
inlinestatic
Here is the caller graph for this function:

Variable Documentation

◆ config

ethernet_config_t config
static
Initial value:
= {
.net_info = {
.mac = {0x00, 0x08, 0xdc, 0xab, 0xcd, 0xef},
.ip = {192, 168, 10, 41},
.sn = {255, 255, 255, 0},
.gw = {192, 168, 10, 1},
},
.udp_address = {192, 168, 10, 255},
.udp_port = DAQ_UDP_SOCKET_PORT,
.udp_socket = DAQ_UDP_SOCKET_NUM
}
static constexpr uint8_t DAQ_UDP_SOCKET_NUM
Definition ethernet.c:19
static constexpr uint16_t DAQ_UDP_SOCKET_PORT
Definition ethernet.c:20

◆ current_state

ethernet_state_t current_state = ETHERNET_STATE_HW_INIT
static

◆ DAQ_UDP_SOCKET_NUM

uint8_t DAQ_UDP_SOCKET_NUM = 0
staticconstexpr

◆ DAQ_UDP_SOCKET_PORT

uint16_t DAQ_UDP_SOCKET_PORT = 5005
staticconstexpr

◆ next_state