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 <gpio.h>
13#include <ev_man.h>
14
19#define GPIO_CONFIG(btn, lpwd, func, short_press, hold, long_press, release_pin) \
20 { \
21 .gpio_no = btn, \
22 .low_power = lpwd, \
23 .on_value = btn ## _ON, \
24 .short_event = short_press, \
25 .hold_event = hold, \
26 .long_event = long_press, \
27 .release_event = release_pin, \
28 }
29
34#define GPIO_INFO() \
35 { \
36 .gpio_state = GPIO_UP, \
37 .gpio_down_count = 0, \
38 }
39
49
54typedef uint32_t tr_zw_event_id_t;
55
70
80
88void apps_hw_init(const gpio_config_t *p_gpio_config,
89 gpio_info_t *p_gpio_info,
90 uint8_t gpio_size);
91
98
105#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:54
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:44
@ GPIO_DOWN
GPIO is down.
Definition apps_hw.h:45
@ GPIO_UP
GPIO is up.
Definition apps_hw.h:46
@ GPIO_HOLD
GPIO is held.
Definition apps_hw.h:47
Framework event manager, handling all event types for the framework.
Defines the configuration of a GPIO.
Definition apps_hw.h:61
tr_zw_event_id_t release_event
The event to trigger when a button is released.
Definition apps_hw.h:68
tr_zw_event_id_t hold_event
The event to trigger when a button is held.
Definition apps_hw.h:67
low_power_wakeup_cfg_t low_power
GPIO low power configuration.
Definition apps_hw.h:63
tr_zw_event_id_t short_event
The event to trigger on a "short" press.
Definition apps_hw.h:65
uint8_t on_value
Defines "on" as either 1 or 0.
Definition apps_hw.h:64
tr_zw_event_id_t long_event
The event to trigger on a "long" press.
Definition apps_hw.h:66
uint8_t gpio_no
GPIO number.
Definition apps_hw.h:62
Defines the info of a GPIO.
Definition apps_hw.h:76
gpio_state_t gpio_state
GPIO state.
Definition apps_hw.h:77
uint32_t gpio_down_count
GPIO down count.
Definition apps_hw.h:78