This is the multi-page printable view of this section. Click here to print...

Return to the regular view of this page

As of 2025-07-24

<MONOSTICK>

For MONOSTICK
    This board behavior is for MONOSTICK. It includes procedures for controlling the built-in watchdog timer and LED.

    Constants

    The following constants are defined:

    const uint8_t PIN_LED = mwx::PIN_DIGITAL::DIO16;  // LED
    
    const uint8_t PIN_WDT = mwx::PIN_DIGITAL::DIO9;     // WDT (shall tick < 1sec)
    const uint8_t PIN_WDT_EN = mwx::PIN_DIGITAL::DIO11; // WDT (LO as WDT enabled)
    
    const uint8_t PIN_LED_YELLOW = mwx::PIN_DIGITAL::DO1; // YELLOW LED
    

    Accessible via MONOSTICK::PIN_LED.

    Hardware Initialization

    pinMode(PIN_LED, OUTPUT_INIT_HIGH);
    pinMode(PIN_WDT, OUTPUT_INIT_LOW);
    pinMode(PIN_WDT_EN, OUTPUT_INIT_LOW);
    pinMode(PIN_LED_YELLOW, OUTPUT);

    Pins are initialized as shown in the code above.

    Watchdog Timer

    The external watchdog timer is reset at startup, after waking from sleep, and after a set duration.

    Methods

    set_led()

    void set_led_red(uint8_t mode, uint16_t tick)
    void set_led_yellow(uint8_t mode, uint16_t tick)

    Controls the red and yellow LEDs.

    mode accepts the following parameters. tick specifies the lighting duration in milliseconds [ms]; see the descriptions for each mode below.

    ParameterMeaning
    LED_TIMER::BLINKThe LED blinks. ON/OFF toggles every tick milliseconds. After waking from sleep, the count resets and starts in the ON state.
    LED_TIMER::ON_RXLights the LED for tick milliseconds upon packet reception.
    LED_TIMER::ON_TX_COMPLights the LED for tick milliseconds upon transmission completion.