...
Anchor
Tx()
function.anchorFiles
Anchor
net_dev.c
Prototype
...
HTML Table | summary | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
class | Code_Listing | |||||||||
Table Row (tr) | ||||||||||
Table Cell (td) | ||||||||||
| ||||||||||
Anchor | 1109835 | 1109835 | static void NetDev_Tx||||||||
Code Block | ||||||||||
static void NetDev_Tx (NET_IF*p_if, Anchor | | 1151422 | 1151422 | CPU_INT08U *p_data,|||||||
Anchor | 1151423 | 1151423 | CPU_INT16U size,||||||||
Anchor | 1151424 | 1151424 | NET_ERR *p_err);||||||||
Table Row (tr) |
...
*pif,
CPU_INT08U *p_data,
CPU_INT16U size,
NET_ERR *perr); |
Note that since every device driver’s Tx()
function is accessed only by function pointer via the device driver’s API structure, it doesn’t need to be globally available and should therefore be declared as ‘static’‘static
’. Anchor
Arguments
Anchor
pif
Pointer to the interface to start a network device.
Anchor
p_data
anchorPointer to address of the data to transmit.
Anchor
size
Size of the data to transmit.
Anchor
perr
Pointer to variable that will receive the return error code from this function.
...
Returned Value
Anchor
Required Configuration
...
None. Anchor
Notes / Warnings
Anchor
...
Anchor 1134753 1134753 Write data to the device by calling p_dev_bsp->SPI_WrRd() and by using the network buffer passed as argument and by using a global buffer to read data.Anchor 1111286 1111286 For DMA-based hardware, the driver should select the next available transmit descriptor and set the pointer to the data area equal to the address pointer to byp_data
.- Non-DMA hardware should
Mem_Copy()
the data stored within the buffer pointed to byp_data
to the device’s internal memory. - Once completed, the driver must configure the device with the number of bytes to transmit. This is passed directly by value within the size argument. DMA-based devices generally have a size field within the transmit descriptor. Non-DMA devices generally have a transmit size register that needs to be configured.
- The driver should then take all necessary steps to initiate transmission of the data.
Anchor 1111730 1111730 - Set
perr
toNET_DEV_ERR_NONE
and return from the transmit function.