Firmware SDK
twr_onewire_relay

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

Data Structures

struct  twr_onewire_relay_t
 HARDWARIO 1-wire relay instance. More...
 

Enumerations

enum  twr_onewire_relay_channel_t {
  TWR_ONEWIRE_RELAY_CHANNEL_Q1 = 0 ,
  TWR_ONEWIRE_RELAY_CHANNEL_Q2 = 1 ,
  TWR_ONEWIRE_RELAY_CHANNEL_Q3 = 2 ,
  TWR_ONEWIRE_RELAY_CHANNEL_Q4 = 3 ,
  TWR_ONEWIRE_RELAY_CHANNEL_Q5 = 4 ,
  TWR_ONEWIRE_RELAY_CHANNEL_Q6 = 5 ,
  TWR_ONEWIRE_RELAY_CHANNEL_Q7 = 6 ,
  TWR_ONEWIRE_RELAY_CHANNEL_Q8 = 7
}
 

Functions

bool twr_onewire_relay_init (twr_onewire_relay_t *self, twr_onewire_t *onewire, uint64_t device_number)
 Initialize relay. More...
 
bool twr_onewire_relay_set_state (twr_onewire_relay_t *self, twr_onewire_relay_channel_t relay_channel, bool state)
 Set relay to specified state. More...
 
bool twr_onewire_relay_get_state (twr_onewire_relay_t *self, twr_onewire_relay_channel_t relay_channel, bool *state)
 Get current relay state. More...
 

Detailed Description

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

Function Documentation

◆ twr_onewire_relay_get_state()

bool twr_onewire_relay_get_state ( twr_onewire_relay_t self,
twr_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 64 of file twr_onewire_relay.c.

◆ twr_onewire_relay_init()

bool twr_onewire_relay_init ( twr_onewire_relay_t self,
twr_onewire_t onewire,
uint64_t  device_number 
)

Initialize relay.

Parameters
[in]selfInstance
[in]Pointeron instance 1-Wire
Returns
true On success
false On failure

Definition at line 6 of file twr_onewire_relay.c.

◆ twr_onewire_relay_set_state()

bool twr_onewire_relay_set_state ( twr_onewire_relay_t self,
twr_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 20 of file twr_onewire_relay.c.

Here is the call graph for this function: