STM32F4xx_HAL_Driver  1.8.3
IO operation functions

ETH Transmit and Receive functions. More...

+ Collaboration diagram for IO operation functions:

Functions

HAL_StatusTypeDef HAL_ETH_Start (ETH_HandleTypeDef *heth)
 Enables Ethernet MAC and DMA reception and transmission. More...
 
HAL_StatusTypeDef HAL_ETH_Start_IT (ETH_HandleTypeDef *heth)
 Enables Ethernet MAC and DMA reception/transmission in Interrupt mode. More...
 
HAL_StatusTypeDef HAL_ETH_Stop (ETH_HandleTypeDef *heth)
 Stop Ethernet MAC and DMA reception/transmission. More...
 
HAL_StatusTypeDef HAL_ETH_Stop_IT (ETH_HandleTypeDef *heth)
 Stop Ethernet MAC and DMA reception/transmission in Interrupt mode. More...
 
HAL_StatusTypeDef HAL_ETH_ReadData (ETH_HandleTypeDef *heth, void **pAppBuff)
 Read a received packet. More...
 
HAL_StatusTypeDef HAL_ETH_RegisterRxAllocateCallback (ETH_HandleTypeDef *heth, pETH_rxAllocateCallbackTypeDef rxAllocateCallback)
 Register the Rx alloc callback. More...
 
HAL_StatusTypeDef HAL_ETH_UnRegisterRxAllocateCallback (ETH_HandleTypeDef *heth)
 Unregister the Rx alloc callback. More...
 
HAL_StatusTypeDef HAL_ETH_RegisterRxLinkCallback (ETH_HandleTypeDef *heth, pETH_rxLinkCallbackTypeDef rxLinkCallback)
 Set the Rx link data function. More...
 
HAL_StatusTypeDef HAL_ETH_UnRegisterRxLinkCallback (ETH_HandleTypeDef *heth)
 Unregister the Rx link callback. More...
 
HAL_StatusTypeDef HAL_ETH_GetRxDataErrorCode (const ETH_HandleTypeDef *heth, uint32_t *pErrorCode)
 Get the error state of the last received packet. More...
 
HAL_StatusTypeDef HAL_ETH_RegisterTxFreeCallback (ETH_HandleTypeDef *heth, pETH_txFreeCallbackTypeDef txFreeCallback)
 Set the Tx free function. More...
 
HAL_StatusTypeDef HAL_ETH_UnRegisterTxFreeCallback (ETH_HandleTypeDef *heth)
 Unregister the Tx free callback. More...
 
HAL_StatusTypeDef HAL_ETH_ReleaseTxPacket (ETH_HandleTypeDef *heth)
 Release transmitted Tx packets. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_SetConfig (ETH_HandleTypeDef *heth, ETH_PTP_ConfigTypeDef *ptpconfig)
 Set the Ethernet PTP configuration. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_GetConfig (ETH_HandleTypeDef *heth, ETH_PTP_ConfigTypeDef *ptpconfig)
 Get the Ethernet PTP configuration. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_SetTime (ETH_HandleTypeDef *heth, ETH_TimeTypeDef *time)
 Set Seconds and Nanoseconds for the Ethernet PTP registers. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_GetTime (ETH_HandleTypeDef *heth, ETH_TimeTypeDef *time)
 Get Seconds and Nanoseconds for the Ethernet PTP registers. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_AddTimeOffset (ETH_HandleTypeDef *heth, ETH_PtpUpdateTypeDef ptpoffsettype, ETH_TimeTypeDef *timeoffset)
 Update time for the Ethernet PTP registers. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_InsertTxTimestamp (ETH_HandleTypeDef *heth)
 Insert Timestamp in transmission. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_GetTxTimestamp (ETH_HandleTypeDef *heth, ETH_TimeStampTypeDef *timestamp)
 Get transmission timestamp. More...
 
HAL_StatusTypeDef HAL_ETH_PTP_GetRxTimestamp (ETH_HandleTypeDef *heth, ETH_TimeStampTypeDef *timestamp)
 Get receive timestamp. More...
 
HAL_StatusTypeDef HAL_ETH_RegisterTxPtpCallback (ETH_HandleTypeDef *heth, pETH_txPtpCallbackTypeDef txPtpCallback)
 Register the Tx Ptp callback. More...
 
HAL_StatusTypeDef HAL_ETH_UnRegisterTxPtpCallback (ETH_HandleTypeDef *heth)
 Unregister the Tx Ptp callback. More...
 
