ConOpSys V2970  P004.07
ANVILEX control operating system
Functions
ETHERNET_STM32F429.cpp File Reference

STM32F429 on-chip ETHERNET module class implementation file. More...

#include "stm32f429xx.h"
#include "netif/ethernet.h"
#include "lwip/etharp.h"
#include "lwip/timeouts.h"
#include "string.h"
#include "System_Resource.h"
#include "Anvilex_Library.h"
#include "ETHERNET_STM32F429.h"
Include dependency graph for ETHERNET_STM32F429.cpp:

Functions

BOOL PHY_ETH_Init (ETH_HandleTypeDef *heth)
 
BOOL ETH_ReadPHYRegister (ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t *RegValue)
 
BOOL ETH_WritePHYRegister (ETH_HandleTypeDef *heth, uint16_t PHYReg, uint32_t RegValue)
 
static void ETH_MACDMAConfig (ETH_HandleTypeDef *heth, uint32_t err)
 
BOOL HAL_ETH_DMATxDescListInit (ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t *TxBuff, uint32_t TxBuffCount)
 initialises the DMA Tx descriptors in chain mode. More...
 
BOOL ETH_DMARxDescListInit (ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMARxDescTab, uint8_t *RxBuff, uint32_t RxBuffCount)
 initialises the DMA Rx descriptors in chain mode. More...
 
static void ETH_MACAddressConfig (ETH_HandleTypeDef *heth, uint32_t MacAddr, uint8_t *Addr)
 
BOOL ETH_ConfigMAC (ETH_HandleTypeDef *heth, ETH_MACInitTypeDef *macconf)
 Set ETH MAC Configuration. More...
 
BOOL ETH_TransmitFrame (ETH_HandleTypeDef *heth, uint32_t FrameLength)
 
BOOL ETH_Start (ETH_HandleTypeDef *heth)
 Enables Ethernet MAC and DMA reception/transmission. More...
 
BOOL ETH_Stop (ETH_HandleTypeDef *heth)
 Stop Ethernet MAC and DMA reception/transmission. More...
 
static void ETH_MACTransmissionEnable (ETH_HandleTypeDef *heth)
 Enables the MAC transmission. More...
 
static void ETH_MACTransmissionDisable (ETH_HandleTypeDef *heth)
 Disables the MAC transmission. More...
 
static void ETH_MACReceptionEnable (ETH_HandleTypeDef *heth)
 Enables the MAC reception. More...
 
static void ETH_MACReceptionDisable (ETH_HandleTypeDef *heth)
 Disables the MAC reception. More...
 
static void ETH_DMATransmissionEnable (ETH_HandleTypeDef *heth)
 Enables the DMA transmission. More...
 
static void ETH_DMATransmissionDisable (ETH_HandleTypeDef *heth)
 Disables the DMA transmission. More...
 
static void ETH_DMAReceptionEnable (ETH_HandleTypeDef *heth)
 Enables the DMA reception. More...
 
static void ETH_DMAReceptionDisable (ETH_HandleTypeDef *heth)
 Disables the DMA reception. More...
 
static void ETH_FlushTransmitFIFO (ETH_HandleTypeDef *heth)
 Clears the ETHERNET transmit FIFO. More...
 
BOOL ETH_DMATxDescListInit (ETH_HandleTypeDef *heth, ETH_DMADescTypeDef *DMATxDescTab, uint8_t *TxBuff, uint32_t TxBuffCount)
 initialises the DMA Tx descriptors in chain mode. More...
 
BOOL ETH_GetReceivedFrame (ETH_HandleTypeDef *heth)
 ‍** More...
 

Detailed Description

STM32F429 on-chip ETHERNET module class implementation file.

Attention
No special attention requered.
Revision
2781
Date
2021-07-07 13:45:04 +0500 (Mi, 07 Jul 2021)
Author
minch

Function Documentation

◆ ETH_DMAReceptionDisable()

static void ETH_DMAReceptionDisable ( ETH_HandleTypeDef heth)
static

Disables the DMA reception.

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

References heth, and ETH_HandleTypeDef::Instance.

Referenced by ETH_Stop().

Here is the caller graph for this function:

◆ ETH_DMAReceptionEnable()

static void ETH_DMAReceptionEnable ( ETH_HandleTypeDef heth)
static

Enables the DMA reception.

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

References heth, and ETH_HandleTypeDef::Instance.

Referenced by ETH_Start().

Here is the caller graph for this function:

◆ ETH_DMATransmissionDisable()

static void ETH_DMATransmissionDisable ( ETH_HandleTypeDef heth)
static

Disables the DMA transmission.

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

References heth, and ETH_HandleTypeDef::Instance.

Referenced by ETH_Stop().

Here is the caller graph for this function:

◆ ETH_DMATransmissionEnable()

static void ETH_DMATransmissionEnable ( ETH_HandleTypeDef heth)
static

Enables the DMA transmission.

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

