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 BARGRAPH3_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.oe = MIKROBUS( mikrobus, MIKROBUS_AN ); \
73 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
74 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
81#define BARGRAPH3_RETVAL uint8_t
83#define BARGRAPH3_OK 0x00
84#define BARGRAPH3_INIT_ERROR 0xFF
91#define BARGRAPH3_LED_0 0
92#define BARGRAPH3_LED_1 1
93#define BARGRAPH3_LED_2 2
94#define BARGRAPH3_LED_3 3
95#define BARGRAPH3_LED_4 4
96#define BARGRAPH3_LED_5 5
103#define BARGRAPH3_INCREASE_LED 1
104#define BARGRAPH3_CONTROL_ONE_LED 0
111#define BARGRAPH3_DIRECTION_TOP_TO_BOTTOM 1
112#define BARGRAPH3_DIRECTION_BOTTOM_TO_TOP 0
119#define BARGRAPH3_DEVICE_ENABLE 0
120#define BARGRAPH3_DEVICE_DISABLE 1
#define BARGRAPH3_RETVAL
Definition bargraph3.h:81
void bargraph3_set_pwm(bargraph3_t *ctx, uint8_t state)
Functions for set PWM.
void bargraph3_default_cfg(bargraph3_t *ctx)
Click Default Configuration function.
void bargraph3_cfg_setup(bargraph3_cfg_t *cfg)
Config Object Initialization function.
void bargraph3_display(bargraph3_t *ctx, uint8_t ctrl, uint8_t dir, uint8_t counter)
Displays function.
void bargraph3_reset(bargraph3_t *ctx)
Functions for reset the chip.
BARGRAPH3_RETVAL bargraph3_init(bargraph3_t *ctx, bargraph3_cfg_t *cfg)
Initialization function.
void bargraph3_generic_transfer(bargraph3_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void bargraph3_enable(bargraph3_t *ctx, uint8_t state)
Functions for enable the chip.
Click configuration structure definition.
Definition bargraph3.h:154
spi_master_chip_select_polarity_t cs_polarity
Definition bargraph3.h:172
pin_name_t sck
Definition bargraph3.h:159
pin_name_t oe
Definition bargraph3.h:164
spi_master_mode_t spi_mode
Definition bargraph3.h:171
pin_name_t mosi
Definition bargraph3.h:158
uint32_t spi_speed
Definition bargraph3.h:170
pin_name_t pwm
Definition bargraph3.h:166
pin_name_t miso
Definition bargraph3.h:157
pin_name_t rst
Definition bargraph3.h:165
pin_name_t cs
Definition bargraph3.h:160
Click ctx object definition.
Definition bargraph3.h:134
digital_out_t cs
Definition bargraph3.h:135
spi_master_t spi
Definition bargraph3.h:145
digital_out_t pwm
Definition bargraph3.h:141
digital_out_t oe
Definition bargraph3.h:139
digital_out_t rst
Definition bargraph3.h:140
pin_name_t chip_select
Definition bargraph3.h:146