NRF24L01_class module

class NRF24L01_class.NRF24L01(H)[source]
R_REG = 0
W_REG = 32
RX_PAYLOAD = 97
TX_PAYLOAD = 160
ACK_PAYLOAD = 168
FLUSH_TX = 225
FLUSH_RX = 226
ACTIVATE = 80
R_STATUS = 255
NRF_CONFIG = 0
EN_AA = 1
EN_RXADDR = 2
SETUP_AW = 3
SETUP_RETR = 4
RF_CH = 5
RF_SETUP = 6
NRF_STATUS = 7
OBSERVE_TX = 8
CD = 9
RX_ADDR_P0 = 10
RX_ADDR_P1 = 11
RX_ADDR_P2 = 12
RX_ADDR_P3 = 13
RX_ADDR_P4 = 14
RX_ADDR_P5 = 15
TX_ADDR = 16
RX_PW_P0 = 17
RX_PW_P1 = 18
RX_PW_P2 = 19
RX_PW_P3 = 20
RX_PW_P4 = 21
RX_PW_P5 = 22
R_RX_PL_WID = 96
FIFO_STATUS = 23
DYNPD = 28
FEATURE = 29
PAYLOAD_SIZE = 0
ACK_PAYLOAD_SIZE = 0
READ_PAYLOAD_SIZE = 0
ADC_COMMANDS = 1
READ_ADC = 0
I2C_COMMANDS = 2
I2C_TRANSACTION = 0
I2C_WRITE = 16
SCAN_I2C = 32
PULL_SCL_LOW = 48
I2C_CONFIG = 64
I2C_READ = 80
NRF_COMMANDS = 3
NRF_READ_REGISTER = 0
NRF_WRITE_REGISTER = 16
CURRENT_ADDRESS = 11184641
nodelist = {}
nodepos = 0
NODELIST_MAXLENGTH = 15
init()[source]
rxmode()[source]

Puts the radio into listening mode.

txmode()[source]

Puts the radio into transmit mode.

triggerAll(val)[source]
power_down()[source]
rxchar()[source]

Receives a 1 Byte payload

txchar(char)[source]

Transmits a single character

hasData()[source]

Check if the RX FIFO contains data

flush()[source]

Flushes the TX and RX FIFOs

write_register(address, value)[source]

write a byte to any of the configuration registers on the Radio. address byte can either be located in the NRF24L01+ manual, or chosen from some of the constants defined in this module.

read_register(address)[source]

Read the value of any of the configuration registers on the radio module.

get_status()[source]

Returns a byte representing the STATUS register on the radio. Refer to NRF24L01+ documentation for further details

write_command(cmd)[source]
write_address(register, address)[source]

register can be TX_ADDR, RX_ADDR_P0 -> RX_ADDR_P5 3 byte address. eg 0xFFABXX . XX cannot be FF if RX_ADDR_P1 needs to be used along with any of the pipes from P2 to P5, then RX_ADDR_P1 must be updated last. Addresses from P1-P5 must share the first two bytes.

selectAddress(address)[source]
read_payload(numbytes)[source]
write_payload(data, verbose=False, **args)[source]
I2C_scan()[source]
transaction(data, **args)[source]
transactionWithRetries(data, **args)[source]
write_ack_payload(data, pipe)[source]
start_token_manager()[source]
stop_token_manager()[source]
total_tokens()[source]
fetch_report(num)[source]
get_nodelist()[source]

Refer to the variable ‘nodelist’ if you simply want a list of nodes that either registered while your code was running , or were loaded from the firmware buffer(max 15 entries)

If you plan to use more than 15 nodes, and wish to register their addresses without having to feed them manually, then this function must be called each time before the buffer resets.

The dictionary object returned by this function [addresses paired with arrays containing their registered sensors] is filtered by checking with each node if they are alive.

isAlive(addr)[source]
init_shockburst_transmitter(**args)[source]

Puts the radio into transmit mode. Dynamic Payload with auto acknowledge is enabled. upto 5 retransmits with 1ms delay between each in case a node doesn’t respond in time Receivers must acknowledge payloads

init_shockburst_receiver(**args)[source]

Puts the radio into receive mode. Dynamic Payload with auto acknowledge is enabled.

Previous topic

I2C_class module

Next topic

NRF_NODE module

This Page