ksz8851snl.c File Reference

Driver for Micrel KSZ8851SNL ethernet controller. More...

#include "ksz8851snl.h"
#include <stdint.h>
#include <stdbool.h>
#include "ethspi.h"
#include "em_gpio.h"
#include <stdio.h>
Include dependency graph for ksz8851snl.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void KSZ8851SNL_EnableInterupts (void)
 enables the chip interrupts
uint16_t KSZ8851SNL_CheckIrqStat (void)
 Checks for any interrrupts and if found, clears their status and prepair for interrupt handler routines.
uint16_t KSZ8851SNL_CurrFrameSize (void)
 Returns the size of the currently received frame.
static uint8_t KSZ8851SNL_DwordAllignDiff (uint8_t val)
 Returns the difference in bytes to be DWORD alligned.
static void KSZ8851SNL_ExceptionHandler (enum exceptionType_e exc_type, char *param)
 Prints a message with a predetermined exception level Support method used for debugging.
void KSZ8851SNL_ReadMIBCounters (char *param)
 Dumps the Management Information Base Counters.
void KSZ8851SNL_Init (void)
 Initialize the registers of the ethernet controller.
void KSZ8851SNL_Send (uint16_t pTXLength, uint8_t *pTXData)
 Performs the actual transmit of a raw frame over the network.
void KSZ8851SNL_InitiateLongTransmit (uint16_t pTXLength)
 Performs the initialisation of the transmission of a long raw frame over the network.
void KSZ8851SNL_LongTransmit (uint16_t pTXLength, uint8_t *pTXData)
 Performs the actual transmission of a long raw frame over the network.
void KSZ8851SNL_TerminateLongTransmit (uint16_t pTXLength, uint8_t *pTXData)
 Performs the clean up procedures after the transmission of a long raw frame over the network.
static void KSZ8851SNL_ReleaseIncosistentFrame (void)
 Realease the current frame if it is inconsistent.
uint16_t KSZ8851SNL_Receive (uint8_t *pRXData, uint16_t *pRXLength)
 Performs the actual receive of a raw frame over the network.
void KSZ8851SNL_GetMacAddress (uint8_t *macAddress)
 Get the MAC address of the current board.

Detailed Description

Driver for Micrel KSZ8851SNL ethernet controller.

Author:
Energy Micro AS
Version:
3.20.0

License

(C) Copyright 2012 Energy Micro AS, http://www.energymicro.com

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. 2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. 3. This notice may not be removed or altered from any source distribution. 4. The source and compiled code may only be used on Energy Micro "EFM32" microcontrollers and "EFR4" radios.

DISCLAIMER OF WARRANTY/LIMITATION OF REMEDIES: Energy Micro AS has no obligation to support this Software. Energy Micro AS is providing the Software "AS IS", with no express or implied warranties of any kind, including, but not limited to, any implied warranties of merchantability or fitness for any particular purpose or warranties against infringement of any proprietary rights of a third party.

Energy Micro AS will not be liable for any consequential, incidental, or special damages, or any other relief, or for any claim by any third party, arising from your use of this Software.

Definition in file ksz8851snl.c.


Function Documentation

static uint8_t KSZ8851SNL_DwordAllignDiff ( uint8_t  val  )  [static]

Returns the difference in bytes to be DWORD alligned.

Parameters:
val value that needs to be alligned
Returns:
the number of bytes needed to be added so that the value is alligned

Definition at line 217 of file ksz8851snl.c.

Referenced by KSZ8851SNL_Send(), and KSZ8851SNL_TerminateLongTransmit().

Here is the caller graph for this function:

static void KSZ8851SNL_ExceptionHandler ( enum exceptionType_e  exc_type,
char *  param 
) [static]

Prints a message with a predetermined exception level Support method used for debugging.

Parameters:
exc_type the exception level
param the printed string

Definition at line 234 of file ksz8851snl.c.

References DEBUG_PRINT, ETHSPI_WriteRegister(), INT_ENABLE_REG, INT_MASK_EXAMPLE, and NO_INT.

Referenced by KSZ8851SNL_Init(), KSZ8851SNL_InitiateLongTransmit(), KSZ8851SNL_ReleaseIncosistentFrame(), and KSZ8851SNL_Send().

Here is the call graph for this function:

Here is the caller graph for this function:

static void KSZ8851SNL_ReleaseIncosistentFrame ( void   )  [static]

Realease the current frame if it is inconsistent.

Note:
Support method used for minimizing the code size.

Definition at line 738 of file ksz8851snl.c.

References ETHSPI_ReadRegister(), ETHSPI_WriteRegister(), KSZ8851SNL_ExceptionHandler(), RXQ_CMD_REG, and RXQ_RELEASE_CUR_FR.

Referenced by KSZ8851SNL_Receive().

Here is the call graph for this function:

Here is the caller graph for this function: