nrf24l01/nrf24.c
// Write a new value to register
// input:
//   reg - number of register to write
//   value - value to write
Write a new value to register
input:
reg - number of register to write
value - value to write
Write a new value to register input : reg - number of register to write value - value to write
static void nRF24_WriteReg(uint8_t reg, uint8_t value) {
	nRF24_CSN_L();
	if (reg < nRF24_CMD_W_REGISTER) {
		nRF24_LL_RW(nRF24_CMD_W_REGISTER | (reg & nRF24_MASK_REG_MAP));
		nRF24_LL_RW(value);
	} else {
		nRF24_LL_RW(reg);
		if ((reg != nRF24_CMD_FLUSH_TX) && (reg != nRF24_CMD_FLUSH_RX) && \
				(reg != nRF24_CMD_REUSE_TX_PL) && (reg != nRF24_CMD_NOP)) {
			nRF24_LL_RW(value);
		}
	}
	nRF24_CSN_H();
}
static void nRF24_WriteReg ( uint8_t reg , uint8_t value ) { nRF24_CSN_L ( ) ; if ( reg < nRF24_CMD_W_REGISTER ) { nRF24_LL_RW ( nRF24_CMD_W_REGISTER | ( reg & nRF24_MASK_REG_MAP ) ) ; nRF24_LL_RW ( value ) ; } else { nRF24_LL_RW ( reg ) ; if ( ( reg != nRF24_CMD_FLUSH_TX ) && ( reg != nRF24_CMD_FLUSH_RX ) && ( reg != nRF24_CMD_REUSE_TX_PL ) && ( reg != nRF24_CMD_NOP ) ) { nRF24_LL_RW ( value ) ; } } nRF24_CSN_H ( ) ; }
Write a new value to register
input:
reg - number of register to write
value - value to write
Write a new value to register input : reg - number of register to write value - value to write
// This is a register access // This is a single byte command or future command/register // Send register value