|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
NetX Duo network driver shim that bridges onto the RA8 ra8_eth HAL. More...
#include <stdint.h>#include "nx_api.h"Go to the source code of this file.
Functions | |
| void | nx_ether_driver_ra8_eth (NX_IP_DRIVER *driver_req) |
| NetX Duo network-driver entry point bridging onto ra8_eth_*. | |
| void | nx_ether_driver_ra8_eth_set_mac (const uint8_t mac[6]) |
| Install the local MAC address used by the driver at NX_LINK_INITIALIZE. | |
NetX Duo network driver shim that bridges onto the RA8 ra8_eth HAL.
Declares the single NetX Duo network-driver entry point nx_ether_driver_ra8_eth that nx_ip_create calls back into. The function dispatches on nx_ip_driver->nx_ip_driver_command and translates each request into the matching ra8_eth_* polled frame primitive exported from libs/ra8_hal/inc/ra8_eth.h.
Request mapping (see NetX Duo nx_api.h constants):
| NetX request | Action |
|---|---|
| NX_LINK_INITIALIZE | ra8_eth_open(cfg) |
| NX_LINK_ENABLE | mark interface up |
| NX_LINK_DISABLE | mark interface down |
| NX_LINK_PACKET_SEND | ra8_eth_write |
| NX_LINK_PACKET_BROADCAST | ra8_eth_write |
| NX_LINK_ARP_SEND | ra8_eth_write |
| NX_LINK_ARP_RESPONSE_SEND | ra8_eth_write |
| NX_LINK_RARP_SEND | ra8_eth_write |
| NX_LINK_DEFERRED_PROCESSING | drain ra8_eth_read -> stack |
| NX_LINK_GET_STATUS | ra8_eth_link_status |
| NX_LINK_UNINITIALIZE | ra8_eth_close |
Every other command returns NX_NOT_SUCCESSFUL – the firmware does not support multicast filtering, IP-level offload, or 6LowPAN.
Definition in file nx_ether_driver_ra8_eth.h.
| void nx_ether_driver_ra8_eth | ( | NX_IP_DRIVER * | driver_req | ) |
NetX Duo network-driver entry point bridging onto ra8_eth_*.
Pass this function as the ip_link_driver argument to nx_ip_create(). NetX Duo invokes it once per driver-level request, indicating the request kind in nx_ip_driver->nx_ip_driver_command and reporting completion via nx_ip_driver->nx_ip_driver_status (set to NX_SUCCESS on success or NX_NOT_SUCCESSFUL on any underlying ESWM failure).
Frame TX path (NX_LINK_PACKET_SEND and friends):
Frame RX path (NX_LINK_DEFERRED_PROCESSING):
| [in,out] | driver_req | NetX Duo driver request structure. The driver reads nx_ip_driver_command, nx_ip_driver_packet, nx_ip_driver_interface, and writes nx_ip_driver_status. |
Definition at line 861 of file nx_ether_driver_ra8_eth.c.
References g_nx_ether_diag, internal_handle_deferred_rx(), internal_handle_get_status(), internal_handle_init(), internal_handle_send(), internal_handle_uninit(), and internal_set_link_state().
Referenced by demo_netx_bring_up(), demo_netx_create_ip(), and internal_demo_netx_bring_up().
| void nx_ether_driver_ra8_eth_set_mac | ( | const uint8_t | mac[6] | ) |
Install the local MAC address used by the driver at NX_LINK_INITIALIZE.
nx_ip_create calls the driver's INITIALIZE callback synchronously during IP-thread spin-up, BEFORE the app can call nx_ip_interface_physical_address_set. The interface's physical_address_msw / _lsw fields read zero at that point, so the driver has no MAC to program into the RMAC's MRMAC0/MRMAC1 registers and RX silently filters every frame. Apps must call this function BEFORE nx_ip_create so the driver has the MAC at hand when INITIALIZE fires.
| [in] | mac | 6-byte unicast MAC in network byte order. |
Definition at line 224 of file nx_ether_driver_ra8_eth.c.
References k_nx_ra8_eth_mac_len, s_local_mac, and s_local_mac_user_set.
Referenced by demo_netx_bring_up(), and demo_netx_create_ip().