Firmware SDK
|
Driver for Sensor Module. More...
Enumerations | |
enum | twr_module_sensor_channel_t { TWR_MODULE_SENSOR_CHANNEL_A = 0 , TWR_MODULE_SENSOR_CHANNEL_B = 1 , TWR_MODULE_SENSOR_CHANNEL_C = 2 } |
Sensor Module channels. More... | |
enum | twr_module_sensor_pull_t { TWR_MODULE_SENSOR_PULL_NONE = TWR_GPIO_PULL_NONE , TWR_MODULE_SENSOR_PULL_UP_INTERNAL = TWR_GPIO_PULL_UP , TWR_MODULE_SENSOR_PULL_DOWN_INTERNAL = TWR_GPIO_PULL_DOWN , TWR_MODULE_SENSOR_PULL_UP_4K7 = 3 , TWR_MODULE_SENSOR_PULL_UP_56R = 4 } |
Sensor module pull. More... | |
enum | twr_module_sensor_mode_t { TWR_MODULE_SENSOR_MODE_INPUT = TWR_GPIO_MODE_INPUT , TWR_MODULE_SENSOR_MODE_OUTPUT = TWR_GPIO_MODE_OUTPUT } |
Sensor Module mode of operation. More... | |
enum | twr_module_sensor_revision_t { TWR_MODULE_SENSOR_REVISION_UNKNOWN = 0 , TWR_MODULE_SENSOR_REVISION_R1_0 = 1 , TWR_MODULE_SENSOR_REVISION_R1_1 = 2 } |
Sensor Module hardware revision. More... | |
Functions | |
bool | twr_module_sensor_init (void) |
Initialize Sensor Module. More... | |
void | twr_module_sensor_deinit (void) |
Deinitialize Sensor Module. | |
bool | twr_module_sensor_set_pull (twr_module_sensor_channel_t channel, twr_module_sensor_pull_t pull) |
Set pull of Sensor Module channel. More... | |
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. More... | |
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. More... | |
twr_module_sensor_mode_t | twr_module_sensor_get_mode (twr_module_sensor_channel_t channel) |
Get mode of operation for Sensor Module channel. More... | |
int | twr_module_sensor_get_input (twr_module_sensor_channel_t channel) |
Get input of Sensor Module channel. More... | |
void | twr_module_sensor_set_output (twr_module_sensor_channel_t channel, int state) |
Set output state of Sensor Module channel. More... | |
int | twr_module_sensor_get_output (twr_module_sensor_channel_t channel) |
Get output state for Sensor Module channel. More... | |
void | twr_module_sensor_toggle_output (twr_module_sensor_channel_t channel) |
Toggle output state for Sensor Module channel. More... | |
bool | twr_module_sensor_set_vdd (bool on) |
Set VDD On / Off. More... | |
twr_module_sensor_revision_t | twr_module_sensor_get_revision (void) |
Get Sensor Module revision. | |
twr_onewire_t * | twr_module_sensor_get_onewire (void) |
Initialize and get Instance 1-Wire for channel B. More... | |
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. More... | |
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. More... | |
Driver for Sensor Module.
Sensor Module channels.
Enumerator | |
---|---|
TWR_MODULE_SENSOR_CHANNEL_A | Channel A. |
TWR_MODULE_SENSOR_CHANNEL_B | Channel B. |
TWR_MODULE_SENSOR_CHANNEL_C | Channel C. |
Definition at line 13 of file twr_module_sensor.h.
Sensor Module mode of operation.
Enumerator | |
---|---|
TWR_MODULE_SENSOR_MODE_INPUT | Channel operates as input. |
TWR_MODULE_SENSOR_MODE_OUTPUT | Channel operates as output. |
Definition at line 49 of file twr_module_sensor.h.
Sensor module pull.
Definition at line 28 of file twr_module_sensor.h.
Sensor Module hardware revision.
Enumerator | |
---|---|
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. |
Definition at line 61 of file twr_module_sensor.h.
int twr_module_sensor_get_input | ( | twr_module_sensor_channel_t | channel | ) |
Get input of Sensor Module channel.
[in] | channel | Sensor Module channel |
Definition at line 217 of file twr_module_sensor.c.
twr_module_sensor_mode_t twr_module_sensor_get_mode | ( | twr_module_sensor_channel_t | channel | ) |
Get mode of operation for Sensor Module channel.
[in] | channel | Sensor Module channel |
twr_onewire_t* twr_module_sensor_get_onewire | ( | void | ) |
Initialize and get Instance 1-Wire for channel B.
Definition at line 312 of file twr_module_sensor.c.
Referenced by twr_ds18b20_init_multiple(), twr_ds18b20_init_single(), twr_i2c_init(), and twr_soil_sensor_init_multiple().
int twr_module_sensor_get_output | ( | twr_module_sensor_channel_t | channel | ) |
Get output state for Sensor Module channel.
[in] | channel | Sensor Module channel |
Definition at line 227 of file twr_module_sensor.c.
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.
[in] | channel | Sensor Module channel |
Definition at line 178 of file twr_module_sensor.c.
bool twr_module_sensor_init | ( | void | ) |
Initialize Sensor Module.
Definition at line 36 of file twr_module_sensor.c.
Referenced by twr_ds18b20_init_multiple(), twr_ds18b20_init_single(), twr_i2c_init(), and twr_pulse_counter_init().
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.
Definition at line 363 of file twr_module_sensor.c.
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.
Definition at line 324 of file twr_module_sensor.c.
Referenced by twr_i2c_init().
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.
[in] | channel | Sensor Module channel |
[in] | mode | Desired mode of operation |
Definition at line 212 of file twr_module_sensor.c.
Referenced by twr_pulse_counter_init().
void twr_module_sensor_set_output | ( | twr_module_sensor_channel_t | channel, |
int | state | ||
) |
Set output state of Sensor Module channel.
[in] | channel | Sensor Module channel |
[in] | state | State to be set |
Definition at line 222 of file twr_module_sensor.c.
bool twr_module_sensor_set_pull | ( | twr_module_sensor_channel_t | channel, |
twr_module_sensor_pull_t | pull | ||
) |
Set pull of Sensor Module channel.
[in] | channel | Sensor Module channel |
[in] | pull | Sensor Module pull |
Definition at line 70 of file twr_module_sensor.c.
Referenced by twr_i2c_deinit(), twr_module_sensor_onewire_power_down(), twr_module_sensor_onewire_power_up(), and twr_pulse_counter_init().
bool twr_module_sensor_set_vdd | ( | bool | on | ) |
Set VDD On / Off.
[in] | on | On |
Definition at line 237 of file twr_module_sensor.c.
Referenced by twr_module_sensor_onewire_power_down(), and twr_module_sensor_onewire_power_up().
void twr_module_sensor_toggle_output | ( | twr_module_sensor_channel_t | channel | ) |
Toggle output state for Sensor Module channel.
[in] | channel | Sensor Module channel |
Definition at line 232 of file twr_module_sensor.c.