Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
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
}
 Sensor Module channels. More...
 
enum  bc_module_sensor_pull_t {
  BC_MODULE_SENSOR_PULL_NONE = 0,
  BC_MODULE_SENSOR_PULL_UP_4K7 = 1,
  BC_MODULE_SENSOR_PULL_UP_56R = 2,
  BC_MODULE_SENSOR_PULL_UP_INTERNAL = 3,
  BC_MODULE_SENSOR_PULL_DOWN_INTERNAL = 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.
 
void bc_module_sensor_onewire_init (void)
 Initialize 1-Wire on channel B.
 
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

Sensor Module channels.

Enumerator
BC_MODULE_SENSOR_CHANNEL_A 

Channel A.

BC_MODULE_SENSOR_CHANNEL_B 

Channel B.

Definition at line 12 of file bc_module_sensor.h.

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 45 of file bc_module_sensor.h.

Sensor module pull.

Enumerator
BC_MODULE_SENSOR_PULL_NONE 

Channel has no pull.

BC_MODULE_SENSOR_PULL_UP_4K7 

Channel has pull-up 4k7.

BC_MODULE_SENSOR_PULL_UP_56R 

Channel has pull-up 56R.

BC_MODULE_SENSOR_PULL_UP_INTERNAL 

Channel has internal pull-up.

BC_MODULE_SENSOR_PULL_DOWN_INTERNAL 

Channel has internal pull-down.

Definition at line 24 of file bc_module_sensor.h.

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 57 of file bc_module_sensor.h.

Function Documentation

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 171 of file bc_module_sensor.c.

Here is the call graph for this function:

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
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 181 of file bc_module_sensor.c.

Here is the call graph for this function:

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 132 of file bc_module_sensor.c.

Here is the call graph for this function:

bool bc_module_sensor_init ( void  )

Initialize Sensor Module.

Returns
true On success
false On Error

Definition at line 40 of file bc_module_sensor.c.

Referenced by bc_i2c_init(), and bc_pulse_counter_init().

Here is the call graph for this function:

Here is the caller graph for this function:

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 301 of file bc_module_sensor.c.

Here is the call graph for this function:

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 271 of file bc_module_sensor.c.

Here is the call graph for this function:

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 166 of file bc_module_sensor.c.

Referenced by bc_pulse_counter_init().

Here is the call graph for this function:

Here is the caller graph for this function:

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 176 of file bc_module_sensor.c.

Here is the call graph for this function:

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 73 of file bc_module_sensor.c.

Referenced by bc_i2c_deinit(), bc_i2c_init(), 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:

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 191 of file bc_module_sensor.c.

Referenced by bc_i2c_init(), 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:

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 186 of file bc_module_sensor.c.

Here is the call graph for this function: