Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
Event Manager
+ Collaboration diagram for Event Manager:

Macros

#define DEFINE_EVENT_WAKEUP_NBR   0x01
 
#define DEFINE_EVENT_KEYPAD_NBR   0x10
 
#define DEFINE_EVENT_IR_NBR   0x20
 
#define DEFINE_EVENT_SYSTEM_NBR   0x30
 
#define DEFINE_EVENT_KEY_NBR   0x40
 
#define DEFINE_EVENT_APP_NBR   0x70
 
#define BTN_EVENT_FILTER(btnEvent)   ((btnEvent >= DEFINE_EVENT_KEY_NBR) && (btnEvent < EVENT_BTN_MAX))
 
#define EventSchedulerInit   ZAF_eventSchedulerInit
 
#define ZCB_EventSchedulerEventAdd   ZCB_eventSchedulerEventAdd
 
#define ZCB_EventScheduler   ZCB_eventScheduler
 
#define ZCB_EventEnqueue   ZAF_jobEnqueue
 
#define ZCB_EventDequeue   ZAF_jobDequeue
 

Typedefs

typedef enum _EVENT_SYSTEM_ EVENT_SYSTEM
 
typedef enum _BUTTON_EVENT_ BUTTON_EVENT
 

Enumerations

enum  _EVENT_SYSTEM_ {
  EVENT_SYSTEM_RESET = DEFINE_EVENT_SYSTEM_NBR ,
  EVENT_SYSTEM_LEARNMODE_START ,
  EVENT_SYSTEM_LEARNMODE_FINISHED ,
  EVENT_SYSTEM_LEARNMODE_STOP ,
  EVENT_SYSTEM_LEARNMODE_TOGGLE ,
  EVENT_SYSTEM_WATCHDOG_RESET ,
  EVENT_SYSTEM_OTA_START ,
  EVENT_SYSTEM_LEARNMODE_DSK_START ,
  EVENT_SYSTEM_FLUSHMEM_READY ,
  EVENT_SYSTEM_SMARTSTART_IN_PROGRESS ,
  EVENT_SYSTEM_EMPTY
}
 
enum  _BUTTON_EVENT_ {
  EVENT_PB1_DOWN = DEFINE_EVENT_KEY_NBR ,
  EVENT_PB1_UP ,
  EVENT_PB1_SHORT_PRESS ,
  EVENT_PB1_HOLD ,
  EVENT_PB1_LONG_PRESS ,
  EVENT_PB2_DOWN ,
  EVENT_PB2_UP ,
  EVENT_PB2_SHORT_PRESS ,
  EVENT_PB2_HOLD ,
  EVENT_PB2_LONG_PRESS ,
  EVENT_PB3_DOWN ,
  EVENT_PB3_UP ,
  EVENT_PB3_SHORT_PRESS ,
  EVENT_PB3_HOLD ,
  EVENT_PB3_LONG_PRESS ,
  EVENT_PB4_DOWN ,
  EVENT_PB4_UP ,
  EVENT_PB4_SHORT_PRESS ,
  EVENT_PB4_HOLD ,
  EVENT_PB4_LONG_PRESS ,
  EVENT_PB5_DOWN ,
  EVENT_PB5_UP ,
  EVENT_PB5_SHORT_PRESS ,
  EVENT_PB5_HOLD ,
  EVENT_PB5_LONG_PRESS ,
  EVENT_PB6_DOWN ,
  EVENT_PB6_UP ,
  EVENT_PB6_SHORT_PRESS ,
  EVENT_PB6_HOLD ,
  EVENT_PB6_LONG_PRESS ,
  EVENT_SLIDER1_DOWN ,
  EVENT_SLIDER1_UP ,
  EVENT_SLIDER1_SHORT_PRESS ,
  EVENT_SLIDER1_HOLD ,
  EVENT_SLIDER1_LONG_PRESS ,
  EVENT_BTN_MAX
}
 

Functions

void ZAF_eventSchedulerInit (void(*pApplicationStateMachine)(uint8_t))
 Initializes event scheduler.
 
bool ZCB_eventSchedulerEventAdd (uint8_t event)
 Adds a given event to the event queue.
 
bool ZCB_eventScheduler (void)
 Processes events.
 
bool ZAF_jobEnqueue (uint8_t event)
 Adds a given event to the job queue.
 
bool ZAF_jobDequeue (uint8_t *pEvent)
 Deque job queue.
 
uint8_t ZAF_jobQueueCount (void)
 Get number of events on queue.
 

Detailed Description

Macro Definition Documentation

◆ BTN_EVENT_FILTER

#define BTN_EVENT_FILTER ( btnEvent)    ((btnEvent >= DEFINE_EVENT_KEY_NBR) && (btnEvent < EVENT_BTN_MAX))

◆ DEFINE_EVENT_APP_NBR

#define DEFINE_EVENT_APP_NBR   0x70

Event group for zaf 0x80 - 0xFF

◆ DEFINE_EVENT_IR_NBR

#define DEFINE_EVENT_IR_NBR   0x20

◆ DEFINE_EVENT_KEY_NBR

