Firmware SDK
bc_module_sensor

Driver for Sensor Module. More...

Enumerations

enum  bc_module_sensor_channel_t {
  BC_MODULE_SENSOR_CHANNEL_A = 0,
  BC_MODULE_SENSOR_CHANNEL_B = 1,
  BC_MODULE_SENSOR_CHANNEL_C = 2
}
 Sensor Module channels. More...
 
enum  bc_module_sensor_pull_t {
  BC_MODULE_SENSOR_PULL_NONE = BC_GPIO_PULL_NONE,
  BC_MODULE_SENSOR_PULL_UP_INTERNAL = BC_GPIO_PULL_UP,
  BC_MODULE_SENSOR_PULL_DOWN_INTERNAL = BC_GPIO_PULL_DOWN,
  BC_MODULE_SENSOR_PULL_UP_4K7 = 3,
  BC_MODULE_SENSOR_PULL_UP_56R = 4
}
 Sensor module pull. More...
 
enum  bc_module_sensor_mode_t {
  BC_MODULE_SENSOR_MODE_INPUT = BC_GPIO_MODE_INPUT,
  BC_MODULE_SENSOR_MODE_OUTPUT = BC_GPIO_MODE_OUTPUT
}
 Sensor Module mode of operation. More...
 
enum  bc_module_sensor_revision_t {
  BC_MODULE_SENSOR_REVISION_UNKNOWN = 0,
  BC_MODULE_SENSOR_REVISION_R1_0 = 1,
  BC_MODULE_SENSOR_REVISION_R1_1 = 2
}
 Sensor Module hardware revision. More...
 

Functions

bool bc_module_sensor_init (void)
 Initialize Sensor Module. More...
 
void bc_module_sensor_deinit (void)
 Deinitialize Sensor Module.
 
bool bc_module_sensor_set_pull (bc_module_sensor_channel_t channel, bc_module_sensor_pull_t pull)
 Set pull of Sensor Module channel. More...
 
bc_module_sensor_pull_t bc_module_sensor_get_pull (bc_module_sensor_channel_t channel)
 Get pull-up/pull-down configuration for Sensor Module channel. More...
 
void bc_module_sensor_set_mode (bc_module_sensor_channel_t channel, bc_module_sensor_mode_t mode)
 Set output mode of Sensor Module channel. More...
 
bc_module_sensor_mode_t bc_module_sensor_get_mode (bc_module_sensor_channel_t channel)
 Get mode of operation for Sensor Module channel. More...
 
int bc_module_sensor_get_input (bc_module_sensor_channel_t channel)
 Get input of Sensor Module channel. More...
 
void bc_module_sensor_set_output (bc_module_sensor_channel_t channel, int state)
 Set output state of Sensor Module channel. More...
 
int bc_module_sensor_get_output (bc_module_sensor_channel_t channel)
 Get output state for Sensor Module channel. More...
 
void bc_module_sensor_toggle_output (bc_module_sensor_channel_t channel)
 Toggle output state for Sensor Module channel. More...
 
bool bc_module_sensor_set_vdd (bool on)
 Set VDD On / Off. More...
 
bc_module_sensor_revision_t bc_module_sensor_get_revision (void)
 Get Sensor Module revision.
 
bc_onewire_tbc_module_sensor_get_onewire (void)
 Initialize and get Instance 1-Wire for channel B. More...
 
bool bc_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 bc_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...
 

Detailed Description

Driver for Sensor Module.

Enumeration Type Documentation

◆ bc_module_sensor_channel_t

Sensor Module channels.

Enumerator
BC_MODULE_SENSOR_CHANNEL_A 

Channel A.

BC_MODULE_SENSOR_CHANNEL_B 

Channel B.

BC_MODULE_SENSOR_CHANNEL_C 

Channel C.

Definition at line 13 of file bc_module_sensor.h.

◆ bc_module_sensor_mode_t

Sensor Module mode of operation.

Enumerator
BC_MODULE_SENSOR_MODE_INPUT 

Channel operates as input.

BC_MODULE_SENSOR_MODE_OUTPUT 

Channel operates as output.

Definition at line 49 of file bc_module_sensor.h.

◆ bc_module_sensor_pull_t

Sensor module pull.

Enumerator
BC_MODULE_SENSOR_PULL_NONE 

Channel has no pull.

BC_MODULE_SENSOR_PULL_UP_INTERNAL 

Channel has internal pull-up.

BC_MODULE_SENSOR_PULL_DOWN_INTERNAL 

Channel has internal pull-down.

BC_MODULE_SENSOR_PULL_UP_4K7 

Channel has pull-up 4k7.

BC_MODULE_SENSOR_PULL_UP_56R 

Channel has pull-up 56R.

Definition at line 28 of file bc_module_sensor.h.

◆ bc_module_sensor_revision_t

Sensor Module hardware revision.

Enumerator
BC_MODULE_SENSOR_REVISION_UNKNOWN 

