STM32F4xx HAL Documentation
Hardware Abstraction Layer for STM32F4 familiy
Loading...
Searching...
No Matches
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.
 
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_ReadData (ETH_HandleTypeDef *heth, void **pAppBuff)
 Read a received packet.
 
HAL_StatusTypeDef HAL_ETH_RegisterRxAllocateCallback (ETH_HandleTypeDef *heth, pETH_rxAllocateCallbackTypeDef rxAllocateCallback)
 Register the Rx alloc callback.
 
HAL_StatusTypeDef HAL_ETH_UnRegisterRxAllocateCallback (ETH_HandleTypeDef *heth)
 Unregister the Rx alloc callback.
 
HAL_StatusTypeDef HAL_ETH_RegisterRxLinkCallback (ETH_HandleTypeDef *heth, pETH_rxLinkCallbackTypeDef rxLinkCallback)
 Set the Rx link data function.
 
HAL_StatusTypeDef HAL_ETH_UnRegisterRxLinkCallback (ETH_HandleTypeDef *heth)
 Unregister the Rx link callback.
 
HAL_StatusTypeDef HAL_ETH_GetRxDataErrorCode (const ETH_HandleTypeDef *heth, uint32_t *pErrorCode)
 Get the error state of the last received packet.
 
HAL_StatusTypeDef HAL_ETH_RegisterTxFreeCallback (ETH_HandleTypeDef *heth, pETH_txFreeCallbackTypeDef txFreeCallback)
 Set the Tx free function.
 
HAL_StatusTypeDef HAL_ETH_UnRegisterTxFreeCallback (ETH_HandleTypeDef *heth)
 Unregister the Tx free callback.
 
HAL_StatusTypeDef HAL_ETH_ReleaseTxPacket (ETH_HandleTypeDef *heth)
 Release transmitted Tx packets.
 
HAL_StatusTypeDef HAL_ETH_Transmit (ETH_HandleTypeDef *heth, ETH_TxPacketConfigTypeDef *pTxConfig, uint32_t Timeout)
 Sends an Ethernet Packet in polling mode.
 
HAL_StatusTypeDef HAL_ETH_Transmit_IT (ETH_HandleTypeDef *heth, ETH_TxPacketConfigTypeDef *pTxConfig)
 Sends an Ethernet Packet in interrupt mode.
 
HAL_StatusTypeDef HAL_ETH_WritePHYRegister (const ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, uint32_t RegValue)
 Writes to a PHY register.
 
HAL_StatusTypeDef HAL_ETH_ReadPHYRegister (ETH_HandleTypeDef *heth, uint32_t PHYAddr, uint32_t PHYReg, uint32_t *pRegValue)
 Read a PHY register.
 
void HAL_ETH_IRQHandler (ETH_HandleTypeDef *heth)
 This function handles ETH interrupt request.
 
void HAL_ETH_TxCpltCallback (ETH_HandleTypeDef *heth)
 Tx Transfer completed callbacks.
 
void HAL_ETH_RxCpltCallback (ETH_HandleTypeDef *heth)
 Rx Transfer completed callbacks.
 
void HAL_ETH_ErrorCallback (ETH_HandleTypeDef *heth)
 Ethernet transfer error callbacks.
 
void HAL_ETH_PMTCallback (ETH_HandleTypeDef *heth)
 Ethernet Power Management module IT callback.
 
void HAL_ETH_WakeUpCallback (ETH_HandleTypeDef *heth)
 ETH WAKEUP interrupt callback.
 
void HAL_ETH_RxAllocateCallback (uint8_t **buff)
 Rx Allocate callback.
 
void HAL_ETH_RxLinkCallback (void **pStart, void **pEnd, uint8_t *buff, uint16_t Length)
 Rx Link callback.
 
void HAL_ETH_TxFreeCallback (uint32_t *buff)
 Tx Free callback.
 
void HAL_ETH_TxPtpCallback (uint32_t *buff, ETH_TimeStampTypeDef *timestamp)
 

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_Start()

