42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
54#include "drv_i2c_master.h"
66#define DUALEE_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
68 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA )
75#define DUALEE_RETVAL uint8_t
78#define DUALEE_INIT_ERROR 0xFF
85#define DUALEE_SLAVEADDRESS_1 0x50
86#define DUALEE_SLAVEADDRESS_2 0x54
93#define DUALEE_ADDRESS_START 0x00000000
94#define DUALEE_ADDRESS_END 0x0007FFFE
101#define DUALEE_PAGE_START_OF_FIRST 0x00000000
102#define DUALEE_PAGE_END_OF_FIRST 0x0003FFFF
103#define DUALEE_PAGE_START_OF_SECOND 0x00040000
104#define DUALEE_PAGE_END_OF_SECOND 0x0007FFFE
111#define DUALEE_MAXIMUM_DATA 251
118#define DUALEE_ERROR_RW 0
119#define DUALEE_SUCCESSFUL_RW 1
#define DUALEE_RETVAL
Definition dualee.h:75
void dualee_cfg_setup(dualee_cfg_t *cfg)
Config Object Initialization function.
DUALEE_RETVAL dualee_init(dualee_t *ctx, dualee_cfg_t *cfg)
Initialization function.
uint8_t dualee_write(dualee_t *ctx, uint32_t reg_address, uint8_t *data_buff, uint8_t n_bytes)
Generic write data function.
uint8_t dualee_read(dualee_t *ctx, uint32_t reg_address, uint8_t *data_buff, uint8_t n_bytes)
Generic write data function.
void dualee_generic_write(dualee_t *ctx, uint8_t *reg, uint8_t *data_buf, uint8_t len)
Generic write function.
void dualee_generic_read(dualee_t *ctx, uint8_t *reg, uint8_t *data_buf, uint8_t len)
Generic read function.
Click configuration structure definition.
Definition dualee.h:150
uint8_t i2c_address_2
Definition dualee.h:161
uint8_t i2c_address_1
Definition dualee.h:160
uint32_t i2c_speed
Definition dualee.h:158
pin_name_t scl
Definition dualee.h:153
pin_name_t sda
Definition dualee.h:154
uint8_t i2c_address
Definition dualee.h:159
Click ctx object definition.
Definition dualee.h:133
uint8_t slave_address_2
Definition dualee.h:142
uint8_t slave_address_1
Definition dualee.h:141
i2c_master_t i2c
Definition dualee.h:136
uint8_t slave_address
Definition dualee.h:140