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_spi_master.h"
67#define EXPAND4_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
69 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
70 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
71 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
72 cfg.clr = MIKROBUS( mikrobus, MIKROBUS_RST ); \
73 cfg.en = MIKROBUS( mikrobus, MIKROBUS_PWM )
80#define EXPAND4_RETVAL uint8_t
82#define EXPAND4_OK 0x00
83#define EXPAND4_INIT_ERROR 0xFF
90#define EXPAND4_D0 0x01
91#define EXPAND4_D1 0x02
92#define EXPAND4_D2 0x04
93#define EXPAND4_D3 0x08
94#define EXPAND4_D4 0x10
95#define EXPAND4_D5 0x20
96#define EXPAND4_D6 0x40
97#define EXPAND4_D7 0x80
#define EXPAND4_RETVAL
Definition expand4.h:80
EXPAND4_RETVAL expand4_init(expand4_t *ctx, expand4_cfg_t *cfg)
Initialization function.
void expand4_turn_on_by_position(expand4_t *ctx, uint8_t position)
void expand4_cfg_setup(expand4_cfg_t *cfg)
Config Object Initialization function.
void expand4_write_data(expand4_t *ctx, uint8_t write_command)
void expand4_enable_output(expand4_t *ctx)
Enable output function.
void expand4_reset(expand4_t *ctx)
Clear register function.
void expand4_disable_output(expand4_t *ctx)
Disable output function.
Click configuration structure definition.
Definition expand4.h:129
pin_name_t clr
Definition expand4.h:139
spi_master_chip_select_polarity_t cs_polarity
Definition expand4.h:146
pin_name_t sck
Definition expand4.h:134
spi_master_mode_t spi_mode
Definition expand4.h:145
pin_name_t mosi
Definition expand4.h:133
uint32_t spi_speed
Definition expand4.h:144
pin_name_t en
Definition expand4.h:140
pin_name_t miso
Definition expand4.h:132
pin_name_t cs
Definition expand4.h:135
Click ctx object definition.
Definition expand4.h:111
digital_out_t cs
Definition expand4.h:114
spi_master_t spi
Definition expand4.h:120
digital_out_t en
Definition expand4.h:116
digital_out_t clr
Definition expand4.h:115
pin_name_t chip_select
Definition expand4.h:121