From d2f22ea9531ee7e61d3e3c8b818797fd3e947b01 Mon Sep 17 00:00:00 2001 From: Peter Hinch Date: Tue, 11 Feb 2020 06:31:16 +0000 Subject: [PATCH] drivers/nrf24l01: Change pipe addrs in test to match Arduino addrs. These addresses were initially chosen to match the nRF24 Arduino library examples but they are byte-reversed. So change them to be on-air compatible with the Arduino library. Also, the data sheet for the nRF24 says that RX data pipes 1-5 must share the same top 32-bits, and must differ only in the LSbyte. The addresses used here (while correct because they are on TX pipe and RX pipe 0) are misleading in this sense, because it looks like they were chosen to share the top 32-bits per the datasheet. --- drivers/nrf24l01/nrf24l01test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/nrf24l01/nrf24l01test.py b/drivers/nrf24l01/nrf24l01test.py index 876b2bbfa2..4db9571ca0 100644 --- a/drivers/nrf24l01/nrf24l01test.py +++ b/drivers/nrf24l01/nrf24l01test.py @@ -23,7 +23,9 @@ elif sys.platform == 'esp32': # Software SPI else: raise ValueError('Unsupported platform {}'.format(sys.platform)) -pipes = (b'\xf0\xf0\xf0\xf0\xe1', b'\xf0\xf0\xf0\xf0\xd2') +# Addresses are in little-endian format. They correspond to big-endian +# 0xf0f0f0f0e1, 0xf0f0f0f0d2 +pipes = (b'\xe1\xf0\xf0\xf0\xf0', b'\xd2\xf0\xf0\xf0\xf0') def master(): csn = Pin(cfg['csn'], mode=Pin.OUT, value=1)