HAL_StatusTypeDef HAL_ETH_Transmit (ETH_HandleTypeDef *heth, ETH_TxPacketConfigTypeDef *pTxConfig, uint32_t Timeout)
 Sends an Ethernet Packet in polling mode. More...
 
HAL_StatusTypeDef HAL_ETH_Transmit_IT (ETH_HandleTypeDef *heth, ETH_TxPacketConfigTypeDef *pTxConfig)
 Sends an Ethernet Packet in interrupt mode. More...
 
HAL_StatusTypeDef HAL_ETH_WritePHYRegister (const ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, uint32_t RegValue)
 Writes to a PHY register. More...
 
HAL_StatusTypeDef HAL_ETH_ReadPHYRegister (ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, uint32_t *pRegValue)
 Read a PHY register. More...
 
void HAL_ETH_IRQHandler (ETH_HandleTypeDef *heth)
 This function handles ETH interrupt request. More...
 
void HAL_ETH_TxCpltCallback (ETH_HandleTypeDef *heth)
 Tx Transfer completed callbacks. More...
 
void HAL_ETH_RxCpltCallback (ETH_HandleTypeDef *heth)
 Rx Transfer completed callbacks. More...
 
void HAL_ETH_ErrorCallback (ETH_HandleTypeDef *heth)
 Ethernet transfer error callbacks. More...
 
void HAL_ETH_PMTCallback (ETH_HandleTypeDef *heth)
 Ethernet Power Management module IT callback. More...
 
void HAL_ETH_WakeUpCallback (ETH_HandleTypeDef *heth)
 ETH WAKEUP interrupt callback. More...
 
void HAL_ETH_RxAllocateCallback (uint8_t **buff)
 Rx Allocate callback. More...
 
void HAL_ETH_RxLinkCallback (void **pStart, void **pEnd, uint8_t *buff, uint16_t Length)
 Rx Link callback. More...
 
void HAL_ETH_TxFreeCallback (uint32_t *buff)
 Tx Free callback. More...
 
void HAL_ETH_TxPtpCallback (uint32_t *buff, ETH_TimeStampTypeDef *timestamp)
 Tx Ptp callback. More...
 

Detailed Description

ETH Transmit and Receive functions.

  ==============================================================================
                      ##### IO operation functions #####
  ==============================================================================
  [..]
    This subsection provides a set of functions allowing to manage the ETH
    data transfer.

Function Documentation

◆ HAL_ETH_ErrorCallback()

__weak void HAL_ETH_ErrorCallback ( ETH_HandleTypeDef heth)

Ethernet transfer error callbacks.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
None

Definition at line 2032 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_GetRxDataErrorCode()

HAL_StatusTypeDef HAL_ETH_GetRxDataErrorCode ( const ETH_HandleTypeDef heth,
uint32_t *  pErrorCode 
)

Get the error state of the last received packet.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
pErrorCodepointer to uint32_t to hold the error code
Return values
HALstatus

Definition at line 1382 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_IRQHandler()

void HAL_ETH_IRQHandler ( ETH_HandleTypeDef heth)

This function handles ETH interrupt request.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 1890 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PMTCallback()

__weak void HAL_ETH_PMTCallback ( ETH_HandleTypeDef heth)

Ethernet Power Management module IT callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
None

Definition at line 2047 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_AddTimeOffset()

HAL_StatusTypeDef HAL_ETH_PTP_AddTimeOffset ( ETH_HandleTypeDef heth,
ETH_PtpUpdateTypeDef  ptpoffsettype,
ETH_TimeTypeDef timeoffset 
)

Update time for the Ethernet PTP registers.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
timeoffsetpointer to a ETH_PtpUpdateTypeDef structure that contains the time update information
Return values
HALstatus

Definition at line 1708 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_GetConfig()

HAL_StatusTypeDef HAL_ETH_PTP_GetConfig ( ETH_HandleTypeDef heth,
ETH_PTP_ConfigTypeDef ptpconfig 
)

Get the Ethernet PTP configuration.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
ptpconfigpointer to a ETH_PTP_ConfigTypeDef structure that contains the configuration information for PTP
Return values
HALstatus

Definition at line 1606 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_GetRxTimestamp()

HAL_StatusTypeDef HAL_ETH_PTP_GetRxTimestamp ( ETH_HandleTypeDef heth,
ETH_TimeStampTypeDef timestamp 
)

Get receive timestamp.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
timestamppointer to ETH_TIMESTAMPTypeDef structure that contains receive timestamp
Return values
HALstatus

Definition at line 1814 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_GetTime()