HAL_StatusTypeDef HAL_ETH_Start ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References ETH_FlushTransmitFIFO(), ETH_REG_WRITE_DELAY, ETH_RX_DESC_CNT, ETH_UpdateDescriptor(), ETH_HandleTypeDef::gState, HAL_Delay(), HAL_ERROR, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_READY, HAL_ETH_STATE_STARTED, HAL_OK, ETH_HandleTypeDef::Instance, ETH_RxDescListTypeDef::RxBuildDescCnt, and ETH_HandleTypeDef::RxDescList.

◆ HAL_ETH_Start_IT()

HAL_StatusTypeDef HAL_ETH_Start_IT ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References __HAL_ETH_DMA_ENABLE_IT, ETH_FlushTransmitFIFO(), ETH_REG_WRITE_DELAY, ETH_RX_DESC_CNT, ETH_UpdateDescriptor(), ETH_HandleTypeDef::gState, HAL_Delay(), HAL_ERROR, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_READY, HAL_ETH_STATE_STARTED, HAL_OK, ETH_HandleTypeDef::Instance, ETH_RxDescListTypeDef::ItMode, ETH_RxDescListTypeDef::RxBuildDescCnt, and ETH_HandleTypeDef::RxDescList.

◆ HAL_ETH_Stop()

HAL_StatusTypeDef HAL_ETH_Stop ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References ETH_FlushTransmitFIFO(), ETH_REG_WRITE_DELAY, ETH_HandleTypeDef::gState, HAL_Delay(), HAL_ERROR, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_READY, HAL_ETH_STATE_STARTED, HAL_OK, and ETH_HandleTypeDef::Instance.

◆ HAL_ETH_Stop_IT()

HAL_StatusTypeDef HAL_ETH_Stop_IT ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References __HAL_ETH_DMA_DISABLE_IT, ETH_DMADescTypeDef::DESC1, ETH_DMARXDESC_DIC, ETH_FlushTransmitFIFO(), ETH_REG_WRITE_DELAY, ETH_RX_DESC_CNT, ETH_HandleTypeDef::gState, HAL_Delay(), HAL_ERROR, HAL_ETH_STATE_BUSY, HAL_ETH_STATE_READY, HAL_ETH_STATE_STARTED, HAL_OK, ETH_HandleTypeDef::Instance, ETH_RxDescListTypeDef::ItMode, ETH_RxDescListTypeDef::RxDesc, and ETH_HandleTypeDef::RxDescList.

◆ HAL_ETH_ReadData()

◆ HAL_ETH_RegisterRxAllocateCallback()

HAL_StatusTypeDef HAL_ETH_RegisterRxAllocateCallback ( ETH_HandleTypeDef * heth,
pETH_rxAllocateCallbackTypeDef rxAllocateCallback )

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ERROR, HAL_OK, and ETH_HandleTypeDef::rxAllocateCallback.

◆ HAL_ETH_UnRegisterRxAllocateCallback()

HAL_StatusTypeDef HAL_ETH_UnRegisterRxAllocateCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ETH_RxAllocateCallback(), HAL_OK, and ETH_HandleTypeDef::rxAllocateCallback.

◆ HAL_ETH_RegisterRxLinkCallback()

HAL_StatusTypeDef HAL_ETH_RegisterRxLinkCallback ( ETH_HandleTypeDef * heth,
pETH_rxLinkCallbackTypeDef rxLinkCallback )

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ERROR, HAL_OK, and ETH_HandleTypeDef::rxLinkCallback.

◆ HAL_ETH_UnRegisterRxLinkCallback()

HAL_StatusTypeDef HAL_ETH_UnRegisterRxLinkCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ETH_RxLinkCallback(), HAL_OK, and ETH_HandleTypeDef::rxLinkCallback.

◆ HAL_ETH_GetRxDataErrorCode()

HAL_StatusTypeDef HAL_ETH_GetRxDataErrorCode ( const ETH_HandleTypeDef * heth,
uint32_t * pErrorCode )

#include <stm32f4xx_hal_eth.h>

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.

References ETH_DMARXDESC_ERRORS_MASK, HAL_OK, ETH_RxDescListTypeDef::pRxLastRxDesc, and ETH_HandleTypeDef::RxDescList.

◆ HAL_ETH_RegisterTxFreeCallback()

HAL_StatusTypeDef HAL_ETH_RegisterTxFreeCallback ( ETH_HandleTypeDef * heth,
pETH_txFreeCallbackTypeDef txFreeCallback )

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ERROR, HAL_OK, and ETH_HandleTypeDef::txFreeCallback.

