Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_onewire_relay

Driver for BigClown 1-wire relay, chipset: DS2408. More...

Data Structures

struct  bc_onewire_relay_t
 BigClown 1-wire relay instance. More...
 

Enumerations

enum  bc_onewire_relay_channel_t {
  BC_ONEWIRE_RELAY_CHANNEL_Q1 = 0,
  BC_ONEWIRE_RELAY_CHANNEL_Q2 = 1,
  BC_ONEWIRE_RELAY_CHANNEL_Q3 = 2,
  BC_ONEWIRE_RELAY_CHANNEL_Q4 = 3,
  BC_ONEWIRE_RELAY_CHANNEL_Q5 = 4,
  BC_ONEWIRE_RELAY_CHANNEL_Q6 = 5,
  BC_ONEWIRE_RELAY_CHANNEL_Q7 = 6,
  BC_ONEWIRE_RELAY_CHANNEL_Q8 = 7
}
 

Functions

bool bc_onewire_relay_init (bc_onewire_relay_t *self, bc_gpio_channel_t channel, uint64_t device_number)
 Initialize relay. More...
 
bool bc_onewire_relay_set_state (bc_onewire_relay_t *self, bc_onewire_relay_channel_t relay_channel, bool state)
 Set relay to specified state. More...
 
bool bc_onewire_relay_get_state (bc_onewire_relay_t *self, bc_onewire_relay_channel_t relay_channel, bool *state)
 Get current relay state. More...
 

Detailed Description

Driver for BigClown 1-wire relay, chipset: DS2408.

Function Documentation

bool bc_onewire_relay_get_state ( bc_onewire_relay_t self,
bc_onewire_relay_channel_t  relay_channel,
bool *  state 
)

Get current relay state.

Parameters
[in]selfInstance
[in]channel
[out]state
Returns
true When state is valid
false When state is invalid

Definition at line 66 of file bc_onewire_relay.c.

bool bc_onewire_relay_init ( bc_onewire_relay_t self,
bc_gpio_channel_t  channel,
uint64_t  device_number 
)

Initialize relay.

Parameters
[in]selfInstance
Returns
true On success
false On failure

Definition at line 6 of file bc_onewire_relay.c.

Here is the call graph for this function:

bool bc_onewire_relay_set_state ( bc_onewire_relay_t self,
bc_onewire_relay_channel_t  relay_channel,
bool  state 
)

Set relay to specified state.

Parameters
[in]selfInstance
[in]channel
[in]stateDesired relay state
Returns
true On success
false On failure

Definition at line 22 of file bc_onewire_relay.c.

Here is the call graph for this function: