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_spi_master.h"
74#define EXPAND8_ADDR_OUT_LVL_PORT_P0 0x00
75#define EXPAND8_ADDR_OUT_LVL_PORT_P1 0x01
76#define EXPAND8_ADDR_OUT_LVL_PORT_P2 0x02
77#define EXPAND8_ADDR_OUT_LVL_PORT_P3 0x03
78#define EXPAND8_ADDR_OUT_LVL_PORT_P4 0x04
79#define EXPAND8_ADDR_OUT_LVL_PORT_P5 0x05
80#define EXPAND8_ADDR_OUT_LVL_PORT_P6 0x06
81#define EXPAND8_ADDR_OUT_LVL_PORT_P7 0x07
82#define EXPAND8_ADDR_OUT_LVL_PORT_P8 0x08
83#define EXPAND8_ADDR_OUT_LVL_PORT_P9 0x09
84#define EXPAND8_ADDR_OUT_LVL_PORT_P0_THROUGH_P9 0x0A
85#define EXPAND8_ADDR_OUT_LVL_PORT_P0_THROUGH_P3 0x0B
86#define EXPAND8_ADDR_OUT_LVL_PORT_P4_THROUGH_P7 0x0C
87#define EXPAND8_ADDR_OUT_LVL_PORT_P8_THROUGH_P9 0x0D
88#define EXPAND8_ADDR_OUT_LVL_PORT_P7_THROUGH_P0 0x0E
89#define EXPAND8_ADDR_OUT_LVL_PORT_P9_THROUGH_P8 0x0F
90#define EXPAND8_ADDR_RAM 0x13
91#define EXPAND8_ADDR_NOP 0x20
97#define EXPAND8_SET_LOW_IMPEDANCE 0x00
98#define EXPAND8_SET_HIGH_IMPEDANCE 0xFF
104#define EXPAND8_CMD_WRITE 0x00
105#define EXPAND8_CMD_READ 0x80
115#define EXPAND8_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
116#define EXPAND8_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
134#define EXPAND8_MAP_MIKROBUS( cfg, mikrobus ) \
135 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
136 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
137 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
138 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS )
expand8_return_value_t
Expand 8 Click return value data.
Definition expand8.h:180
@ EXPAND8_ERROR
Definition expand8.h:182
@ EXPAND8_OK
Definition expand8.h:181
void expand8_write_data(expand8_t *ctx, uint8_t addr, uint8_t tx_data)
Generic write data function.
err_t expand8_generic_read(expand8_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
Expand 8 data reading function.
uint8_t expand8_read_data(expand8_t *ctx, uint8_t addr)
Generic read data function.
void expand8_cfg_setup(expand8_cfg_t *cfg)
Expand 8 configuration object setup function.
err_t expand8_set_port(expand8_t *ctx, uint8_t sel_port, uint8_t sel_imped)
Set port function.
err_t expand8_generic_write(expand8_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
Expand 8 data writing function.
err_t expand8_init(expand8_t *ctx, expand8_cfg_t *cfg)
Expand 8 initialization function.
This file contains SPI specific macros, functions, etc.
Expand 8 Click configuration object.
Definition expand8.h:161
spi_master_chip_select_polarity_t cs_polarity
Definition expand8.h:171
pin_name_t sck
Definition expand8.h:165
spi_master_mode_t spi_mode
Definition expand8.h:170
pin_name_t mosi
Definition expand8.h:164
uint32_t spi_speed
Definition expand8.h:169
pin_name_t miso
Definition expand8.h:163
pin_name_t cs
Definition expand8.h:166
Expand 8 Click context object.
Definition expand8.h:148
spi_master_t spi
Definition expand8.h:150
pin_name_t chip_select
Definition expand8.h:152