nrf24l01/nrf24.c
// Set transceiver to it's initial state
// note: RX/TX pipe addresses remains untouched
Set transceiver to it's initial state
note: RX/TX pipe addresses remains untouched
Set transceiver to it ' s initial state note : RX / TX pipe addresses remains untouched
void nRF24_Init(void) {
	nRF24_WriteReg(nRF24_REG_CONFIG, 0x08);
	nRF24_WriteReg(nRF24_REG_EN_AA, 0x3F);
	nRF24_WriteReg(nRF24_REG_EN_RXADDR, 0x03);
	nRF24_WriteReg(nRF24_REG_SETUP_AW, 0x03);
	nRF24_WriteReg(nRF24_REG_SETUP_RETR, 0x03);
	nRF24_WriteReg(nRF24_REG_RF_CH, 0x02);
	nRF24_WriteReg(nRF24_REG_RF_SETUP, 0x0E);
	nRF24_WriteReg(nRF24_REG_STATUS, 0x00);
	nRF24_WriteReg(nRF24_REG_RX_PW_P0, 0x00);
	nRF24_WriteReg(nRF24_REG_RX_PW_P1, 0x00);
	nRF24_WriteReg(nRF24_REG_RX_PW_P2, 0x00);
	nRF24_WriteReg(nRF24_REG_RX_PW_P3, 0x00);
	nRF24_WriteReg(nRF24_REG_RX_PW_P4, 0x00);
	nRF24_WriteReg(nRF24_REG_RX_PW_P5, 0x00);
	nRF24_WriteReg(nRF24_REG_DYNPD, 0x00);
	nRF24_WriteReg(nRF24_REG_FEATURE, 0x00);
	nRF24_FlushRX();
	nRF24_FlushTX();
	nRF24_ClearIRQFlags();
	nRF24_CSN_H();
}
void nRF24_Init ( void ) { nRF24_WriteReg ( nRF24_REG_CONFIG , 0x08 ) ; nRF24_WriteReg ( nRF24_REG_EN_AA , 0x3F ) ; nRF24_WriteReg ( nRF24_REG_EN_RXADDR , 0x03 ) ; nRF24_WriteReg ( nRF24_REG_SETUP_AW , 0x03 ) ; nRF24_WriteReg ( nRF24_REG_SETUP_RETR , 0x03 ) ; nRF24_WriteReg ( nRF24_REG_RF_CH , 0x02 ) ; nRF24_WriteReg ( nRF24_REG_RF_SETUP , 0x0E ) ; nRF24_WriteReg ( nRF24_REG_STATUS , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_RX_PW_P0 , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_RX_PW_P1 , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_RX_PW_P2 , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_RX_PW_P3 , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_RX_PW_P4 , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_RX_PW_P5 , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_DYNPD , 0x00 ) ; nRF24_WriteReg ( nRF24_REG_FEATURE , 0x00 ) ; nRF24_FlushRX ( ) ; nRF24_FlushTX ( ) ; nRF24_ClearIRQFlags ( ) ; nRF24_CSN_H ( ) ; }
Set transceiver to it's initial state
note: RX/TX pipe addresses remains untouched
Set transceiver to it ' s initial state note : RX / TX pipe addresses remains untouched
// Write to registers their initial values // Clear the FIFO's // Clear any pending interrupt flags // Deassert CSN pin (chip release)