STM32H735xx HAL User Manual
Functions
IO operation functions
ETH Exported Functions

ETH Transmit and Receive functions. More...

Functions

HAL_StatusTypeDef HAL_ETH_Start (ETH_HandleTypeDef *heth)
 Enables Ethernet MAC and DMA reception and transmission.
HAL_StatusTypeDef HAL_ETH_Start_IT (ETH_HandleTypeDef *heth)
 Enables Ethernet MAC and DMA reception/transmission in Interrupt mode.
HAL_StatusTypeDef HAL_ETH_Stop (ETH_HandleTypeDef *heth)
 Stop Ethernet MAC and DMA reception/transmission.
HAL_StatusTypeDef HAL_ETH_Stop_IT (ETH_HandleTypeDef *heth)
 Stop Ethernet MAC and DMA reception/transmission in Interrupt mode.
HAL_StatusTypeDef HAL_ETH_Transmit (ETH_HandleTypeDef *heth, ETH_TxPacketConfig *pTxConfig, uint32_t Timeout)
 Sends an Ethernet Packet in polling mode.
HAL_StatusTypeDef HAL_ETH_Transmit_IT (ETH_HandleTypeDef *heth, ETH_TxPacketConfig *pTxConfig)
 Sends an Ethernet Packet in interrupt mode.
uint8_t HAL_ETH_IsRxDataAvailable (ETH_HandleTypeDef *heth)
 Checks for received Packets.
HAL_StatusTypeDef HAL_ETH_GetRxDataBuffer (ETH_HandleTypeDef *heth, ETH_BufferTypeDef *RxBuffer)
 This function gets the buffer address of last received Packet.
HAL_StatusTypeDef HAL_ETH_GetRxDataLength (ETH_HandleTypeDef *heth, uint32_t *Length)
 This function gets the length of last received Packet.
HAL_StatusTypeDef HAL_ETH_GetRxDataInfo (ETH_HandleTypeDef *heth, ETH_RxPacketInfo *RxPacketInfo)
 Get the Rx data info (Packet type, VLAN tag, Filters status, ...)
HAL_StatusTypeDef HAL_ETH_BuildRxDescriptors (ETH_HandleTypeDef *heth)
 This function gives back Rx Desc of the last received Packet to the DMA, so ETH DMA will be able to use these descriptors to receive next Packets.
void HAL_ETH_IRQHandler (ETH_HandleTypeDef *heth)
 This function handles ETH interrupt request.
__weak void HAL_ETH_TxCpltCallback (ETH_HandleTypeDef *heth)
 Tx Transfer completed callbacks.
__weak void HAL_ETH_RxCpltCallback (ETH_HandleTypeDef *heth)
 Rx Transfer completed callbacks.
__weak void HAL_ETH_DMAErrorCallback (ETH_HandleTypeDef *heth)
 Ethernet DMA transfer error callbacks.
__weak void HAL_ETH_MACErrorCallback (ETH_HandleTypeDef *heth)
 Ethernet MAC transfer error callbacks.
__weak void HAL_ETH_PMTCallback (ETH_HandleTypeDef *heth)
 Ethernet Power Management module IT callback.
__weak void HAL_ETH_EEECallback (ETH_HandleTypeDef *heth)
 Energy Efficient Etherent IT callback.
__weak void HAL_ETH_WakeUpCallback (ETH_HandleTypeDef *heth)
 ETH WAKEUP interrupt callback.
HAL_StatusTypeDef HAL_ETH_ReadPHYRegister (ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, uint32_t *pRegValue)
 Read a PHY register.
HAL_StatusTypeDef HAL_ETH_WritePHYRegister (ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, uint32_t RegValue)
 Writes to a PHY register.

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_StatusTypeDef HAL_ETH_BuildRxDescriptors ( ETH_HandleTypeDef heth)

This function gives back Rx Desc of the last received Packet to the DMA, so ETH DMA will be able to use these descriptors to receive next Packets.

It should be called after processing the received Packet.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
HALstatus.

Definition at line 1408 of file stm32h7xx_hal_eth.c.

References ETH_RxDescListTypeDef::AppContextDesc, ETH_RxDescListTypeDef::AppDescNbr, ETH_DMARXNDESCRF_BUF1V, ETH_DMARXNDESCRF_BUF2V, ETH_DMARXNDESCRF_IOC, ETH_DMARXNDESCRF_OWN, ETH_RxDescListTypeDef::FirstAppDesc, INCR_RX_DESC_INDEX, __ETH_HandleTypeDef::Instance, ETH_RxDescListTypeDef::ItMode, ETH_RxDescListTypeDef::RxDesc, and __ETH_HandleTypeDef::RxDescList.

Ethernet DMA transfer error callbacks.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
None

