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"
75#define UTL7SEGB_BASE_NUM_SYS_BINARY 2
76#define UTL7SEGB_BASE_NUM_SYS_TERNARY 3
77#define UTL7SEGB_BASE_NUM_SYS_QUATERNARY 4
78#define UTL7SEGB_BASE_NUM_SYS_QUINARY 5
79#define UTL7SEGB_BASE_NUM_SYS_SENARY 6
80#define UTL7SEGB_BASE_NUM_SYS_SEPTENARY 7
81#define UTL7SEGB_BASE_NUM_SYS_OCTAL 8
82#define UTL7SEGB_BASE_NUM_SYS_NONARY 9
83#define UTL7SEGB_BASE_NUM_SYS_DECIMAL 10
84#define UTL7SEGB_BASE_NUM_SYS_UNDECIMAL 11
85#define UTL7SEGB_BASE_NUM_SYS_DUODECIMAL 12
86#define UTL7SEGB_BASE_NUM_SYS_HEXADECIMAL 16
104#define UTL7SEGB_NO_DOT 0
105#define UTL7SEGB_DOT_RIGHT 1
106#define UTL7SEGB_DOT_LEFT 2
107#define UTL7SEGB_DOT_LEFT_RIGHT 3
117#define UTL7SEGB_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
118#define UTL7SEGB_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
136#define UTL7SEGB_MAP_MIKROBUS( cfg, mikrobus ) \
137 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
138 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
139 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
140 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
141 cfg.oe = MIKROBUS( mikrobus, MIKROBUS_PWM )
err_t utl7segb_generic_write(utl7segb_t *ctx, uint8_t *data_in, uint8_t len)
UT-L 7-SEG B data writing function.
void utl7segb_disable(utl7segb_t *ctx)
UT-L 7-SEG B disable function.
err_t utl7segb_default_cfg(utl7segb_t *ctx)
UT-L 7-SEG B default configuration function.
err_t utl7segb_init(utl7segb_t *ctx, utl7segb_cfg_t *cfg)
UT-L 7-SEG B initialization function.
err_t utl7segb_get_number(utl7segb_t *ctx, uint8_t base, uint8_t *num, uint8_t *dot_pos)
UT-L 7-SEG B get number function.
void utl7segb_enable(utl7segb_t *ctx)
UT-L 7-SEG B enable function.
err_t utl7segb_generic_read(utl7segb_t *ctx, uint8_t *data_out, uint8_t len)
UT-L 7-SEG B data reading function.
void utl7segb_cfg_setup(utl7segb_cfg_t *cfg)
UT-L 7-SEG B configuration object setup function.
err_t utl7segb_display_number(utl7segb_t *ctx, uint8_t base, uint8_t num, uint8_t dot_pos)
UT-L 7-SEG B display number function.
This file contains SPI specific macros, functions, etc.
UT-L 7-SEG B Click configuration object.
Definition utl7segb.h:167
spi_master_chip_select_polarity_t cs_polarity
Definition utl7segb.h:180
pin_name_t sck
Definition utl7segb.h:171
pin_name_t oe
Definition utl7segb.h:175
spi_master_mode_t spi_mode
Definition utl7segb.h:179
pin_name_t mosi
Definition utl7segb.h:170
uint32_t spi_speed
Definition utl7segb.h:178
pin_name_t miso
Definition utl7segb.h:169
pin_name_t cs
Definition utl7segb.h:172
UT-L 7-SEG B Click context object.
Definition utl7segb.h:151
spi_master_t spi
Definition utl7segb.h:156
digital_out_t oe
Definition utl7segb.h:153
pin_name_t chip_select
Definition utl7segb.h:158
utl7segb_return_value_t
UT-L 7-SEG B Click return value data.
Definition utl7segb.h:189
@ UTL7SEGB_ERROR
Definition utl7segb.h:191
@ UTL7SEGB_OK
Definition utl7segb.h:190