RFM69.cpp code question

Started by Erikm, May 08, 2024, 02:57:20 PM

Erikm

In the following excerpt of the file RFM69.cpp,

Please explain the last line two lines to me?  It looks like a 2 dimension array "CONFIG", with the first element of the first index being "REG_OPMODE", and the second element being..., well, I don't understand the "RF_OPMODE_SEQUENCER_ON | RF_OPMODE_LISTEN_OFF | RF_OPMODE_STANDBY".
The arguments (constants) are defined in RFM69registers.h;
    #define RF_OPMODE_SEQUENCER_OFF      0x80
    #define RF_OPMODE_LISTEN_OFF          0x00
    #define RF_OPMODE_STANDBY            0x04.


Is it as simple as these three constants being OR'd together?

excerpt-
bool RFM69::initialize(uint8_t freqBand, uint16_t nodeID, uint8_t networkID) {
  _interruptNum = digitalPinToInterrupt(_interruptPin);
  if (_interruptNum == (uint8_t)NOT_AN_INTERRUPT) return false;
[b]const uint8_t CONFIG[][2] = {
    /* 0x01 */ { REG_OPMODE, RF_OPMODE_SEQUENCER_ON | RF_OPMODE_LISTEN_OFF | RF_OPMODE_STANDBY },[/b]

Felix