1 #include <twr_module_x1.h>
2 #include <twr_onewire_ds2484.h>
3 #include <twr_tca9534a.h>
12 bool onewire_initialized;
13 int onewire_power_semaphore;
15 } _twr_module_x1 = { .initialized =
false };
17 static bool _twr_module_x1_set_slpz(
void *ctx,
bool state);
21 if (_twr_module_x1.initialized) {
25 memset(&_twr_module_x1, 0,
sizeof(_twr_module_x1));
43 twr_ds2484_set_slpz_handler(&_twr_module_x1.ds2484, _twr_module_x1_set_slpz, NULL);
45 _twr_module_x1.initialized =
true;
52 return &_twr_module_x1.onewire;
55 static bool _twr_module_x1_set_slpz(
void *ctx,
bool state)
struct twr_ds2484_t twr_ds2484_t
TMP112 instance.
@ TWR_I2C_I2C0
I2C channel I2C0.
void void void void void twr_log_error(const char *format,...) __attribute__((format(printf
Log ERROR message (annotated in log as <E>)
bool twr_module_x1_init(void)
Initialize X1 Module.
twr_onewire_t * twr_module_x1_get_onewire(void)
Initialize and get Instance 1-Wire for channel B.
struct twr_onewire_t twr_onewire_t
1-Wire instance
void twr_onewire_ds2484_init(twr_onewire_t *onewire, twr_ds2484_t *twr_ds2484)
Initialize 1-Wire.
bool twr_tca9534a_write_port(twr_tca9534a_t *self, uint8_t state)
Write state to all pins.
bool twr_tca9534a_init(twr_tca9534a_t *self, twr_i2c_channel_t i2c_channel, uint8_t i2c_address)
Initialize TCA9534A.
bool twr_tca9534a_set_port_direction(twr_tca9534a_t *self, uint8_t direction)
Set direction of all pins.