Trident IoT Z-Wave SDK
Loading...
Searching...
No Matches
apps_hw.h
Go to the documentation of this file.
1
5
6#ifndef APPS_HW_H_
7#define APPS_HW_H_
8
9#include <stdint.h>
10#include "tr_platform.h"
11#include <lpm.h>
12#include <ev_man.h>
13
18#define GPIO_CONFIG(btn, lpwd, func, short_press, hold, long_press, release_pin) \
19 { \
20 .gpio_no = btn, \
21 .low_power = lpwd, \
22 .on_value = btn ## _ON, \
23 .short_event = short_press, \
24 .hold_event = hold, \
25 .long_event = long_press, \
26 .release_event = release_pin, \
27 }
28
33#define GPIO_INFO() \
34 { \
35 .gpio_state = GPIO_UP, \
36 .gpio_down_count = 0, \
37 }
38
48
53typedef uint32_t tr_zw_event_id_t;
54
69
79
87void apps_hw_init(const gpio_config_t *p_gpio_config,
88 gpio_info_t *p_gpio_info,
89 uint8_t gpio_size);
90
97
104#endif /* APPS_HW_H_ */
uint8_t board_indicator_led_off_gpio_state(void)
Returns the GPIO state that defines "off" for the indicator LED.
uint8_t board_indicator_gpio_get(void)
Returns the GPIO used for CC Indicator.
void apps_hw_init(const gpio_config_t *p_gpio_config, gpio_info_t *p_gpio_info, uint8_t gpio_size)
Initializes the application hardware.
struct _gpio_info_t gpio_info_t
Defines the info of a GPIO.
uint32_t tr_zw_event_id_t
Defines an event type.
Definition apps_hw.h:53
struct _gpio_config_t gpio_config_t
Defines the configuration of a GPIO.
enum _gpio_state_t gpio_state_t
Defines the states of a GPIO.
_gpio_state_t
Defines the states of a GPIO.
Definition apps_hw.h:43
@ GPIO_DOWN
GPIO is down.
Definition apps_hw.h:44
@ GPIO_UP
GPIO is up.
Definition apps_hw.h:45
@ GPIO_HOLD
GPIO is held.
Definition apps_hw.h:46
Framework event manager, handling all event types for the framework.
Defines the configuration of a GPIO.
Definition apps_hw.h:60
tr_zw_event_id_t release_event
The event to trigger when a button is released.
Definition apps_hw.h:67
tr_zw_event_id_t hold_event
The event to trigger when a button is held.
Definition apps_hw.h:66
low_power_wakeup_cfg_t low_power
GPIO low power configuration.
Definition apps_hw.h:62
tr_zw_event_id_t short_event
The event to trigger on a "short" press.
Definition apps_hw.h:64
uint8_t on_value
Defines "on" as either 1 or 0.
Definition apps_hw.h:63
tr_zw_event_id_t long_event
The event to trigger on a "long" press.
Definition apps_hw.h:65
uint8_t gpio_no
GPIO number.
Definition apps_hw.h:61
Defines the info of a GPIO.
Definition apps_hw.h:75
gpio_state_t gpio_state
GPIO state.
Definition apps_hw.h:76
uint32_t gpio_down_count
GPIO down count.
Definition apps_hw.h:77