moccos mizuki / EthernetXpresso

Dependents:   XNetServicesMin

Embed: (wiki syntax)

« Back to documentation index

LPC1769Emac Class Reference

LPCXpresso LPC1769 ethernet library. More...

#include <LPC1769Emac.h>

Public Member Functions

 LPC1769Emac ()
 Enable LPC1769 ethernet block.
 ~LPC1769Emac ()
 Disable LPC1769 ethernet block.
bool PhyWrite (uint8_t reg, uint16_t value)
 Write 16-bit value to PHY register.
uint16_t PhyRead (uint8_t reg)
 Read 16-bit value from PHY register.
void UpdateAddress (uint8_t a5, uint8_t a4, uint8_t a3, uint8_t a2, uint8_t a1, uint8_t a0)
 Update ethernet address.
void StartRx ()
 Enable RX flags.
void StartTx ()
 Enable TX flags.
void StopRx ()
 Disable RX flags.
void StopTx ()
 Disable TX flags.
bool Link ()
 Check link status.
uint16_t Read (void *buf, uint16_t max_size)
 Read data from received packet.
uint16_t ReadyToReceive ()
 Check received packet.
uint16_t Write (void *buf, uint16_t size)
 Write data to the TX buffer.
bool Send ()
 Send data from the TX buffer to the network.
bool Send (void *buf, uint16_t size)
 Send data from the user buffer to the network.
bool Reset (LinkMode mode=AutoNegotiate)
 Reset ethernet registers and PHY registers.

Static Public Member Functions

static void SetAddress (uint8_t a5, uint8_t a4, uint8_t a3, uint8_t a2, uint8_t a1, uint8_t a0)
 Set ethernet address before initialization for debug.
static const char * getHwAddr ()
 Gets ethernet address.

Detailed Description

LPCXpresso LPC1769 ethernet library.

Author:
moccos <tt.izawa, gmail>

Definition at line 31 of file LPC1769Emac.h.


Constructor & Destructor Documentation

LPC1769Emac (  )

Enable LPC1769 ethernet block.

Definition at line 40 of file LPC1769Emac.cpp.

~LPC1769Emac (  )

Disable LPC1769 ethernet block.

Definition at line 51 of file LPC1769Emac.cpp.


Member Function Documentation

static const char* getHwAddr (  ) [static]

Gets ethernet address.

Returns:
ethernet address

Definition at line 145 of file LPC1769Emac.h.

bool Link (  )

Check link status.

Returns:
true if the link is up

Definition at line 140 of file LPC1769Emac.cpp.

uint16_t PhyRead ( uint8_t  reg )

Read 16-bit value from PHY register.

Parameters:
regregister index. See LAN8710AReg.h.

Definition at line 77 of file LPC1769Emac.cpp.

bool PhyWrite ( uint8_t  reg,
uint16_t  value 
)

Write 16-bit value to PHY register.

Parameters:
regregister index. See LAN8710AReg.h.
value

Definition at line 63 of file LPC1769Emac.cpp.

uint16_t Read ( void *  buf,
uint16_t  max_size 
)

Read data from received packet.

Parameters:
bufdestination buffer
max_size

Definition at line 145 of file LPC1769Emac.cpp.

uint16_t ReadyToReceive (  )

Check received packet.

Returns:
The size of readabe data

Definition at line 170 of file LPC1769Emac.cpp.

bool Reset ( LinkMode  mode = AutoNegotiate )

Reset ethernet registers and PHY registers.

Parameters:
Linkmodeselect auto-negotiation or fixed link speed and duplex

Definition at line 214 of file LPC1769Emac.cpp.

bool Send ( void *  buf,
uint16_t  size 
)

Send data from the user buffer to the network.

Current TX buffer is overwritten.

Parameters:
bufdata

Definition at line 206 of file LPC1769Emac.cpp.

bool Send (  )

Send data from the TX buffer to the network.

Definition at line 191 of file LPC1769Emac.cpp.

void SetAddress ( uint8_t  a5,
uint8_t  a4,
uint8_t  a3,
uint8_t  a2,
uint8_t  a1,
uint8_t  a0 
) [static]

Set ethernet address before initialization for debug.

Definition at line 93 of file LPC1769Emac.cpp.

void StartRx (  )

Enable RX flags.

Definition at line 114 of file LPC1769Emac.cpp.

void StartTx (  )

Enable TX flags.

Definition at line 121 of file LPC1769Emac.cpp.

void StopRx (  )

Disable RX flags.

Definition at line 127 of file LPC1769Emac.cpp.

void StopTx (  )

Disable TX flags.

Definition at line 134 of file LPC1769Emac.cpp.

void UpdateAddress ( uint8_t  a5,
uint8_t  a4,
uint8_t  a3,
uint8_t  a2,
uint8_t  a1,
uint8_t  a0 
)

Update ethernet address.

Definition at line 103 of file LPC1769Emac.cpp.

uint16_t Write ( void *  buf,
uint16_t  size 
)

Write data to the TX buffer.

Parameters:
bufdata

Definition at line 177 of file LPC1769Emac.cpp.