39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_i2c_master.h"
73#define SOLIDSWITCH_ENABLE_OUT7 0x80
74#define SOLIDSWITCH_ENABLE_OUT6 0x40
75#define SOLIDSWITCH_ENABLE_OUT1 0x02
76#define SOLIDSWITCH_ENABLE_OUT0 0x01
77#define SOLIDSWITCH_ENABLE_ALL_OUTPUTS 0xC3
78#define SOLIDSWITCH_DISABLE_ALL_OUTPUTS 0x00
85#define SOLIDSWITCH_DEV_ADDR_A1_GND_A0_GND 0x68
86#define SOLIDSWITCH_DEV_ADDR_A1_GND_A0_VCC 0x69
87#define SOLIDSWITCH_DEV_ADDR_A1_VCC_A0_GND 0x6C
88#define SOLIDSWITCH_DEV_ADDR_A1_VCC_A0_VCC 0x6D
106#define SOLIDSWITCH_MAP_MIKROBUS( cfg, mikrobus ) \
107 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
108 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
109 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
110 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
uint8_t solidswitch_get_int_state(solidswitch_t *ctx)
SolidSwitch get int pin state function.
err_t solidswitch_read_two_bytes(solidswitch_t *ctx, uint8_t *logic_state, uint8_t *transition_flags)
SolidSwitch I2C reading logic state and transition flags function.
void solidswitch_reset(solidswitch_t *ctx)
SolidSwitch reset function.
err_t solidswitch_write_single(solidswitch_t *ctx, uint8_t logic_state)
SolidSwitch I2C writing logic state function.
err_t solidswitch_init(solidswitch_t *ctx, solidswitch_cfg_t *cfg)
SolidSwitch initialization function.
err_t solidswitch_read_single(solidswitch_t *ctx, uint8_t *logic_state)
SolidSwitch I2C reading logic state function.
err_t solidswitch_default_cfg(solidswitch_t *ctx)
SolidSwitch default configuration function.
err_t solidswitch_write_two_bytes(solidswitch_t *ctx, uint8_t logic_state, uint8_t int_mask)
SolidSwitch I2C writing logic state and interrupt mask function.
void solidswitch_cfg_setup(solidswitch_cfg_t *cfg)
SolidSwitch configuration object setup function.
solidswitch_return_value_t
SolidSwitch Click return value data.
Definition solidswitch.h:161
@ SOLIDSWITCH_ERROR
Definition solidswitch.h:163
@ SOLIDSWITCH_OK
Definition solidswitch.h:162
SolidSwitch Click configuration object.
Definition solidswitch.h:144
uint32_t i2c_speed
Definition solidswitch.h:151
pin_name_t scl
Definition solidswitch.h:145
pin_name_t int_pin
Definition solidswitch.h:149
pin_name_t sda
Definition solidswitch.h:146
pin_name_t rst
Definition solidswitch.h:148
uint8_t i2c_address
Definition solidswitch.h:152
SolidSwitch Click context object.
Definition solidswitch.h:120
digital_in_t int_pin
Definition solidswitch.h:127
i2c_master_t i2c
Definition solidswitch.h:131
digital_out_t rst
Definition solidswitch.h:123
uint8_t slave_address
Definition solidswitch.h:135