#define DEFINE_EVENT_KEY_NBR   0x40

Event group for keys 0x40 - 0x6F

◆ DEFINE_EVENT_KEYPAD_NBR

#define DEFINE_EVENT_KEYPAD_NBR   0x10

◆ DEFINE_EVENT_SYSTEM_NBR

#define DEFINE_EVENT_SYSTEM_NBR   0x30

◆ DEFINE_EVENT_WAKEUP_NBR

#define DEFINE_EVENT_WAKEUP_NBR   0x01

Event groups for application state event machine

◆ EventSchedulerInit

#define EventSchedulerInit   ZAF_eventSchedulerInit

◆ ZCB_EventDequeue

#define ZCB_EventDequeue   ZAF_jobDequeue

◆ ZCB_EventEnqueue

#define ZCB_EventEnqueue   ZAF_jobEnqueue

◆ ZCB_EventScheduler

#define ZCB_EventScheduler   ZCB_eventScheduler

◆ ZCB_EventSchedulerEventAdd

#define ZCB_EventSchedulerEventAdd   ZCB_eventSchedulerEventAdd

Typedef Documentation

◆ BUTTON_EVENT

Button events

NB: For every button there MUST be the following events in this order: DOWN, UP, SHORT_PRESS, HOLD, LONG_PRESS The macros BTN_EVENT_xxx in board.h depends on it.

◆ EVENT_SYSTEM

System events

Enumeration Type Documentation

◆ _BUTTON_EVENT_

Button events

NB: For every button there MUST be the following events in this order: DOWN, UP, SHORT_PRESS, HOLD, LONG_PRESS The macros BTN_EVENT_xxx in board.h depends on it.

Enumerator
EVENT_PB1_DOWN 
EVENT_PB1_UP 
EVENT_PB1_SHORT_PRESS 
EVENT_PB1_HOLD 
EVENT_PB1_LONG_PRESS 
EVENT_PB2_DOWN 
EVENT_PB2_UP 
EVENT_PB2_SHORT_PRESS 
EVENT_PB2_HOLD 
EVENT_PB2_LONG_PRESS 
EVENT_PB3_DOWN 
EVENT_PB3_UP 
EVENT_PB3_SHORT_PRESS 
EVENT_PB3_HOLD 
EVENT_PB3_LONG_PRESS 
EVENT_PB4_DOWN 
EVENT_PB4_UP 
EVENT_PB4_SHORT_PRESS 
EVENT_PB4_HOLD 
EVENT_PB4_LONG_PRESS 
EVENT_PB5_DOWN 
EVENT_PB5_UP 
EVENT_PB5_SHORT_PRESS 
EVENT_PB5_HOLD 
EVENT_PB5_LONG_PRESS 
EVENT_PB6_DOWN 
EVENT_PB6_UP 
EVENT_PB6_SHORT_PRESS 
EVENT_PB6_HOLD 
EVENT_PB6_LONG_PRESS 
EVENT_SLIDER1_DOWN 
EVENT_SLIDER1_UP 
EVENT_SLIDER1_SHORT_PRESS 
EVENT_SLIDER1_HOLD 
EVENT_SLIDER1_LONG_PRESS 
EVENT_BTN_MAX 

EVENT_BTN_MAX define the last enum type

◆ _EVENT_SYSTEM_

System events

Enumerator
EVENT_SYSTEM_RESET 
EVENT_SYSTEM_LEARNMODE_START 
EVENT_SYSTEM_LEARNMODE_FINISHED 
EVENT_SYSTEM_LEARNMODE_STOP 
EVENT_SYSTEM_LEARNMODE_TOGGLE 
EVENT_SYSTEM_WATCHDOG_RESET 
EVENT_SYSTEM_OTA_START 
EVENT_SYSTEM_LEARNMODE_DSK_START 
EVENT_SYSTEM_FLUSHMEM_READY 
EVENT_SYSTEM_SMARTSTART_IN_PROGRESS 
EVENT_SYSTEM_EMPTY 

Function Documentation

◆ ZAF_eventSchedulerInit()

void ZAF_eventSchedulerInit ( void(*)(uint8_t) pApplicationStateMachine)

Initializes event scheduler.

◆ ZAF_jobDequeue()

bool ZAF_jobDequeue ( uint8_t * pEvent)

Deque job queue.

Parameters
[out]pEventreturn event from the queue.
Returns
false if queue is empty else true.

◆ ZAF_jobEnqueue()

bool ZAF_jobEnqueue ( uint8_t event)

Adds a given event to the job queue.

Parameters
eventA given event.
Returns
true if given event is added to queue, false if queue full.

◆ ZAF_jobQueueCount()

uint8_t ZAF_jobQueueCount ( void )

Get number of events on queue.

Returns
number of events on queue

◆ ZCB_eventScheduler()

bool ZCB_eventScheduler ( void )

Processes events.

◆ ZCB_eventSchedulerEventAdd()

bool ZCB_eventSchedulerEventAdd ( uint8_t event)

Adds a given event to the event queue.

Parameters
eventA given event.
Returns
true if given event is added to queue, false if queue full.