void ENC28J60_WriteOp(uint8_t op,uint8_t address,uint8_t data) { csactive(); SPDR = op | (address & ADDR_MASK); waitspi(); SPDR = data; waitspi(); cspassive(); }
void ENC28J60_WriteBuffer(uint16_t len,uint8_t* data) { csactive(); SPDR = WBM; waitspi(); while(len) { len--; SPDR = *data; data++; waitspi(); } cspassive(); }
uint8_t ENC28J60_ReadOp(uint8_t op,uint8_t address) { csactive(); SPDR = op | (address & ADDR_MASK); waitspi(); SPDR = 0x00; waitspi(); if(address & 0x80) { SPDR = 0x00; waitspi(); } cspassive(); return(SPDR); }
void ENC28J60_ReadBuffer(uint16_t len,uint8_t* data) { csactive(); SPDR = RBM; waitspi(); while(len) { len--; SPDR = 0x00; waitspi(); *data = SPDR; data++; } *data='\0'; cspassive(); }
uint8_t enc28j60_readOp(uint8_t op, uint8_t address) { csactive(); SPDR = op | (address & ADDR_MASK); waitspi(); SPDR = 0x00; waitspi(); if (address & 0x80) { SPDR = 0x00; waitspi(); } cspassive(); return SPDR; }