Subversion Repositories HomeAutomation

Rev

Rev 210 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 210 Rev 211
Line 245... Line 245...
245
    return(enc28j60Read(EREVID));
245
    return(enc28j60Read(EREVID));
246
}
246
}
247
 
247
 
248
void enc28j60PacketSend(uint16_t len, uint8_t* packet)
248
void enc28j60PacketSend(uint16_t len, uint8_t* packet)
249
{
249
{
-
 
250
    enc28j60WriteOp(ENC28J60_BIT_FIELD_SET, ECON1, ECON1_TXRST);
-
 
251
    enc28j60WriteOp(ENC28J60_BIT_FIELD_CLR, ECON1, ECON1_TXRST);
250
    // Set the write pointer to start of transmit buffer area
252
    // Set the write pointer to start of transmit buffer area
251
    enc28j60Write(EWRPTL, TXSTART_INIT&0xFF);
253
    enc28j60Write(EWRPTL, TXSTART_INIT&0xFF);
252
    enc28j60Write(EWRPTH, TXSTART_INIT>>8);
254
    enc28j60Write(EWRPTH, TXSTART_INIT>>8);
253
    // Set the TXND pointer to correspond to the packet size given
255
    // Set the TXND pointer to correspond to the packet size given
254
    enc28j60Write(ETXNDL, (TXSTART_INIT+len)&0xFF);
256
    enc28j60Write(ETXNDL, (TXSTART_INIT+len)&0xFF);