References heth, and ETH_HandleTypeDef::Instance.

Referenced by ETH_Start().

Here is the caller graph for this function:

◆ ETH_FlushTransmitFIFO()

static void ETH_FlushTransmitFIFO ( ETH_HandleTypeDef heth)
static

Clears the ETHERNET transmit FIFO.

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

References THigh_Precision_Timer_Base::Delay(), heth, ETH_HandleTypeDef::Instance, and object_Delay_Timer.

Referenced by ETH_Start(), and ETH_Stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ETH_MACAddressConfig()

static void ETH_MACAddressConfig ( ETH_HandleTypeDef heth,
uint32_t  MacAddr,
uint8_t *  Addr 
)
static

References ETH_MAC_ADDR_HBASE, ETH_MAC_ADDR_LBASE, heth, and UNUSED.

Referenced by ETH_MACDMAConfig().

Here is the caller graph for this function:

◆ ETH_MACDMAConfig()

static void ETH_MACDMAConfig ( ETH_HandleTypeDef heth,
uint32_t  err 
)
static

References __HAL_ETH_DMA_ENABLE_IT, ETH_DMAInitTypeDef::AddressAlignedBeats, ETH_MACInitTypeDef::AutomaticPadCRCStrip, ETH_MACInitTypeDef::BackOffLimit, ETH_MACInitTypeDef::BroadcastFramesReception, ETH_MACInitTypeDef::CarrierSense, ETH_InitTypeDef::ChecksumMode, ETH_MACInitTypeDef::ChecksumOffload, ETH_MACInitTypeDef::DeferralCheck, THigh_Precision_Timer_Base::Delay(), ETH_DMAInitTypeDef::DescriptorSkipLength, ETH_MACInitTypeDef::DestinationAddrFilter, ETH_DMAInitTypeDef::DMAArbitration, ETH_DMAInitTypeDef::DropTCPIPChecksumErrorFrame, ETH_DMAInitTypeDef::EnhancedDescriptorFormat, ETH_ADDRESSALIGNEDBEATS_ENABLE, ETH_AUTOMATICPADCRCSTRIP_DISABLE, ETH_BACKOFFLIMIT_10, ETH_BROADCASTFRAMESRECEPTION_ENABLE, ETH_CARRIERSENCE_ENABLE, ETH_CHECKSUM_BY_HARDWARE, ETH_CHECKSUMOFFLAOD_DISABLE, ETH_CHECKSUMOFFLAOD_ENABLE, ETH_DEFFERRALCHECK_DISABLE, ETH_DESTINATIONADDRFILTER_NORMAL, ETH_DMA_IT_NIS, ETH_DMA_IT_R, ETH_DMAARBITRATION_ROUNDROBIN_RXTX_1_1, ETH_DMAENHANCEDDESCRIPTOR_ENABLE, ETH_DMAOMR_CLEAR_MASK, ETH_DROPTCPIPCHECKSUMERRORFRAME_ENABLE, ETH_FIXEDBURST_ENABLE, ETH_FLUSHRECEIVEDFRAME_ENABLE, ETH_FORWARDERRORFRAMES_DISABLE, ETH_FORWARDUNDERSIZEDGOODFRAMES_DISABLE, ETH_INTERFRAMEGAP_96BIT, ETH_JABBER_ENABLE, ETH_LOOPBACKMODE_DISABLE, ETH_MAC_ADDRESS0, ETH_MACAddressConfig(), ETH_MACCR_CLEAR_MASK, ETH_MACFCR_CLEAR_MASK, ETH_MODE_FULLDUPLEX, ETH_MULTICASTFRAMESFILTER_PERFECT, ETH_PASSCONTROLFRAMES_BLOCKALL, ETH_PAUSELOWTHRESHOLD_MINUS4, ETH_PROMISCUOUS_MODE_DISABLE, ETH_RECEIVEAll_DISABLE, ETH_RECEIVEDTHRESHOLDCONTROL_64BYTES, ETH_RECEIVEFLOWCONTROL_DISABLE, ETH_RECEIVEOWN_ENABLE, ETH_RECEIVESTOREFORWARD_ENABLE, ETH_RETRYTRANSMISSION_DISABLE, ETH_RXDMABURSTLENGTH_32BEAT, ETH_RXINTERRUPT_MODE, ETH_SECONDFRAMEOPERARTE_ENABLE, ETH_SOURCEADDRFILTER_DISABLE, ETH_SPEED_100M, ETH_SUCCESS, ETH_TRANSMITFLOWCONTROL_DISABLE, ETH_TRANSMITSTOREFORWARD_ENABLE, ETH_TRANSMITTHRESHOLDCONTROL_64BYTES, ETH_TXDMABURSTLENGTH_32BEAT, ETH_UNICASTFRAMESFILTER_PERFECT, ETH_UNICASTPAUSEFRAMEDETECT_DISABLE, ETH_VLANTAGCOMPARISON_16BIT, ETH_WATCHDOG_ENABLE, ETH_ZEROQUANTAPAUSE_DISABLE, ETH_DMAInitTypeDef::FixedBurst, ETH_DMAInitTypeDef::FlushReceivedFrame, ETH_DMAInitTypeDef::ForwardErrorFrames, ETH_DMAInitTypeDef::ForwardUndersizedGoodFrames, ETH_MACInitTypeDef::HashTableHigh, ETH_MACInitTypeDef::HashTableLow, heth, ETH_HandleTypeDef::Init, ETH_HandleTypeDef::Instance, ETH_MACInitTypeDef::InterFrameGap, ETH_MACInitTypeDef::Jabber, ETH_MACInitTypeDef::LoopbackMode, ETH_InitTypeDef::MACAddr, ETH_MACInitTypeDef::MulticastFramesFilter, object_Delay_Timer, ETH_MACInitTypeDef::PassControlFrames, ETH_MACInitTypeDef::PauseLowThreshold, ETH_MACInitTypeDef::PauseTime, ETH_MACInitTypeDef::PromiscuousMode, ETH_MACInitTypeDef::ReceiveAll, ETH_MACInitTypeDef::ReceiveFlowControl, ETH_MACInitTypeDef::ReceiveOwn, ETH_DMAInitTypeDef::ReceiveStoreForward, ETH_DMAInitTypeDef::ReceiveThresholdControl, ETH_MACInitTypeDef::RetryTransmission, ETH_DMAInitTypeDef::RxDMABurstLength, ETH_DMAInitTypeDef::SecondFrameOperate, ETH_MACInitTypeDef::SourceAddrFilter, ETH_MACInitTypeDef::TransmitFlowControl, ETH_DMAInitTypeDef::TransmitStoreForward, ETH_DMAInitTypeDef::TransmitThresholdControl, ETH_DMAInitTypeDef::TxDMABurstLength, ETH_MACInitTypeDef::UnicastFramesFilter, ETH_MACInitTypeDef::UnicastPauseFrameDetect, ETH_MACInitTypeDef::VLANTagComparison, ETH_MACInitTypeDef::VLANTagIdentifier, ETH_MACInitTypeDef::Watchdog, and ETH_MACInitTypeDef::ZeroQuantaPause.