Definition at line 1693 of file stm32h7xx_hal_eth.c.

Referenced by ETH_InitCallbacksToDefault(), HAL_ETH_IRQHandler(), and HAL_ETH_UnRegisterCallback().

Energy Efficient Etherent IT callback.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
None

Definition at line 1738 of file stm32h7xx_hal_eth.c.

Referenced by ETH_InitCallbacksToDefault(), HAL_ETH_IRQHandler(), and HAL_ETH_UnRegisterCallback().

HAL_StatusTypeDef HAL_ETH_GetRxDataBuffer ( ETH_HandleTypeDef heth,
ETH_BufferTypeDef RxBuffer 
)

This function gets the buffer address of last received Packet.

Note:
Please insure to allocate the RxBuffer structure before calling this function how to use example: HAL_ETH_GetRxDataLength(heth, &Length); BuffersNbr = (Length / heth->Init.RxBuffLen) + 1; RxBuffer = (ETH_BufferTypeDef *)malloc(BuffersNbr * sizeof(ETH_BufferTypeDef)); HAL_ETH_GetRxDataBuffer(heth, RxBuffer);
Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
RxBuffer,:Pointer to a ETH_BufferTypeDef structure
Return values:
HALstatus

Definition at line 1206 of file stm32h7xx_hal_eth.c.

References ETH_RxDescListTypeDef::AppDescNbr, __ETH_HandleTypeDef::ErrorCode, ETH_DMARXNDESCWBF_PL, ETH_RxDescListTypeDef::FirstAppDesc, HAL_ETH_ERROR_PARAM, HAL_ETH_IsRxDataAvailable(), INCR_RX_DESC_INDEX, __ETH_HandleTypeDef::Init, ETH_InitTypeDef::RxBuffLen, ETH_RxDescListTypeDef::RxDesc, and __ETH_HandleTypeDef::RxDescList.

HAL_StatusTypeDef HAL_ETH_GetRxDataInfo ( ETH_HandleTypeDef heth,
ETH_RxPacketInfo RxPacketInfo 
)
HAL_StatusTypeDef HAL_ETH_GetRxDataLength ( ETH_HandleTypeDef heth,
uint32_t *  Length 
)

This function gets the length of last received Packet.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Length,:parameter to hold Rx packet length
Return values:
HALStatus

Definition at line 1303 of file stm32h7xx_hal_eth.c.

References ETH_RxDescListTypeDef::AppDescNbr, ETH_DMARXNDESCWBF_PL, ETH_RxDescListTypeDef::FirstAppDesc, HAL_ETH_IsRxDataAvailable(), INCR_RX_DESC_INDEX, ETH_RxDescListTypeDef::RxDesc, and __ETH_HandleTypeDef::RxDescList.

Ethernet MAC transfer error callbacks.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
None

Definition at line 1708 of file stm32h7xx_hal_eth.c.

Referenced by ETH_InitCallbacksToDefault(), HAL_ETH_IRQHandler(), and HAL_ETH_UnRegisterCallback().

Ethernet Power Management module IT callback.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
None

Definition at line 1723 of file stm32h7xx_hal_eth.c.

Referenced by ETH_InitCallbacksToDefault(), HAL_ETH_IRQHandler(), and HAL_ETH_UnRegisterCallback().

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

Read a PHY register.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
PHYAddr,:PHY port address, must be a value from 0 to 31
PHYReg,:PHY register address, must be a value from 0 to 31
pRegValue,:parameter to hold read value
Return values:
HALstatus

Definition at line 1771 of file stm32h7xx_hal_eth.c.

References ETH_MDIO_BUS_TIMEOUT, HAL_GetTick(), and __ETH_HandleTypeDef::Instance.

Rx Transfer completed callbacks.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
None

Definition at line 1678 of file stm32h7xx_hal_eth.c.

Referenced by ETH_InitCallbacksToDefault(), HAL_ETH_IRQHandler(), and HAL_ETH_UnRegisterCallback().

HAL_StatusTypeDef HAL_ETH_Start ( ETH_HandleTypeDef heth)

Enables Ethernet MAC and DMA reception and transmission.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
HALstatus

Definition at line 750 of file stm32h7xx_hal_eth.c.

References __ETH_HandleTypeDef::gState, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_BUSY_RX, HAL_ETH_STATE_READY, __ETH_HandleTypeDef::Instance, and __ETH_HandleTypeDef::RxState.

HAL_StatusTypeDef HAL_ETH_Start_IT ( ETH_HandleTypeDef heth)

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

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
HALstatus

Definition at line 791 of file stm32h7xx_hal_eth.c.

