void nRF24L01_set_RADDR(uint8_t * adr) // Sets the receiving address { nRF24L01_CE_lo; nRF24L01_write_register(RX_ADDR_P0,adr,5); nRF24L01_CE_hi; }
void nRF24L01_config() // Sets the important registers in the nRF24L01 module and powers the module // in receiving mode { // Set RF channel nRF24L01_config_register(RF_CH,nRF24L01_CH); // Set length of incoming payload nRF24L01_config_register(RX_PW_P0, nRF24L01_PAYLOAD); //configure 1Mbps uint8_t nRF24L01_PWR_RATE = ( (0<<LNA_HCURR) | (00<RF_PWR) | (0<<RF_DR)); // 18dbm & 1Mbps nRF24L01_write_register(RF_SETUP, &nRF24L01_PWR_RATE,1); // Reset status register nRF24L01_config_register(STATUS,((1<<TX_DS)|(1<<MAX_RT))); // Start receiver //PTX = 0; // Start in receiving mode RX_POWERUP; // Power up in receiving mode nRF24L01_CE_hi; // Listening for pakets //nRF24L01_CE_lo; }
void nRF24L01_set_TADDR(uint8_t * adr) // Sets the transmitting address { nRF24L01_write_register(TX_ADDR, adr,5); }