Hardware revision unknown.

BC_MODULE_SENSOR_REVISION_R1_0 

Hardware revision R1.0.

BC_MODULE_SENSOR_REVISION_R1_1 

Hardware revision R1.1.

Definition at line 61 of file bc_module_sensor.h.

Function Documentation

◆ bc_module_sensor_get_input()

int bc_module_sensor_get_input ( bc_module_sensor_channel_t  channel)

Get input of Sensor Module channel.

Parameters
[in]channelSensor Module channel
Returns
Input state

Definition at line 215 of file bc_module_sensor.c.

Here is the call graph for this function:

◆ bc_module_sensor_get_mode()

bc_module_sensor_mode_t bc_module_sensor_get_mode ( bc_module_sensor_channel_t  channel)

Get mode of operation for Sensor Module channel.

Parameters
[in]channelSensor Module channel
Returns
Mode of operation

◆ bc_module_sensor_get_onewire()

bc_onewire_t* bc_module_sensor_get_onewire ( void  )

Initialize and get Instance 1-Wire for channel B.

Returns
pointer on Instance 1-Wire

Definition at line 310 of file bc_module_sensor.c.

Referenced by bc_ds18b20_init_multiple(), bc_ds18b20_init_single(), bc_i2c_init(), and bc_soil_sensor_init_multiple().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_module_sensor_get_output()

int bc_module_sensor_get_output ( bc_module_sensor_channel_t  channel)

Get output state for Sensor Module channel.

Parameters
[in]channelSensor Module channel
Returns
Output state

Definition at line 225 of file bc_module_sensor.c.

Here is the call graph for this function:

◆ bc_module_sensor_get_pull()

bc_module_sensor_pull_t bc_module_sensor_get_pull ( bc_module_sensor_channel_t  channel)

Get pull-up/pull-down configuration for Sensor Module channel.

Parameters
[in]channelSensor Module channel
Returns
Pull-up/pull-down configuration

Definition at line 176 of file bc_module_sensor.c.

Here is the call graph for this function:

◆ bc_module_sensor_init()

bool bc_module_sensor_init ( void  )

Initialize Sensor Module.

Returns
true On success
false On Error

Definition at line 34 of file bc_module_sensor.c.

Referenced by bc_ds18b20_get_temperature_celsius(), bc_i2c_init(), bc_pulse_counter_init(), and bc_soil_sensor_get_error().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_module_sensor_onewire_power_down()

bool bc_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.

Returns
true On success
false On error

Definition at line 352 of file bc_module_sensor.c.

Referenced by bc_soil_sensor_get_error().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_module_sensor_onewire_power_up()

bool bc_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.

Returns
true On success
false On error

Definition at line 322 of file bc_module_sensor.c.

Referenced by bc_ds18b20_init_multiple(), bc_ds18b20_init_single(), bc_i2c_init(), and bc_soil_sensor_get_error().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_module_sensor_set_mode()

void bc_module_sensor_set_mode ( bc_module_sensor_channel_t  channel,
bc_module_sensor_mode_t  mode 
)

Set output mode of Sensor Module channel.

Parameters
[in]channelSensor Module channel
[in]modeDesired mode of operation

Definition at line 210 of file bc_module_sensor.c.

Referenced by bc_ds18b20_get_temperature_celsius(), and bc_pulse_counter_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_module_sensor_set_output()

void bc_module_sensor_set_output ( bc_module_sensor_channel_t  channel,
int  state 
)

Set output state of Sensor Module channel.

Parameters
[in]channelSensor Module channel
[in]stateState to be set

Definition at line 220 of file bc_module_sensor.c.

Here is the call graph for this function:

◆ bc_module_sensor_set_pull()

bool bc_module_sensor_set_pull ( bc_module_sensor_channel_t  channel,
bc_module_sensor_pull_t  pull 
)

Set pull of Sensor Module channel.

Parameters
[in]channelSensor Module channel
[in]pullSensor Module pull
Returns
true On success
false On error

Definition at line 68 of file bc_module_sensor.c.

Referenced by bc_ds18b20_get_temperature_celsius(), bc_i2c_deinit(), bc_module_sensor_onewire_power_down(), bc_module_sensor_onewire_power_up(), and bc_pulse_counter_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_module_sensor_set_vdd()

bool bc_module_sensor_set_vdd ( bool  on)

Set VDD On / Off.

Parameters
[in]onOn
Returns
true On success
false On error

Definition at line 235 of file bc_module_sensor.c.

Referenced by bc_ds18b20_get_temperature_celsius(), bc_module_sensor_onewire_power_down(), and bc_module_sensor_onewire_power_up().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bc_module_sensor_toggle_output()

void bc_module_sensor_toggle_output ( bc_module_sensor_channel_t  channel)

Toggle output state for Sensor Module channel.

Parameters
[in]channelSensor Module channel

Definition at line 230 of file bc_module_sensor.c.

Here is the call graph for this function: