1 #ifndef _TWR_MODULE_SENSOR_H
2 #define _TWR_MODULE_SENSOR_H
5 #include <twr_onewire.h>
@ TWR_GPIO_MODE_INPUT
GPIO channel operates as input.
@ TWR_GPIO_MODE_OUTPUT
GPIO channel operates as output.
@ TWR_GPIO_PULL_NONE
GPIO channel has no pull-up/pull-down.
@ TWR_GPIO_PULL_DOWN
GPIO channel has pull-down.
@ TWR_GPIO_PULL_UP
GPIO channel has pull-up.
twr_module_sensor_revision_t twr_module_sensor_get_revision(void)
Get Sensor Module revision.
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.
int twr_module_sensor_get_output(twr_module_sensor_channel_t channel)
Get output state for Sensor Module channel.
void twr_module_sensor_toggle_output(twr_module_sensor_channel_t channel)
Toggle output state for Sensor Module channel.
twr_module_sensor_mode_t twr_module_sensor_get_mode(twr_module_sensor_channel_t channel)
Get mode of operation for Sensor Module channel.
twr_module_sensor_revision_t
Sensor Module hardware revision.
int twr_module_sensor_get_input(twr_module_sensor_channel_t channel)
Get input of Sensor Module channel.
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.
twr_onewire_t * twr_module_sensor_get_onewire(void)
Initialize and get Instance 1-Wire for channel B.
void twr_module_sensor_set_output(twr_module_sensor_channel_t channel, int state)
Set output state of Sensor Module channel.
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.
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.
bool twr_module_sensor_set_vdd(bool on)
Set VDD On / Off.
bool twr_module_sensor_init(void)
Initialize Sensor Module.
twr_module_sensor_mode_t
Sensor Module mode of operation.
twr_module_sensor_pull_t
Sensor module pull.
bool twr_module_sensor_set_pull(twr_module_sensor_channel_t channel, twr_module_sensor_pull_t pull)
Set pull of Sensor Module channel.
twr_module_sensor_channel_t
Sensor Module channels.
void twr_module_sensor_deinit(void)
Deinitialize Sensor Module.
@ TWR_MODULE_SENSOR_REVISION_UNKNOWN
Hardware revision unknown.
@ TWR_MODULE_SENSOR_REVISION_R1_0
Hardware revision R1.0.
@ TWR_MODULE_SENSOR_REVISION_R1_1
Hardware revision R1.1.
@ TWR_MODULE_SENSOR_MODE_INPUT
Channel operates as input.
@ TWR_MODULE_SENSOR_MODE_OUTPUT
Channel operates as output.
@ TWR_MODULE_SENSOR_PULL_UP_4K7
Channel has pull-up 4k7.
@ TWR_MODULE_SENSOR_PULL_DOWN_INTERNAL
Channel has internal pull-down.
@ TWR_MODULE_SENSOR_PULL_UP_INTERNAL
Channel has internal pull-up.
@ TWR_MODULE_SENSOR_PULL_NONE
Channel has no pull.
@ TWR_MODULE_SENSOR_PULL_UP_56R
Channel has pull-up 56R.
@ TWR_MODULE_SENSOR_CHANNEL_B
Channel B.
@ TWR_MODULE_SENSOR_CHANNEL_A
Channel A.
@ TWR_MODULE_SENSOR_CHANNEL_C
Channel C.
struct twr_onewire_t twr_onewire_t
1-Wire instance