ethspi.c File Reference

SPI Interface for Ethernet controller; Micrel KSZ8851SNL. More...

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

Go to the source code of this file.

Functions

void ETHSPI_Init (void)
 ETHSPI_Init Initialize SPI interface to Ethernet controller.
static uint8_t ETHSPI_XferSpi (uint8_t data)
 Performs the actual transfer of a byte.
static void ETHSPI_SetChipSelect (bool value)
 Sets/resets the ChipSelect of the SPI.
void ETHSPI_ReadRegister (uint8_t reg, int numBytes, void *data)
 Read ethernet controller register.
void ETHSPI_WriteRegister (uint8_t reg, int numBytes, void *data)
 Write ethernet controller register.
void ETHSPI_StartReadFIFO (void)
 Start reading from the ethernet controller FIFO.
void ETHSPI_StartWriteFIFO (void)
 Start writing to the ethernet controller FIFO.
void ETHSPI_StopFIFO (void)
 Stop read/write the ethernet controller FIFO.
void ETHSPI_ReadFifoContinue (int numBytes, uint8_t *data)
 Continue reading ethernet controller FIFO.
void ETHSPI_WriteFifoContinue (int numBytes, uint8_t *data)
 Continue writing ethernet controller FIFO.

Detailed Description

SPI Interface for Ethernet controller; Micrel KSZ8851SNL.

Version:
3.20.5

License

(C) Copyright 2014 Silicon Labs, http://www.silabs.com

This file is licensensed under the Silabs License Agreement. See the file "Silabs_License_Agreement.txt" for details. Before using this software for any purpose, you must agree to the terms of that agreement.

Definition in file ethspi.c.


Function Documentation

static void ETHSPI_SetChipSelect ( bool  value  )  [static]

Sets/resets the ChipSelect of the SPI.

Parameters:
[in] value if true CS will be set, and reseted otherwise

Definition at line 108 of file ethspi.c.

References SPI_CS_PIN, and SPI_CS_PORT.

Referenced by ETHSPI_ReadRegister(), ETHSPI_StartReadFIFO(), ETHSPI_StartWriteFIFO(), ETHSPI_StopFIFO(), and ETHSPI_WriteRegister().

Here is the caller graph for this function:

static uint8_t ETHSPI_XferSpi ( uint8_t  data  )  [static]

Performs the actual transfer of a byte.

Parameters:
[in] data actual data to be passed towards spi
Returns:
actual data to be received from spi

Definition at line 91 of file ethspi.c.

Referenced by ETHSPI_ReadFifoContinue(), ETHSPI_ReadRegister(), ETHSPI_StartReadFIFO(), ETHSPI_StartWriteFIFO(), ETHSPI_WriteFifoContinue(), and ETHSPI_WriteRegister().

Here is the caller graph for this function: