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"
68#define BARGRAPH_MAP_MIKROBUS( cfg, mikrobus ) \
69 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
70 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
71 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
72 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.mr = MIKROBUS( mikrobus, MIKROBUS_RST ); \
74 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM )
83#define BARGRAPH_RETVAL uint8_t
85#define BARGRAPH_OK 0x00
86#define BARGRAPH_INIT_ERROR 0xFF
#define BARGRAPH_RETVAL
Definition bargraph.h:83
void bargraph_enable(bargraph_t *ctx, uint8_t input)
Functions for enable the chip.
void bargraph_display(bargraph_t *ctx, uint8_t input)
Displays function.
void bargraph_cfg_setup(bargraph_cfg_t *cfg)
Config Object Initialization function.
BARGRAPH_RETVAL bargraph_init(bargraph_t *ctx, bargraph_cfg_t *cfg)
Initialization function.
void bargraph_generic_transfer(bargraph_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
Generic transfer function.
void bargraph_reset(bargraph_t *ctx)
Functions for reset the chip.
void bargraph_driver_init(bargraph_t *ctx)
Functions for initializes the chip.
Click configuration structure definition.
Definition bargraph.h:119
spi_master_chip_select_polarity_t cs_polarity
Definition bargraph.h:136
pin_name_t mr
Definition bargraph.h:129
pin_name_t sck
Definition bargraph.h:124
spi_master_mode_t spi_mode
Definition bargraph.h:135
pin_name_t mosi
Definition bargraph.h:123
uint32_t spi_speed
Definition bargraph.h:134
pin_name_t pwm
Definition bargraph.h:130
pin_name_t miso
Definition bargraph.h:122
pin_name_t cs
Definition bargraph.h:125
Click ctx object definition.
Definition bargraph.h:100
digital_out_t cs
Definition bargraph.h:101
spi_master_t spi
Definition bargraph.h:110
digital_out_t pwm
Definition bargraph.h:106
digital_out_t mr
Definition bargraph.h:105
pin_name_t chip_select
Definition bargraph.h:111