C++ DevKit
C++ set of OOP library
Loading...
Searching...
No Matches
rtos_switch_button.h File Reference
#include "pico/stdio.h"
#include "pico/stdlib.h"
#include "hardware/timer.h"
#include <stdio.h>
#include "sw/ui_core/ui_control_event.h"
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
Include dependency graph for rtos_switch_button.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  struct_IRQData
 data structure used by ISR to capture, mask, time. More...
 
struct  struct_ControlEventData
 this is the structure used to transmit control event through the queue More...
 
struct  struct_rtosConfigSwitchButton
 These are the values used to configure a switch button delays related to action of the button (and generate IRQ) are expressed in microsecond, delays related to an absence of action on the button are expressed in milliseconds. (0) debounce_delay_us (1) long_release_delay_us (2) long_push_delay_ms (3) time_out_delay_ms (4) active_lo. More...
 
class  rtosSwitchButton
 rtosSwitchButton is processed by an Interrupt Service Routine (ISR) under control of FreeRTOS routines. More...
 

Macros

#define GPIO_HI   true
 the boolean meaning for GPIO_HI
 
#define GPIO_LO   false
 the boolean meaning for GPIO_LO
 
#define DEBOUNCE_us   10000
 the default value for debounce_delay_us
 
#define LONG_RELEASE_DELAY_us   1000000
 the default value for LONG_RELEASE_DELAY_us
 
#define LONG_PUSH_DELAY_ms   1000
 the default value for LONG_PUSH_DELAY_us
 
#define TIME_OUT_DELAY_ms   5000
 the default value for TIME_OUT_DELAY_us
 

Enumerations

enum class  ButtonState {
  IDLE , ACTIVE , RELEASE_PENDING , TIME_OUT_PENDING ,
  IDLE , ACTIVE , RELEASE_PENDING , TIME_OUT_PENDING
}
 The logical state of the switch (0) IDLE (1) ACTIVE (2) RELEASE_PENDING (3) TIME_OUT_PENDING. More...
 

Detailed Description

Author
xiansnn (xians.nosp@m.nn@h.nosp@m.otmai.nosp@m.l.co.nosp@m.m)
Version
0.1
Date
2025-08-14

Enumeration Type Documentation

◆ ButtonState

enum class ButtonState
strong

The logical state of the switch (0) IDLE (1) ACTIVE (2) RELEASE_PENDING (3) TIME_OUT_PENDING.

Enumerator
IDLE 

The button is inactive.

ACTIVE 

the switch has been pushed, the button is active

RELEASE_PENDING 

A long push has been detected, the switch wait to be released.

TIME_OUT_PENDING 

the switch has beeb released, the button wait for next action. If nothing occurs, a time_out event is returned and the button is inactive

IDLE 

The button is inactive.

ACTIVE 

the switch has been pushed, the button is active

RELEASE_PENDING 

A long push has been detected, the switch wait to be released.

TIME_OUT_PENDING 

the switch has beeb released, the button wait for next action. If nothing occurs, a time_out event is returned and the button is inactive