References __HAL_ETH_DMA_ENABLE_IT, ETH_DMADescTypeDef::DESC3, ETH_DMARXNDESCRF_IOC, ETH_RX_DESC_CNT, __ETH_HandleTypeDef::gState, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_BUSY_RX, HAL_ETH_STATE_READY, __ETH_HandleTypeDef::Instance, ETH_RxDescListTypeDef::ItMode, ETH_RxDescListTypeDef::RxDesc, __ETH_HandleTypeDef::RxDescList, and __ETH_HandleTypeDef::RxState.

HAL_StatusTypeDef HAL_ETH_Stop ( ETH_HandleTypeDef heth)

Stop Ethernet MAC and DMA reception/transmission.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
HALstatus

Definition at line 854 of file stm32h7xx_hal_eth.c.

References __ETH_HandleTypeDef::gState, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_READY, HAL_ETH_STATE_RESET, __ETH_HandleTypeDef::Instance, and __ETH_HandleTypeDef::RxState.

HAL_StatusTypeDef HAL_ETH_Stop_IT ( ETH_HandleTypeDef heth)

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

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
HALstatus

Definition at line 894 of file stm32h7xx_hal_eth.c.

References __HAL_ETH_DMA_DISABLE_IT, ETH_DMADescTypeDef::DESC3, ETH_DMARXNDESCRF_IOC, ETH_RX_DESC_CNT, __ETH_HandleTypeDef::gState, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_READY, HAL_ETH_STATE_RESET, __ETH_HandleTypeDef::Instance, ETH_RxDescListTypeDef::ItMode, ETH_RxDescListTypeDef::RxDesc, __ETH_HandleTypeDef::RxDescList, and __ETH_HandleTypeDef::RxState.

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

Sends an Ethernet Packet in polling mode.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
pTxConfig,:Hold the configuration of packet to be transmitted
Timeout,:timeout value
Return values:
HALstatus

Definition at line 956 of file stm32h7xx_hal_eth.c.

References ETH_TxDescListTypeDef::CurTxDesc, ETH_DMADescTypeDef::DESC3, __ETH_HandleTypeDef::DMAErrorCode, __ETH_HandleTypeDef::ErrorCode, ETH_DMATXNDESCWBF_OWN, ETH_Prepare_Tx_Descriptors(), __ETH_HandleTypeDef::gState, HAL_ETH_ERROR_BUSY, HAL_ETH_ERROR_DMA, HAL_ETH_ERROR_NONE, HAL_ETH_ERROR_PARAM, HAL_ETH_ERROR_TIMEOUT, HAL_ETH_STATE_ERROR, HAL_ETH_STATE_READY, HAL_GetTick(), INCR_TX_DESC_INDEX, __ETH_HandleTypeDef::Instance, ETH_TxDescListTypeDef::TxDesc, and __ETH_HandleTypeDef::TxDescList.

HAL_StatusTypeDef HAL_ETH_Transmit_IT ( ETH_HandleTypeDef heth,
ETH_TxPacketConfig pTxConfig 
)

Sends an Ethernet Packet in interrupt mode.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
pTxConfig,:Hold the configuration of packet to be transmitted
Return values:
HALstatus

Definition at line 1029 of file stm32h7xx_hal_eth.c.

References ETH_TxDescListTypeDef::CurTxDesc, __ETH_HandleTypeDef::ErrorCode, ETH_Prepare_Tx_Descriptors(), __ETH_HandleTypeDef::gState, HAL_ETH_ERROR_BUSY, HAL_ETH_ERROR_NONE, HAL_ETH_ERROR_PARAM, HAL_ETH_STATE_READY, INCR_TX_DESC_INDEX, __ETH_HandleTypeDef::Instance, ETH_TxDescListTypeDef::TxDesc, and __ETH_HandleTypeDef::TxDescList.

Tx Transfer completed callbacks.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
None

Definition at line 1663 of file stm32h7xx_hal_eth.c.

Referenced by ETH_InitCallbacksToDefault(), HAL_ETH_IRQHandler(), and HAL_ETH_UnRegisterCallback().

ETH WAKEUP interrupt callback.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
Return values:
None

Definition at line 1753 of file stm32h7xx_hal_eth.c.

Referenced by ETH_InitCallbacksToDefault(), HAL_ETH_IRQHandler(), and HAL_ETH_UnRegisterCallback().

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

Writes to a PHY register.

Parameters:
heth,:pointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
PHYAddr,:PHY port address, must be a value from 0 to 31
PHYReg,:PHY register address, must be a value from 0 to 31
RegValue,:the value to write
Return values:
HALstatus

Definition at line 1825 of file stm32h7xx_hal_eth.c.

References ETH_MDIO_BUS_TIMEOUT, HAL_GetTick(), and __ETH_HandleTypeDef::Instance.