Firmware SDK
twr_module_sensor.h
1 #ifndef _TWR_MODULE_SENSOR_H
2 #define _TWR_MODULE_SENSOR_H
3 
4 #include <twr_gpio.h>
5 #include <twr_onewire.h>
6 
10 
12 
13 typedef enum
14 {
17 
20 
23 
25 
27 
28 typedef enum
29 {
32 
35 
38 
41 
44 
46 
48 
49 typedef enum
50 {
53 
56 
58 
60 
61 typedef enum
62 {
65 
68 
71 
73 
77 
78 bool twr_module_sensor_init(void);
79 
81 
82 void twr_module_sensor_deinit(void);
83 
89 
91 
95 
97 
101 
103 
107 
109 
113 
115 
119 
121 
125 
127 
130 
132 
137 
138 bool twr_module_sensor_set_vdd(bool on);
139 
141 
143 
146 
148 
152 
154 
158 
160 
162 
163 
164 #endif // _TWR_MODULE_SENSOR_H
void twr_module_sensor_toggle_output(twr_module_sensor_channel_t channel)
Toggle output state for Sensor Module channel.
Channel has pull-up 4k7.
Channel operates as input.
bool twr_module_sensor_onewire_power_down(void)
Semaphore for 1Wire Power down: for R1.1 set VDD Off, for R1.0 pull none on channel A...
void twr_module_sensor_set_output(twr_module_sensor_channel_t channel, int state)
Set output state of Sensor Module channel.
twr_module_sensor_mode_t
Sensor Module mode of operation.
GPIO channel operates as output.
Definition: twr_gpio.h:108
twr_module_sensor_pull_t
Sensor module pull.
bool twr_module_sensor_init(void)
Initialize Sensor Module.
twr_module_sensor_revision_t twr_module_sensor_get_revision(void)
Get Sensor Module revision.
GPIO channel has no pull-up/pull-down.
Definition: twr_gpio.h:90
twr_module_sensor_pull_t twr_module_sensor_get_pull(twr_module_sensor_channel_t channel)
Get pull-up/pull-down configuration for Sensor Module channel.
void twr_module_sensor_set_mode(twr_module_sensor_channel_t channel, twr_module_sensor_mode_t mode)
Set output mode of Sensor Module channel.
GPIO channel has pull-up.
Definition: twr_gpio.h:93
bool twr_module_sensor_set_pull(twr_module_sensor_channel_t channel, twr_module_sensor_pull_t pull)
Set pull of Sensor Module channel.
int twr_module_sensor_get_input(twr_module_sensor_channel_t channel)
Get input of Sensor Module channel.
Channel has internal pull-down.
twr_module_sensor_channel_t
Sensor Module channels.
twr_module_sensor_mode_t twr_module_sensor_get_mode(twr_module_sensor_channel_t channel)
Get mode of operation for Sensor Module channel.
bool twr_module_sensor_onewire_power_up(void)
Semaphore for 1Wire Power up: for R1.1 set VDD On, for R1.0 pull up 56R on channel A...
struct twr_onewire_t twr_onewire_t
1-Wire instance
Definition: twr_onewire.h:14
Channel has pull-up 56R.
Hardware revision unknown.
Hardware revision R1.1.
bool twr_module_sensor_set_vdd(bool on)
Set VDD On / Off.
Channel has no pull.
void twr_module_sensor_deinit(void)
Deinitialize Sensor Module.
GPIO channel operates as input.
Definition: twr_gpio.h:105
Hardware revision R1.0.
GPIO channel has pull-down.
Definition: twr_gpio.h:96
twr_module_sensor_revision_t
Sensor Module hardware revision.
Channel operates as output.
int twr_module_sensor_get_output(twr_module_sensor_channel_t channel)
Get output state for Sensor Module channel.
twr_onewire_t * twr_module_sensor_get_onewire(void)
Initialize and get Instance 1-Wire for channel B.
Channel has internal pull-up.