![]() |
RA Flexible Software Package Documentation
Release v6.2.0
|
|
Interface for Ethernet functions.
The Ethernet interface provides Ethernet functionality. The Ethernet interface supports the following features:
Data Structures | |
| struct | ether_nic_info_t |
| struct | ether_callback_args_t |
| struct | ether_cfg_t |
| struct | ether_api_t |
| struct | ether_instance_t |
Typedefs | |
| typedef void | ether_ctrl_t |
Enumerations | |
| enum | ether_wake_on_lan_t |
| enum | ether_flow_control_t |
| enum | ether_multicast_t |
| enum | ether_promiscuous_t |
| enum | ether_zerocopy_t |
| enum | ether_event_t |
| struct ether_nic_info_t |
| struct ether_callback_args_t |
Callback function parameter data
| Data Fields | ||
|---|---|---|
| uint32_t | channel | Device channel number. |
| ether_event_t | event | Event code. |
| uint32_t | status_ecsr | ETHERC status register for interrupt handler. |
| uint32_t | status_eesr | ETHERC/EDMAC status register for interrupt handler. |
| ether_nic_info_t * | p_nic_info | Pointer of NIC info. |
| void * | p_context | Placeholder for user data. Set in ether_api_t::open function in ether_cfg_t. |
| struct ether_cfg_t |
Configuration parameters.
Data Fields | |
| uint8_t | channel |
| Channel. | |
| ether_zerocopy_t | zerocopy |
| Zero copy enable or disable in Read/Write function. | |
| ether_multicast_t | multicast |
| Multicast enable or disable. | |
| ether_promiscuous_t | promiscuous |
| Promiscuous mode enable or disable. | |
| ether_flow_control_t | flow_control |
| Flow control functionally enable or disable. | |
| ether_padding_t | padding |
| Padding length inserted into the received Ethernet frame. | |
| uint32_t | padding_offset |
| Offset of the padding inserted into the received Ethernet frame. | |
| uint32_t | broadcast_filter |
| Limit of the number of broadcast frames received continuously. | |
| uint8_t * | p_mac_address |
| Pointer of MAC address. | |
| uint8_t | num_tx_descriptors |
| Number of transmission descriptor. | |
| uint8_t | num_rx_descriptors |
| Number of receive descriptor. | |
| uint8_t ** | pp_ether_buffers |
| Transmit and receive buffer. | |
| uint32_t | ether_buffer_size |
| Size of transmit and receive buffer. | |
| IRQn_Type | irq |
| Interrupt number. | |
| uint32_t | interrupt_priority |
| Interrupt priority. | |
| void(* | p_callback )(ether_callback_args_t *p_args) |
| Callback provided when an ISR occurs. | |
| ether_phy_instance_t const * | p_ether_phy_instance |
| Pointer to ETHER_PHY instance. | |
| void * | p_context |
| Placeholder for user data. More... | |
| void const * | p_extend |
| Placeholder for user extension. | |
| void* ether_cfg_t::p_context |
Placeholder for user data.
Placeholder for user data. Passed to the user callback in ether_callback_args_t.
| struct ether_api_t |
Functions implemented at the HAL layer will follow this API.
Data Fields | |
| fsp_err_t(* | open )(ether_ctrl_t *const p_ctrl, ether_cfg_t const *const p_cfg) |
| fsp_err_t(* | close )(ether_ctrl_t *const p_ctrl) |
| fsp_err_t(* | read )(ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t *const length_bytes) |
| fsp_err_t(* | bufferRelease )(ether_ctrl_t *const p_ctrl) |
| fsp_err_t(* | rxBufferUpdate )(ether_ctrl_t *const p_ctrl, void *const p_buffer) |
| fsp_err_t(* | write )(ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t const frame_length) |
| fsp_err_t(* | linkProcess )(ether_ctrl_t *const p_ctrl) |
| fsp_err_t(* | wakeOnLANEnable )(ether_ctrl_t *const p_ctrl) |
| fsp_err_t(* | txStatusGet )(ether_ctrl_t *const p_ctrl, void *const p_buffer_address) |
| fsp_err_t(* | callbackSet )(ether_ctrl_t *const p_ctrl, void(*p_callback)(ether_callback_args_t *), void *const p_context, ether_callback_args_t *const p_callback_memory) |
| fsp_err_t(* ether_api_t::open) (ether_ctrl_t *const p_ctrl, ether_cfg_t const *const p_cfg) |
Open driver.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_cfg | Pointer to pin configuration structure. |
| fsp_err_t(* ether_api_t::close) (ether_ctrl_t *const p_ctrl) |
Close driver.
| [in] | p_ctrl | Pointer to control structure. |
| fsp_err_t(* ether_api_t::read) (ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t *const length_bytes) |
Read packet if data is available.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_buffer | Pointer to where to store read data. |
| [in] | length_bytes | Number of bytes in buffer |
| fsp_err_t(* ether_api_t::bufferRelease) (ether_ctrl_t *const p_ctrl) |
Release rx buffer from buffer pool process in zero-copy read operation.
| [in] | p_ctrl | Pointer to control structure. |
| fsp_err_t(* ether_api_t::rxBufferUpdate) (ether_ctrl_t *const p_ctrl, void *const p_buffer) |
Update the buffer pointer in the current receive descriptor.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_buffer | New address to write into the rx buffer descriptor. |
| fsp_err_t(* ether_api_t::write) (ether_ctrl_t *const p_ctrl, void *const p_buffer, uint32_t const frame_length) |
Write packet.
| [in] | p_ctrl | Pointer to control structure. |
| [in] | p_buffer | Pointer to data to write. |
| [in] | frame_length | Send ethernet frame size (without 4 bytes of CRC data size). |
| fsp_err_t(* ether_api_t::linkProcess) (ether_ctrl_t *const p_ctrl) |
Process link.
| [in] | p_ctrl | Pointer to control structure. |
| fsp_err_t(* ether_api_t::wakeOnLANEnable) (ether_ctrl_t *const p_ctrl) |
Enable magic packet detection.
| [in] | p_ctrl | Pointer to control structure. |
| fsp_err_t(* ether_api_t::txStatusGet) (ether_ctrl_t *const p_ctrl, void *const p_buffer_address) |
Get the address of the most recently sent buffer.
| [in] | p_ctrl | Pointer to control structure. |
| [out] | p_buffer_address | Pointer to the address of the most recently sent buffer. |
| fsp_err_t(* ether_api_t::callbackSet) (ether_ctrl_t *const p_ctrl, void(*p_callback)(ether_callback_args_t *), void *const p_context, ether_callback_args_t *const p_callback_memory) |
Specify callback function and optional context pointer and working memory pointer.
| [in] | p_ctrl | Pointer to the ETHER control block. |
| [in] | p_callback | Callback function |
| [in] | p_context | Pointer to send to callback function |
| [in] | p_working_memory | Pointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback. |
| struct ether_instance_t |
This structure encompasses everything that is needed to use an instance of this interface.
| Data Fields | ||
|---|---|---|
| ether_ctrl_t * | p_ctrl | Pointer to the control structure for this instance. |
| ether_cfg_t const * | p_cfg | Pointer to the configuration structure for this instance. |
| ether_api_t const * | p_api | Pointer to the API structure for this instance. |
| typedef void ether_ctrl_t |
Control block. Allocate an instance specific control block to pass into the API calls.
| enum ether_wake_on_lan_t |
| enum ether_flow_control_t |
| enum ether_multicast_t |
| enum ether_promiscuous_t |
| enum ether_zerocopy_t |
| enum ether_event_t |
Event code of callback function