# mios32/common/mios32_enc28j60.c File Reference

`#include <mios32.h>`
`#include <string.h>`
`#include <mios32_enc28j60_regs.h>`

## Defines
#define | MIOS32_ENC28J60_MUTEX_TAKE {}
#define | MIOS32_ENC28J60_MUTEX_GIVE {}
#define | WCR (0x2<<5)
#define | BFS (0x4<<5)
#define | BFC (0x5<<5)
#define | RCR (0x0<<5)
#define | RBM ((0x1<<5) | 0x1A)
#define | WBM ((0x3<<5) | 0x1A)
#define | SR ((0x7<<5) | 0x1F)
#define | CSN_0 { MIOS32_SPI_RC_PinSet(MIOS32_ENC28J60_SPI, MIOS32_ENC28J60_SPI_RC_PIN, 0); }
#define | CSN_1 { MIOS32_SPI_RC_PinSet(MIOS32_ENC28J60_SPI, MIOS32_ENC28J60_SPI_RC_PIN, 1); }
#define | RAMSIZE 0x2000
#define | RXSTART 0x0000
#define | RXEND 0x0FFF
#define | TXSTART 0x1000
#define | TXEND 0x1fff
#define | RXSTOP ((TXSTART - 2) | 0x0001)
#define | RXSIZE (RXSTOP - RXSTART + 1)
## Functions
struct | __attribute__ ((packed))
s32 | MIOS32_ENC28J60_Init (u32 mode)
s32 | MIOS32_ENC28J60_PowerOn (void)
s32 | MIOS32_ENC28J60_PowerOff (void)
s32 | MIOS32_ENC28J60_CheckAvailable (u8 was_available)
s32 | MIOS32_ENC28J60_LinkAvailable (void)
s32 | MIOS32_ENC28J60_RevIDGet (void)
s32 | MIOS32_ENC28J60_MAC_AddrSet (u8 new_mac_addr[6])
u8 * | MIOS32_ENC28J60_MAC_AddrGet (void)
s32 | MIOS32_ENC28J60_PackageSend (u8 *buffer, u16 len, u8 *buffer2, u16 len2)
s32 | MIOS32_ENC28J60_PackageReceive (u8 *buffer, u16 buffer_size)
s32 | MIOS32_ENC28J60_MACDiscardRx (void)
s32 | MIOS32_ENC28J60_ReadETHReg (u8 address)
s32 | MIOS32_ENC28J60_ReadMACReg (u8 address)
s32 | MIOS32_ENC28J60_ReadPHYReg (u8 reg)
s32 | MIOS32_ENC28J60_WriteReg (u8 address, u8 data)
s32 | MIOS32_ENC28J60_BFCReg (u8 address, u8 data)
s32 | MIOS32_ENC28J60_BFSReg (u8 address, u8 data)
s32 | MIOS32_ENC28J60_WritePHYReg (u8 reg, u16 data)
s32 | MIOS32_ENC28J60_BankSel (u16 reg)
s32 | MIOS32_ENC28J60_SendSystemReset (void)
s32 | MIOS32_ENC28J60_MACGet (void)
s32 | MIOS32_ENC28J60_MACGetArray (u8 *buffer, u16 len)
s32 | MIOS32_ENC28J60_MACPut (u8 value)
s32 | MIOS32_ENC28J60_MACPutArray (u8 *buffer, u16 len)
## Variables
| ENC_PREAMBLE