34 #define DRIVER_NAME ETH 37 #include <oc_stdlib.h> 43 #ifdef oC_ETH_LLD_AVAILABLE 50 #define _________________________________________DEFINITIONS_SECTION_______________________________________________________________________ 64 #define oC_ETH_CHIP_NAME_MAX_LENGTH ( IFNAMSIZ / 2 ) 67 #undef _________________________________________DEFINITIONS_SECTION_______________________________________________________________________ 75 #define _________________________________________TYPES_SECTION______________________________________________________________________________ 109 oC_ETH_LLD_PHY_ChipInfo_t
LLD;
143 #undef _________________________________________TYPES_SECTION______________________________________________________________________________ 150 #define _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________ 160 extern oC_ErrorCode_t oC_ETH_SetWakeOnLanEvent ( oC_ETH_Context_t Context ,
oC_Event_t WolEvent );
161 extern oC_ErrorCode_t oC_ETH_Flush ( oC_ETH_Context_t Context );
167 #undef _________________________________________INTERFACE_FUNCTIONS_SECTION________________________________________________________________ #define oC_ETH_CHIP_NAME_MAX_LENGTH
maximum length for the chip name
oC_ETH_PhyAddress_t PhyAddress
Address of the external PHY.
oC_ErrorCode_t oC_ETH_PerformDiagnostics(oC_ETH_Context_t Context, oC_Diag_t *Diags, uint32_t *NumberOfDiags)
performs diagnostics
ETH driver configuration structure.
oC_ErrorCode_t oC_ETH_SendFrame(oC_ETH_Context_t Context, const oC_Net_Frame_t *Frame, oC_Time_t Timeout)
sends frame via ETH
struct Context_t * oC_ETH_Context_t
The ETH context structure.
oC_ErrorCode_t oC_ETH_TurnOn(void)
turns on the module
oC_ErrorCode_t oC_ETH_SetLoopback(oC_ETH_Context_t Context, oC_Net_Layer_t Layer, bool Enabled)
enables or disables loopback-mode at the given layer
The file with LLD interface for the ETH driver.
stores network interface informations
Informations about the selected chip.
oC_ErrorCode_t oC_ETH_Configure(const oC_ETH_Config_t *Config, oC_ETH_Context_t *outContext)
configures ETH pins to work
oC_ETH_LLD_Config_t LLD
Configuration from the LLD layer (More you can find in the #oC_ETH_LLD_Config_t type description) ...
uint8_t oC_Net_MacAddress_t[MAC_ADDRESS_LENGTH]
stores MAC address
char oC_ETH_ChipName_t[oC_ETH_CHIP_NAME_MAX_LENGTH]
stores name of the chip
oC_Net_MacAddress_t MacAddress
MAC address of the interface.
The file with interface for driver creating.
oC_ETH_LLD_PHY_ChipInfo_t LLD
Informations about the chip required by the LLD layer.
const oC_ETH_PhyChipInfo_t * PhyChipInfo
Pointer to the PHY chip definition (you can find it in the oc_eth_chips.h file)
oC_ErrorCode_t oC_ETH_TurnOff(void)
Turns off the ETH driver.
The file with interface for event module.
oC_ETH_ChipName_t Name
Name of the PHY chip.
stores informations about the frame to send
oC_ErrorCode_t oC_ETH_ReadNetInfo(oC_ETH_Context_t Context, oC_Net_Info_t *outInfo)
returns informations about the interface
oC_ErrorCode_t oC_ETH_Unconfigure(const oC_ETH_Config_t *Config, oC_ETH_Context_t *outContext)
Unconfigures the driver.
The file with interface for IOCTL.
oC_ErrorCode_t oC_ETH_ReceiveFrame(oC_ETH_Context_t Context, oC_Net_Frame_t *outFrame, oC_Time_t Timeout)
receives frame via ETH
oC_ETH_LLD_PHY_Address_t oC_ETH_PhyAddress_t
stores address of a PHY
bool oC_ETH_IsContextCorrect(oC_ETH_Context_t Context)
checks if the context is correct for ETH driver
bool oC_ETH_IsTurnedOn(void)
checks if the driver is turned on
oC_Net_Layer_t
stores layer of the OSI model