ksz8851snl.c File Reference
Driver for Micrel KSZ8851SNL Ethernet controller.
License
Copyright 2018 Silicon Laboratories Inc. www.silabs.com
SPDX-License-Identifier: Zlib
The licensor of this software is Silicon Laboratories Inc.
This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.
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:
- The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
- Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
- This notice may not be removed or altered from any source distribution.
Definition in file ksz8851snl.c
.
#include <stdio.h>
#include "ksz8851snl.h
"
#include "ksz8851snl_spi.h
"
#include "em_assert.h
"
#include "lwip/sys.h"
#include "lwipopts.h"
#include "lwip/debug.h"
Functions | |
void | KSZ8851SNL_AllRegistersDump (void) |
Prints the value of the registers of the ethernet controller. | |
void | KSZ8851SNL_Enable (void) |
Enable RX and TX. | |
uint16_t | KSZ8851SNL_FrameCounterGet (void) |
FrameCounter. | |
void | KSZ8851SNL_FrameCounterSet (void) |
FrameCounter. | |
void | KSZ8851SNL_Init (void) |
Initialize the registers of the ethernet controller. | |
void | KSZ8851SNL_IntClear (uint16_t flags) |
Clear interrupt flags. | |
void | KSZ8851SNL_IntDisable (void) |
disables the chip interrupts | |
void | KSZ8851SNL_IntEnable (void) |
enables the chip interrupts | |
uint16_t | KSZ8851SNL_IntGet (void) |
Get interrupt flags. | |
void | KSZ8851SNL_MacAddressGet (uint8_t *macAddress) |
Get the MAC address of the current board. | |
void | KSZ8851SNL_MIBCountersDump (void) |
Dumps the Management Information Base Counters. | |
void | KSZ8851SNL_MIBCountersUpdate (void) |
Update the Management Information Base Counters. | |
uint16_t | KSZ8851SNL_PHYStatusGet (void) |
Get the PHY status. | |
void | KSZ8851SNL_PMECRStatusClear (uint16_t flags) |
Clear PMECR (Power Management Event Control Register) flags. | |
uint16_t | KSZ8851SNL_Receive (uint16_t length, uint8_t *buffer) |
Performs the actual receive of a raw frame over the network. | |
void | KSZ8851SNL_RegistersDump (void) |
Prints the value of the registers of the ethernet controller. | |
uint16_t | KSZ8851SNL_RXQCRGet (void) |
Get RXQCR register. | |
void | KSZ8851SNL_RxQueueReset (void) |
Reset RxQueue. | |
void | KSZ8851SNL_Transmit (uint16_t length, const uint8_t *buffer) |
Transmit a chunk of data to the ethernet controller. The chunk can be either a full ethernet frame or a partial chunk of an ethernet frame. | |
bool | KSZ8851SNL_TransmitBegin (uint16_t length) |
Prepares for a transmission of an ethernet frame over the network. | |
void | KSZ8851SNL_TransmitEnd (uint16_t length) |
Ends a transmission of an ethernet frame to the ethernet controller. | |
void | KSZ8851SNL_TxQueueReset (void) |
Reset TxQueue. | |
static uint32_t | MIBCountersRead (uint16_t offset) |
helper function for KSZ8851SNL_UpdateMIBCounters | |
static void | ReleaseIncosistentFrame (void) |
Release the current frame if it is inconsistent. | |
Variables | |
static KSZ8851SLN_mib_t | mibCounters |
Copy of the current MIB counters values from the ksz8851snl. This is updated by calling KSZ8851SNL_MIBCountersUpdate. | |