HAL_StatusTypeDef HAL_ETH_PTP_GetTime ( ETH_HandleTypeDef heth,
ETH_TimeTypeDef time 
)

Get Seconds and Nanoseconds for the Ethernet PTP registers.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
timepointer to a ETH_TimeTypeDef structure that contains time to get
Return values
HALstatus

Definition at line 1681 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_GetTxTimestamp()

HAL_StatusTypeDef HAL_ETH_PTP_GetTxTimestamp ( ETH_HandleTypeDef heth,
ETH_TimeStampTypeDef timestamp 
)

Get transmission timestamp.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
timestamppointer to ETH_TIMESTAMPTypeDef structure that contains transmission timestamp
Return values
HALstatus

Definition at line 1783 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_InsertTxTimestamp()

HAL_StatusTypeDef HAL_ETH_PTP_InsertTxTimestamp ( ETH_HandleTypeDef heth)

Insert Timestamp in transmission.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 1754 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_SetConfig()

HAL_StatusTypeDef HAL_ETH_PTP_SetConfig ( ETH_HandleTypeDef heth,
ETH_PTP_ConfigTypeDef ptpconfig 
)

Set the Ethernet PTP configuration.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
ptpconfigpointer to a ETH_PTP_ConfigTypeDef structure that contains the configuration information for PTP
Return values
HALstatus

Definition at line 1540 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_PTP_SetTime()

HAL_StatusTypeDef HAL_ETH_PTP_SetTime ( ETH_HandleTypeDef heth,
ETH_TimeTypeDef time 
)

Set Seconds and Nanoseconds for the Ethernet PTP registers.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
timepointer to a ETH_TimeTypeDef structure that contains time to set
Return values
HALstatus

Definition at line 1650 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_ReadData()

HAL_StatusTypeDef HAL_ETH_ReadData ( ETH_HandleTypeDef heth,
void **  pAppBuff 
)

Read a received packet.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
pAppBuffPointer to an application buffer to receive the packet.
Return values
HALstatus

Definition at line 1083 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_ReadPHYRegister()

HAL_StatusTypeDef HAL_ETH_ReadPHYRegister ( ETH_HandleTypeDef heth,
uint32_t  PHYAddr,
uint32_t  PHYReg,
uint32_t *  pRegValue 
)

Read a PHY register.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
PHYAddrPHY port address, must be a value from 0 to 31
PHYRegPHY register address, must be a value from 0 to 31
pRegValueparameter to hold read value
Return values
HALstatus

Definition at line 2081 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_RegisterRxAllocateCallback()

HAL_StatusTypeDef HAL_ETH_RegisterRxAllocateCallback ( ETH_HandleTypeDef heth,
pETH_rxAllocateCallbackTypeDef  rxAllocateCallback 
)

Register the Rx alloc callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
rxAllocateCallbackpointer to function to alloc buffer
Return values
HALstatus

Definition at line 1277 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_RegisterRxLinkCallback()

HAL_StatusTypeDef HAL_ETH_RegisterRxLinkCallback ( ETH_HandleTypeDef heth,
pETH_rxLinkCallbackTypeDef  rxLinkCallback 
)

Set the Rx link data function.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
rxLinkCallbackpointer to function to link data
Return values
HALstatus

Definition at line 1347 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_RegisterTxFreeCallback()

HAL_StatusTypeDef HAL_ETH_RegisterTxFreeCallback ( ETH_HandleTypeDef heth,
pETH_txFreeCallbackTypeDef  txFreeCallback 
)

Set the Tx free function.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
txFreeCallbackpointer to function to release the packet
Return values
HALstatus

Definition at line 1397 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_RegisterTxPtpCallback()

HAL_StatusTypeDef HAL_ETH_RegisterTxPtpCallback ( ETH_HandleTypeDef heth,
pETH_txPtpCallbackTypeDef  txPtpCallback 
)

Register the Tx Ptp callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
txPtpCallbackFunction to handle Ptp transmission
Return values
HALstatus

Definition at line 1840 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_ReleaseTxPacket()

HAL_StatusTypeDef HAL_ETH_ReleaseTxPacket ( ETH_HandleTypeDef heth)

Release transmitted Tx packets.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 1445 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_RxAllocateCallback()

__weak void HAL_ETH_RxAllocateCallback ( uint8_t **  buff)

Rx Allocate callback.

Parameters
buffpointer to allocated buffer
Return values
None

Definition at line 1311 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_RxCpltCallback()

