void nRF24L01_write_register(uint8_t reg, uint8_t * value, uint8_t len) // Writes an array of bytes into inte the nRF24L01 registers. { nRF24L01_CSN_lo; spi_transmit_byte(W_REGISTER | (REGISTER_MASK & reg)); spi_transmit_array(value,len); nRF24L01_CSN_hi; }
void nRF24L01_send(uint8_t * value, uint8_t len) // Sends a data package to the default address. Be sure to send the correct // amount of bytes as configured as payload on the receiver. { nRF24L01_CE_lo; TX_POWERUP; // Power up //nRF24L01_CSN_lo; // Pull down chip select //spi_transmit_byte( FLUSH_TX ); // Write cmd to flush tx fifo //nRF24L01_CSN_hi; // Pull up chip select nRF24L01_CSN_lo; // Pull down chip select spi_transmit_byte( W_TX_PAYLOAD ); // Write cmd to write payload spi_transmit_array(value,len); // Write payload nRF24L01_CSN_hi; // Pull up chip select nRF24L01_CE_hi; // Start transmission }