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 EXPAND13_NO_PIN_MASK 0x00
74#define EXPAND13_PIN_0_MASK 0x01
75#define EXPAND13_PIN_1_MASK 0x02
76#define EXPAND13_PIN_2_MASK 0x04
77#define EXPAND13_PIN_3_MASK 0x08
78#define EXPAND13_PIN_4_MASK 0x10
79#define EXPAND13_PIN_5_MASK 0x20
80#define EXPAND13_PIN_6_MASK 0x40
81#define EXPAND13_PIN_7_MASK 0x80
82#define EXPAND13_ALL_PINS_MASK 0xFF
88#define EXPAND13_PORT_0 0x00
89#define EXPAND13_PORT_1 0x01
90#define EXPAND13_PORT_2 0x02
91#define EXPAND13_PORT_3 0x03
92#define EXPAND13_PORT_4 0x04
93#define EXPAND13_PORT_5 0x05
100#define EXPAND13_SET_DEV_ADDR_A2A1A0_000 0x20
101#define EXPAND13_SET_DEV_ADDR_A2A1A0_001 0x21
102#define EXPAND13_SET_DEV_ADDR_A2A1A0_010 0x22
103#define EXPAND13_SET_DEV_ADDR_A2A1A0_011 0x23
104#define EXPAND13_SET_DEV_ADDR_A2A1A0_100 0x24
105#define EXPAND13_SET_DEV_ADDR_A2A1A0_101 0x25
106#define EXPAND13_SET_DEV_ADDR_A2A1A0_110 0x26
107#define EXPAND13_SET_DEV_ADDR_A2A1A0_111 0x27
125#define EXPAND13_MAP_MIKROBUS( cfg, mikrobus ) \
126 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
127 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
128 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
129 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT )
expand13_return_value_t
Expand 13 Click return value data.
Definition expand13.h:176
@ EXPAND13_ERROR
Definition expand13.h:178
@ EXPAND13_OK
Definition expand13.h:177
uint8_t expand13_get_int_pin(expand13_t *ctx)
Expand 13 get int pin function.
err_t expand13_write_all_ports(expand13_t *ctx, uint8_t *ports)
Expand 13 write all ports function.
err_t expand13_read_all_ports(expand13_t *ctx, uint8_t *ports)
Expand 13 read all ports function.
void expand13_enable_device(expand13_t *ctx)
Expand 13 enable device function.
void expand13_cfg_setup(expand13_cfg_t *cfg)
Expand 13 configuration object setup function.
err_t expand13_set_port_value(expand13_t *ctx, uint8_t port, uint8_t clr_mask, uint8_t set_mask)
Expand 13 set port value function.
err_t expand13_read_port_value(expand13_t *ctx, uint8_t port, uint8_t *data_out)
Expand 13 read port value function.
err_t expand13_init(expand13_t *ctx, expand13_cfg_t *cfg)
Expand 13 initialization function.
void expand13_disable_device(expand13_t *ctx)
Expand 13 disable device function.
Expand 13 Click configuration object.
Definition expand13.h:159
uint32_t i2c_speed
Definition expand13.h:166
pin_name_t scl
Definition expand13.h:160
pin_name_t int_pin
Definition expand13.h:164
pin_name_t sda
Definition expand13.h:161
pin_name_t rst
Definition expand13.h:163
uint8_t i2c_address
Definition expand13.h:167
Expand 13 Click context object.
Definition expand13.h:139
digital_in_t int_pin
Definition expand13.h:144
i2c_master_t i2c
Definition expand13.h:147
digital_out_t rst
Definition expand13.h:141
uint8_t slave_address
Definition expand13.h:150