void A7105_WriteReg(u8 address, u8 data) { CS_LO(); PROTOSPI_xfer(address); PROTOSPI_xfer(data); CS_HI(); }
u8 NRF24L01_ReadReg(u8 reg) { CS_LO(); PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg)); u8 data = PROTOSPI_xfer(0xFF); CS_HI(); return data; }
uint8_t nRF24L01::readReg(uint8_t reg) { CS_LO(); PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg)); uint8_t data = PROTOSPI_xfer(0xFF); CS_HI(); return data; }
uint8_t nRF24L01::writeReg(uint8_t reg, uint8_t data) { CS_LO(); uint8_t res = PROTOSPI_xfer(W_REGISTER | (REGISTER_MASK & reg)); PROTOSPI_xfer(data); CS_HI(); return res; }
uint8_t nRF24L01::activate(uint8_t code) { CS_LO(); uint8_t res = PROTOSPI_xfer(ACTIVATE); PROTOSPI_xfer(code); CS_HI(); return res; }
u8 NRF24L01_Activate(u8 code) { CS_LO(); u8 res = PROTOSPI_xfer(ACTIVATE); PROTOSPI_xfer(code); CS_HI(); return res; }
u8 NRF24L01_WriteReg(u8 reg, u8 data) { CS_LO(); u8 res = PROTOSPI_xfer(W_REGISTER | (REGISTER_MASK & reg)); PROTOSPI_xfer(data); CS_HI(); return res; }
u8 CC2500_ReadReg(u8 address) { CS_LO(); PROTOSPI_xfer(CC2500_READ_SINGLE | address); u8 data = PROTOSPI_xfer(0); CS_HI(); return data; }
void CC2500_WriteRegisterMulti(u8 address, const u8 data[], u8 length) { CS_LO(); PROTOSPI_xfer(CC2500_WRITE_BURST | address); for(int i = 0; i < length; i++) { PROTOSPI_xfer(data[i]); } CS_HI(); }
uint8_t nRF24L01::readPayload(uint8_t *data, uint8_t length) { CS_LO(); uint8_t res = PROTOSPI_xfer(R_RX_PAYLOAD); for(uint8_t i = 0; i < length; i++) { data[i] = PROTOSPI_xfer(0xFF); } CS_HI(); return res; }
uint8_t nRF24L01::readRegisterMulti(uint8_t reg, uint8_t data[], uint8_t length) { CS_LO(); uint8_t res = PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg)); for(uint8_t i = 0; i < length; i++) { data[i] = PROTOSPI_xfer(0xFF); } CS_HI(); return res; }
uint8_t nRF24L01::writePayload(uint8_t *data, uint8_t length) { CS_LO(); uint8_t res = PROTOSPI_xfer(W_TX_PAYLOAD); for (uint8_t i = 0; i < length; i++) { PROTOSPI_xfer(data[i]); } CS_HI(); return res; }
uint8_t nRF24L01::writeRegisterMulti(uint8_t reg, const uint8_t data[], uint8_t length) { CS_LO(); uint8_t res = PROTOSPI_xfer(W_REGISTER | ( REGISTER_MASK & reg)); for (uint8_t i = 0; i < length; i++) { PROTOSPI_xfer(data[i]); } CS_HI(); return res; }
u8 NRF24L01_WriteRegisterMulti(u8 reg, const u8 data[], u8 length) { CS_LO(); u8 res = PROTOSPI_xfer(W_REGISTER | ( REGISTER_MASK & reg)); for (u8 i = 0; i < length; i++) { PROTOSPI_xfer(data[i]); } CS_HI(); return res; }
u8 NRF24L01_ReadRegisterMulti(u8 reg, u8 data[], u8 length) { CS_LO(); u8 res = PROTOSPI_xfer(R_REGISTER | (REGISTER_MASK & reg)); for(u8 i = 0; i < length; i++) { data[i] = PROTOSPI_xfer(0xFF); } CS_HI(); return res; }
u8 NRF24L01_ReadPayload(u8 *data, u8 length) { CS_LO(); u8 res = PROTOSPI_xfer(R_RX_PAYLOAD); for(u8 i = 0; i < length; i++) { data[i] = PROTOSPI_xfer(0xFF); } CS_HI(); return res; }
u8 NRF24L01_WritePayload(u8 *data, u8 length) { CS_LO(); u8 res = PROTOSPI_xfer(W_TX_PAYLOAD); for (u8 i = 0; i < length; i++) { PROTOSPI_xfer(data[i]); } CS_HI(); return res; }
void CC2500_ReadRegisterMulti(u8 address, u8 data[], u8 length) { unsigned char i; CS_LO(); PROTOSPI_xfer(CC2500_READ_BURST | address); for(i = 0; i < length; i++) { data[i] = PROTOSPI_xfer(0); } CS_HI(); }
uint8_t nRF24L01::strobe(uint8_t state) { CS_LO(); uint8_t res = PROTOSPI_xfer(state); CS_HI(); return res; }
static u8 Strobe(u8 state) { CS_LO(); u8 res = PROTOSPI_xfer(state); CS_HI(); return res; }
void A7105_WriteData(u8 *dpbuffer, u8 len, u8 channel) { int i; CS_LO(); PROTOSPI_xfer(A7105_RST_WRPTR); PROTOSPI_xfer(0x05); for (i = 0; i < len; i++) PROTOSPI_xfer(dpbuffer[i]); CS_HI(); A7105_WriteReg(0x0F, channel); CS_LO(); PROTOSPI_xfer(A7105_TX); CS_HI(); }
void A7105_WriteID(u32 id) { CS_LO(); PROTOSPI_xfer(0x06); PROTOSPI_xfer((id >> 24) & 0xFF); PROTOSPI_xfer((id >> 16) & 0xFF); PROTOSPI_xfer((id >> 8) & 0xFF); PROTOSPI_xfer((id >> 0) & 0xFF); CS_HI(); }
u8 A7105_ReadReg(u8 address) { u8 data; CS_LO(); PROTOSPI_xfer(0x40 | address); /* Wait for tx completion before spi shutdown */ data = PROTOSPI_read3wire(); CS_HI(); return data; }
void CC2500_Strobe(u8 state) { CS_LO(); PROTOSPI_xfer(state); CS_HI(); }
void A7105_Strobe(enum A7105_State state) { CS_LO(); PROTOSPI_xfer(state); CS_HI(); }