__weak void HAL_ETH_RxCpltCallback ( ETH_HandleTypeDef heth)

Rx Transfer completed callbacks.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
None

Definition at line 2017 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_RxLinkCallback()

__weak void HAL_ETH_RxLinkCallback ( void **  pStart,
void **  pEnd,
uint8_t *  buff,
uint16_t  Length 
)

Rx Link callback.

Parameters
pStartpointer to packet start
pEndpointer to packet end
buffpointer to received data
Lengthreceived data length
Return values
None

Definition at line 1328 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_Start()

HAL_StatusTypeDef HAL_ETH_Start ( ETH_HandleTypeDef heth)

Enables Ethernet MAC and DMA reception and transmission.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 708 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_Start_IT()

HAL_StatusTypeDef HAL_ETH_Start_IT ( ETH_HandleTypeDef heth)

Enables Ethernet MAC and DMA reception/transmission in Interrupt mode.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 765 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_Stop()

HAL_StatusTypeDef HAL_ETH_Stop ( ETH_HandleTypeDef heth)

Stop Ethernet MAC and DMA reception/transmission.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 833 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_Stop_IT()

HAL_StatusTypeDef HAL_ETH_Stop_IT ( ETH_HandleTypeDef heth)

Stop Ethernet MAC and DMA reception/transmission in Interrupt mode.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 886 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_Transmit()

HAL_StatusTypeDef HAL_ETH_Transmit ( ETH_HandleTypeDef heth,
ETH_TxPacketConfigTypeDef pTxConfig,
uint32_t  Timeout 
)

Sends an Ethernet Packet in polling mode.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
pTxConfigHold the configuration of packet to be transmitted
Timeouttimeout value
Return values
HALstatus

Definition at line 956 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_Transmit_IT()

HAL_StatusTypeDef HAL_ETH_Transmit_IT ( ETH_HandleTypeDef heth,
ETH_TxPacketConfigTypeDef pTxConfig 
)

Sends an Ethernet Packet in interrupt mode.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
pTxConfigHold the configuration of packet to be transmitted
Return values
HALstatus

Definition at line 1031 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_TxCpltCallback()

__weak void HAL_ETH_TxCpltCallback ( ETH_HandleTypeDef heth)

Tx Transfer completed callbacks.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
None

Definition at line 2002 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_TxFreeCallback()

__weak void HAL_ETH_TxFreeCallback ( uint32_t *  buff)

Tx Free callback.

Parameters
buffpointer to buffer to free
Return values
None

Definition at line 1430 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_TxPtpCallback()

__weak void HAL_ETH_TxPtpCallback ( uint32_t *  buff,
ETH_TimeStampTypeDef timestamp 
)

Tx Ptp callback.

Parameters
buffpointer to application buffer
timestamppointer to ETH_TimeStampTypeDef structure that contains transmission timestamp
Return values
None

Definition at line 1874 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_UnRegisterRxAllocateCallback()

HAL_StatusTypeDef HAL_ETH_UnRegisterRxAllocateCallback ( ETH_HandleTypeDef heth)

Unregister the Rx alloc callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 1298 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_UnRegisterRxLinkCallback()

HAL_StatusTypeDef HAL_ETH_UnRegisterRxLinkCallback ( ETH_HandleTypeDef heth)

Unregister the Rx link callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 1367 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_UnRegisterTxFreeCallback()

HAL_StatusTypeDef HAL_ETH_UnRegisterTxFreeCallback ( ETH_HandleTypeDef heth)

Unregister the Tx free callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 1417 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_UnRegisterTxPtpCallback()

HAL_StatusTypeDef HAL_ETH_UnRegisterTxPtpCallback ( ETH_HandleTypeDef heth)

Unregister the Tx Ptp callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
HALstatus

Definition at line 1859 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_WakeUpCallback()

__weak void HAL_ETH_WakeUpCallback ( ETH_HandleTypeDef heth)

ETH WAKEUP interrupt callback.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values
None

Definition at line 2063 of file stm32f4xx_hal_eth.c.

◆ HAL_ETH_WritePHYRegister()

HAL_StatusTypeDef HAL_ETH_WritePHYRegister ( const ETH_HandleTypeDef heth,
uint32_t  PHYAddr,
uint32_t  PHYReg,
uint32_t  RegValue 
)

Writes to a PHY register.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
PHYAddrPHY port address, must be a value from 0 to 31
PHYRegPHY register address, must be a value from 0 to 31
RegValuethe value to write
Return values
HALstatus

Definition at line 2132 of file stm32f4xx_hal_eth.c.