diff --git a/drivers/include/nrf24l01p.h b/drivers/include/nrf24l01p.h index 53b306d9c36b15edb5b0c3d73d563208a1065c14..ec90b801149f46b354bae92e910b07ec10ef7a12 100644 --- a/drivers/include/nrf24l01p.h +++ b/drivers/include/nrf24l01p.h @@ -546,6 +546,15 @@ int nrf24l01p_enable_pipe(nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe); */ int nrf24l01p_disable_pipe(nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe); +/** +* @brief Disable CRC error detection on the nrf24l01+ transceiver. +* +* @param[in] dev Transceiver device to use. +* +* @return 0. +*/ +int nrf24l01p_disable_crc(nrf24l01p_t *dev); + /** * @brief Enable CRC error detection on the nrf24l01+ transceiver. * diff --git a/drivers/nrf24l01p/nrf24l01p.c b/drivers/nrf24l01p/nrf24l01p.c index 344a381b7abe4118d81081a3c208d46fd59d51b2..d409430854d4d2992b6a91ee90dbc0ce5384ddb3 100644 --- a/drivers/nrf24l01p/nrf24l01p.c +++ b/drivers/nrf24l01p/nrf24l01p.c @@ -815,7 +815,13 @@ int nrf24l01p_disable_pipe(nrf24l01p_t *dev, nrf24l01p_rx_pipe_t pipe) return nrf24l01p_write_reg(dev, REG_EN_RXADDR, pipe_conf); } +int nrf24l01p_disable_crc(nrf24l01p_t *dev) +{ + char conf; + nrf24l01p_read_reg(dev, REG_CONFIG, &conf); + return nrf24l01p_write_reg(dev, REG_CONFIG, (conf & ~(EN_CRC))); +} int nrf24l01p_enable_crc(nrf24l01p_t *dev, nrf24l01p_crc_t crc) { diff --git a/tests/driver_nrf24l01p_lowlevel/README.md b/tests/driver_nrf24l01p_lowlevel/README.md index 4cf5aa8f6e53b3fc9cacb08249ba4af45285a31d..5350da6852cf8870adce7aa62a5b6a23fcdf269f 100644 --- a/tests/driver_nrf24l01p_lowlevel/README.md +++ b/tests/driver_nrf24l01p_lowlevel/README.md @@ -107,3 +107,12 @@ nrf24l01p_rx_handler got a message: Received packet. 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 ``` + +## Compatibility with SI24R1 or other NRF24l01p clones +CRC and Auto-ACK should be disabled. +Use +``` +nrf24l01p_disable_all_auto_ack(&nrf24l01p_0); +nrf24l01p_disable_crc(&nrf24l01p_0); +``` +after `nrf24l01p_init(&nrf24l01p_0, SPI_PORT, CE_PIN, CS_PIN, IRQ_PIN) < 0)`