Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
NuttX Read SX1262 Registers (See https://lupyuen.github.io/articles/sx1262)
nsh> sx1262_test
libsx1262 OK!
read_registers
SX126xIoInit
init_spi
SX126xWakeup
sx126x_hal_write: command_length=1, data_length=1
spi tx: c0 00
spi rx: 45 45
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 00 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x00 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 01 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x01 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 02 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x02 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 03 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x03 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 04 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x04 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 05 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x05 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 06 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x06 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 07 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x07 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 08 00 00
spi rx: a2 a2 a2 a2 80
TODO: SX126xWaitOnBusy
Register 0x08 = 0x80
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 09 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x09 = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 0a 00 00
spi rx: a2 a2 a2 a2 01
TODO: SX126xWaitOnBusy
Register 0x0a = 0x01
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 0b 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x0b = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 0c 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x0c = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 0d 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x0d = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 0e 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x0e = 0x00
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 00 0f 00 00
spi rx: a2 a2 a2 a2 00
TODO: SX126xWaitOnBusy
Register 0x0f = 0x00
TODO: create_task
init_driver
TODO: SX126xReset
SX126xIoInit
init_spi
TODO: SX126X interrupt init
SX126xWakeup
sx126x_hal_write: command_length=1, data_length=1
spi tx: c0 00
spi rx: a2 22
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 80 00
spi rx: a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 9d 01
spi rx: a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 80 00
spi rx: a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 96 01
spi rx: a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=2
spi tx: 8f 00 00
spi rx: a2 a2 a2
TODO: SX126xWaitOnBusy
SX126xSetTxParams: power=22, rampTime=7
SX126xGetDeviceId: SX1262
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 08 d8 00 00
spi rx: a2 a2 a2 a2 c8
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=1
spi tx: 0d 08 d8 de
spi rx: a2 a2 a2 a2
TODO: SX126xWaitOnBusy
SX126xSetPaConfig: paDutyCycle=4, hpMax=7, deviceSel=0, paLut=1
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=4
spi tx: 95 04 07 00 01
spi rx: a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=1
spi tx: 0d 08 e7 38
spi rx: a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=2
spi tx: 8e 16 07
spi rx: a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=8
spi tx: 08 ff ff ff ff 00 00 00 00
spi rx: a2 a2 a2 a2 a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=9
spi tx: 1d 02 9f 00 00 00 00 00 00 00 00 00 00
spi rx: a2 a2 a2 a2 00 be 0e ec 80 69 0d 42 c7
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=9
spi tx: 0d 02 9f 01 08 ac ec 80 69 0d 42 c7
spi rx: a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=9
spi tx: 1d 02 9f 00 00 00 00 00 00 00 00 00 00
spi rx: a2 a2 a2 a2 01 08 ac ec 80 69 0d 42 c7
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=9
spi tx: 0d 02 9f 02 08 ac 08 89 69 0d 42 c7
spi rx: a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: TimerInit
TODO: TimerInit
RadioSetChannel: freq=923000000
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=2
spi tx: 98 e1 e9
spi rx: a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=4
spi tx: 86 39 b0 00 00
spi rx: a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
RadioSetTxConfig: modem=1, power=14, fdev=0, bandwidth=0, datarate=7, coderate=1, preambleLen=8, fixLen=0, crcOn=1, freqHopOn=0, hopPeriod=0, iqInverted=0, timeout=3000
RadioSetTxConfig: SpreadingFactor=7, Bandwidth=4, CodingRate=1, LowDatarateOptimize=0, PreambleLength=8, HeaderType=0, PayloadLength=255, CrcMode=1, InvertIQ=0
RadioStandby
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 80 00
spi rx: a2 a2
TODO: SX126xWaitOnBusy
RadioSetModem
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 8a 01
spi rx: a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=4
spi tx: 8b 07 04 01 00
spi rx: a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=6
spi tx: 8c 00 08 00 ff 01 00
spi rx: a2 a2 a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 08 89 00 00
spi rx: a2 a2 a2 a2 04
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=1
spi tx: 0d 08 89 04
spi rx: a2 a2 a2 a2
TODO: SX126xWaitOnBusy
SX126xSetRfTxPower
SX126xSetTxParams: power=14, rampTime=7
SX126xGetDeviceId: SX1262
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 08 d8 00 00
spi rx: a2 a2 a2 a2 fe
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=1
spi tx: 0d 08 d8 fe
spi rx: a2 a2 a2 a2
TODO: SX126xWaitOnBusy
SX126xSetPaConfig: paDutyCycle=4, hpMax=7, deviceSel=0, paLut=1
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=4
spi tx: 95 04 07 00 01
spi rx: a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=1
spi tx: 0d 08 e7 38
spi rx: a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=2
spi tx: 8e 0e 07
spi rx: a2 a2 a2
TODO: SX126xWaitOnBusy
RadioSetRxConfig
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 9f 00
spi rx: a2 a2
TODO: SX126xWaitOnBusy
RadioStandby
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 80 00
spi rx: a2 a2
TODO: SX126xWaitOnBusy
RadioSetModem
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: 8a 01
spi rx: a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=4
spi tx: 8b 07 04 01 00
spi rx: a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=6
spi tx: 8c 00 08 00 ff 01 00
spi rx: a2 a2 a2 a2 a2 a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=1, data_length=1
spi tx: a0 00
spi rx: a2 a2
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_read: command_length=4, data_length=1
spi tx: 1d 07 36 00 00
spi rx: a2 a2 a2 a2 0d
TODO: SX126xWaitOnBusy
TODO: SX126xWaitOnBusy
sx126x_hal_write: command_length=3, data_length=1
spi tx: 0d 07 36 0d
spi rx: a2 a2 a2 a2
TODO: SX126xWaitOnBusy
RadioSetRxConfig done
Done!
nsh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment