NXP's driver library for LPC17xx, ported to mbed's online compiler. Not tested! I had to fix a lot of warings and found a couple of pretty obvious bugs, so the chances are there are more. Original: http://ics.nxp.com/support/documents/microcontrollers/zip/lpc17xx.cmsis.driver.library.zip

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

lpc17xx_emac.c File Reference

lpc17xx_emac.c File Reference

: Contains all functions support for Ethernet MAC firmware library on LPC17xx More...

Go to the source code of this file.

Functions

static void tx_descr_init (void)
 Initializes TX Descriptor.
static int32_t write_PHY (uint32_t PhyReg, uint16_t Value)
 Write value to PHY device.
static int32_t read_PHY (uint32_t PhyReg)
 Read value from PHY device.
void setEmacAddr (uint8_t abStationAddr[])
 Set Station MAC address for EMAC module.
Status EMAC_Init (EMAC_CFG_Type *EMAC_ConfigStruct)
 Initializes the EMAC peripheral according to the specified parameters in the EMAC_ConfigStruct.
void EMAC_DeInit (void)
 De-initializes the EMAC peripheral registers to their default reset values.
int32_t EMAC_CheckPHYStatus (uint32_t ulPHYState)
 Check specified PHY status in EMAC peripheral.
int32_t EMAC_SetPHYMode (uint32_t ulPHYMode)
 Set specified PHY mode in EMAC peripheral.
int32_t EMAC_UpdatePHYStatus (void)
 Auto-Configures value for the EMAC configuration register to match with current PHY mode.
void EMAC_SetHashFilter (uint8_t dstMAC_addr[], FunctionalState NewState)
 Enable/Disable hash filter functionality for specified destination MAC address in EMAC module.
int32_t EMAC_CRCCalc (uint8_t frame_no_fcs[], int32_t frame_len)
 Calculates CRC code for number of bytes in the frame.
void EMAC_SetFilterMode (uint32_t ulFilterMode, FunctionalState NewState)
 Enable/Disable Filter mode for each specified type EMAC peripheral.
FlagStatus EMAC_GetWoLStatus (uint32_t ulWoLMode)
 Get status of Wake On LAN Filter for each specified type in EMAC peripheral, clear this status if it is set.
void EMAC_WritePacketBuffer (EMAC_PACKETBUF_Type *pDataStruct)
 Write data to Tx packet data buffer at current index due to TxProduceIndex.
void EMAC_ReadPacketBuffer (EMAC_PACKETBUF_Type *pDataStruct)
 Read data from Rx packet data buffer at current index due to RxConsumeIndex.
void EMAC_StandardIRQHandler (void)
 Standard EMAC IRQ Handler.
void EMAC_SetupIntCBS (uint32_t ulIntType, EMAC_IntCBSType *pfnIntCb)
 Setup/register Call-back function for each interrupt type in EMAC module.
void EMAC_IntCmd (uint32_t ulIntType, FunctionalState NewState)
 Enable/Disable interrupt for each type in EMAC.
IntStatus EMAC_IntGetStatus (uint32_t ulIntType)
 Check whether if specified interrupt flag is set or not for each interrupt type in EMAC and clear interrupt pending if it is set.
Bool EMAC_CheckReceiveIndex (void)
 Check whether if the current RxConsumeIndex is not equal to the current RxProduceIndex.
Bool EMAC_CheckTransmitIndex (void)
 Check whether if the current TxProduceIndex is not equal to the current RxProduceIndex - 1.
FlagStatus EMAC_CheckReceiveDataStatus (uint32_t ulRxStatType)
 Get current status value of receive data (due to RxConsumeIndex)
uint32_t EMAC_GetReceiveDataSize (void)
 Get size of current Received data in received buffer (due to RxConsumeIndex)
void EMAC_UpdateRxConsumeIndex (void)
 Increase the RxConsumeIndex (after reading the Receive buffer to release the Receive buffer) and wrap-around the index if it reaches the maximum Receive Number.
void EMAC_UpdateTxProduceIndex (void)
 Increase the TxProduceIndex (after writting to the Transmit buffer to enable the Transmit buffer) and wrap-around the index if it reaches the maximum Transmit Number.

Variables

static RX_Desc Rx_Desc [EMAC_NUM_RX_FRAG]
 Rx Descriptor data array.

Detailed Description

: Contains all functions support for Ethernet MAC firmware library on LPC17xx

Version:
: 1.0
Date:
: 02. Jun. 2009
Author:
: HieuNguyen

Software that is described herein is for illustrative purposes only which provides customers with programming information regarding the products. This software is supplied "AS IS" without any warranties. NXP Semiconductors assumes no responsibility or liability for the use of the software, conveys no license or title under any patent, copyright, or mask work right to the product. NXP Semiconductors reserves the right to make changes in the software without notification. NXP Semiconductors also make no representation or warranty that such application will be suitable for the specified use without further testing or modification.

Definition in file lpc17xx_emac.c.