Referenced by PHY_ETH_Init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ETH_MACReceptionDisable()

static void ETH_MACReceptionDisable ( ETH_HandleTypeDef heth)
static

Disables the MAC reception.

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

References THigh_Precision_Timer_Base::Delay(), heth, ETH_HandleTypeDef::Instance, and object_Delay_Timer.

Referenced by ETH_Stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ETH_MACReceptionEnable()

static void ETH_MACReceptionEnable ( ETH_HandleTypeDef heth)
static

Enables the MAC reception.

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

References THigh_Precision_Timer_Base::Delay(), heth, ETH_HandleTypeDef::Instance, and object_Delay_Timer.

Referenced by ETH_Start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ETH_MACTransmissionDisable()

static void ETH_MACTransmissionDisable ( ETH_HandleTypeDef heth)
static

Disables the MAC transmission.

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

References THigh_Precision_Timer_Base::Delay(), heth, ETH_HandleTypeDef::Instance, and object_Delay_Timer.

Referenced by ETH_Stop().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ETH_MACTransmissionEnable()

static void ETH_MACTransmissionEnable ( ETH_HandleTypeDef heth)
static

Enables the MAC transmission.

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

References THigh_Precision_Timer_Base::Delay(), heth, ETH_HandleTypeDef::Instance, and object_Delay_Timer.

Referenced by ETH_Start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ HAL_ETH_DMATxDescListInit()

BOOL HAL_ETH_DMATxDescListInit ( ETH_HandleTypeDef heth,
ETH_DMADescTypeDef DMATxDescTab,
uint8_t *  TxBuff,
uint32_t  TxBuffCount 
)

initialises the DMA Tx descriptors in chain mode.

Parameters
hethpointer to a ETH_HandleTypeDef structure that contains the configuration information for ETHERNET module
DMATxDescTabPointer to the first Tx desc list
TxBuffPointer to the first TxBuffer list
TxBuffCountNumber of the used Tx desc in the list
Return values
HALstatus

References ETH_DMADescTypeDef::Buffer1Addr, ETH_DMADescTypeDef::Buffer2NextDescAddr, ETH_CHECKSUM_BY_HARDWARE, ETH_DMATXDESC_CHECKSUMTCPUDPICMPFULL, ETH_DMATXDESC_TCH, ETH_STATE_BUSY, ETH_STATE_READY, ETH_TX_BUF_SIZE, heth, ETH_HandleTypeDef::Init, ETH_HandleTypeDef::Instance, ETH_HandleTypeDef::Lock, LOCKED, ETH_HandleTypeDef::State, ETH_DMADescTypeDef::Status, ETH_HandleTypeDef::TxDesc, and UNLOCKED.