|
| 1 | +Info: CO2 sensor mini |
| 2 | +Rate: 1 <- nRF24 data rate (0 - 250Kbps, 1 - 1Mbps, 2 - 2Mbps) |
| 3 | +Ch: 121 <- nRF24 channel (0..125) |
| 4 | +CRC: 2 <- nRF24 CRC size |
| 5 | +DPL: 0 <- nRF24 dynamic payload en/dis |
| 6 | +Address: C8C8CF <- nRF24 address (3..5 bytes) |
| 7 | +Resend: 3 <- resend attempts on error |
| 8 | +Delay_ms: 30 <- delay between cmd and resend |
| 9 | + |
| 10 | +Payload struct: 2,1,1 <- field sizes of send packet in bytes, received packet consists of 1 field with default size 1 byte (int8) |
| 11 | +EEPROM=0; RAM=1; PROGMEM=2; ID=3; RESET=4 <- Constants |
| 12 | + |
| 13 | +R default: ,EEPROM,0xC1 <- default for read |
| 14 | +W default: n,,0x81 <- default for write, 'n' - means field value position |
| 15 | +Write start: 0,0,0x8F <- if exist in the file - packet before write a batch |
| 16 | + |
| 17 | +R: ID*=,ID <- Read cmd, '*' - means string like device ID, result in bytes = { 0, 0, 3, 0xC1 } |
| 18 | +R: OSCCAL=0x51,RAM <- Read cmd, result in bytes = { 0x51, 0, 1, 0xC1 } |
| 19 | +R: OSCCAL_EMEM=0 <- Read cmd, result in bytes = { 0, 0, 0, 0xC1 } |
| 20 | +R: CO2=0x67,RAM,0xC2 <- Read cmd, result in bytes = { 0x67, 0, 1, 0xC2 } |
| 21 | + |
| 22 | +R: CO2 threshold*2=5,,0xC2 <- Read cmd, '*2' - means received field with 2 bytes size (int16), result in bytes = { 5, 0, 0, 0xC2 } |
| 23 | +W: CO2 threshold=,5,0x82 <- Write cmd, send pkt = { <from WBatch 1 byte>, <from WBatch 2 byte>, 5, 0x82 } |
| 24 | + |
| 25 | +R: FanLSB[10]=i:9 <- Read cmd, '[n]' - means array with 'n' elements, 'i:n' - means array index field that will be incemented after next cmd |
| 26 | + result in bytes = 1 pkt: { 9, 0, 0, 0xC1 }, 2 pkt: { 10, 0, 0, 0xC1 }, 3 pkt: { 10, 0, 0, 0xC1 },... total 10 packets |
| 27 | +W: FanLSB=,i:9 <- Write cmd, 'i' - index field. Send packets: { n & 0xFF, n >> 8, 9, 0x81 }, { n & 0xFF, n >> 8, 10, 0x81 },... |
| 28 | +W: RxAddr=,1 |
| 29 | +W: Reset=,RESET,0xC1 |
| 30 | + |
| 31 | +RBatch: Settings: ID;OSCCAL;RxAddr;Ch;nRF RETR;CO2 threshold;CO2 correct;FanLSB <- Read Batch, 8 packets will be sent and received |
| 32 | + |
| 33 | +WBatch: Default: RxAddr=0xCF;CO2 threshold=1000;Reset <- Write Batch, Send: { 0,0,0,0x8F }, { 0xCF, 0, 1, 0x81 }, { 0xE8, 0x03, 5, 0x82 }, { 0, 0, 4, 0x81 } |
| 34 | +WBatch: Fans: FanLSB={0xC2,0xC3,0} <- Write Batch, Send: { 0,0,0,0x8F }, { 0xC2, 0, 9, 0x81 }, { 0xC3, 0, 10, 0x81 } |
0 commit comments