◆ HAL_ETH_UnRegisterTxFreeCallback()

HAL_StatusTypeDef HAL_ETH_UnRegisterTxFreeCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ETH_TxFreeCallback(), HAL_OK, and ETH_HandleTypeDef::txFreeCallback.

◆ HAL_ETH_ReleaseTxPacket()

◆ HAL_ETH_Transmit()

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

◆ HAL_ETH_Transmit_IT()

HAL_StatusTypeDef HAL_ETH_Transmit_IT ( ETH_HandleTypeDef * heth,
ETH_TxPacketConfigTypeDef * pTxConfig )

#include <stm32f4xx_hal_eth.h>

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.

References ETH_TxDescListTypeDef::CurrentPacketAddress, ETH_TxDescListTypeDef::CurTxDesc, ETH_HandleTypeDef::ErrorCode, ETH_Prepare_Tx_Descriptors(), ETH_HandleTypeDef::gState, HAL_ERROR, HAL_ETH_ERROR_BUSY, HAL_ETH_ERROR_NONE, HAL_ETH_ERROR_PARAM, HAL_ETH_STATE_STARTED, HAL_OK, INCR_TX_DESC_INDEX, ETH_HandleTypeDef::Instance, ETH_TxPacketConfigTypeDef::pData, and ETH_HandleTypeDef::TxDescList.

◆ HAL_ETH_WritePHYRegister()

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

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ERROR, HAL_GetTick(), HAL_OK, ETH_HandleTypeDef::Instance, and PHY_WRITE_TO.

◆ HAL_ETH_ReadPHYRegister()

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

#include <stm32f4xx_hal_eth.h>

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.

References HAL_ERROR, HAL_GetTick(), HAL_OK, ETH_HandleTypeDef::Instance, and PHY_READ_TO.

◆ HAL_ETH_IRQHandler()

◆ HAL_ETH_TxCpltCallback()

__weak void HAL_ETH_TxCpltCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References UNUSED.

Referenced by HAL_ETH_IRQHandler().

◆ HAL_ETH_RxCpltCallback()

__weak void HAL_ETH_RxCpltCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References UNUSED.

Referenced by HAL_ETH_IRQHandler().

◆ HAL_ETH_ErrorCallback()

__weak void HAL_ETH_ErrorCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References UNUSED.

Referenced by HAL_ETH_IRQHandler().

◆ HAL_ETH_PMTCallback()

__weak void HAL_ETH_PMTCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References UNUSED.

Referenced by HAL_ETH_IRQHandler().

◆ HAL_ETH_WakeUpCallback()

__weak void HAL_ETH_WakeUpCallback ( ETH_HandleTypeDef * heth)

#include <stm32f4xx_hal_eth.h>

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.

References UNUSED.

Referenced by HAL_ETH_IRQHandler().

◆ HAL_ETH_RxAllocateCallback()

__weak void HAL_ETH_RxAllocateCallback ( uint8_t ** buff)

#include <stm32f4xx_hal_eth.h>

Rx Allocate callback.

Parameters
buffpointer to allocated buffer
Return values
None

Definition at line 1311 of file stm32f4xx_hal_eth.c.

References UNUSED.

Referenced by ETH_UpdateDescriptor(), and HAL_ETH_UnRegisterRxAllocateCallback().

◆ HAL_ETH_RxLinkCallback()

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

#include <stm32f4xx_hal_eth.h>

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.

References UNUSED.

Referenced by HAL_ETH_ReadData(), and HAL_ETH_UnRegisterRxLinkCallback().

◆ HAL_ETH_TxFreeCallback()

__weak void HAL_ETH_TxFreeCallback ( uint32_t * buff)

#include <stm32f4xx_hal_eth.h>

Tx Free callback.

Parameters
buffpointer to buffer to free
Return values
None

Definition at line 1430 of file stm32f4xx_hal_eth.c.

References UNUSED.

Referenced by HAL_ETH_ReleaseTxPacket(), and HAL_ETH_UnRegisterTxFreeCallback().

◆ HAL_ETH_TxPtpCallback()

void HAL_ETH_TxPtpCallback ( uint32_t * buff,
ETH_TimeStampTypeDef * timestamp )