43#ifdef PREINIT_SUPPORTED
47#ifdef MikroCCoreVersion
48 #if MikroCCoreVersion >= 1
53#include "drv_digital_out.h"
54#include "drv_digital_in.h"
55#include "drv_spi_master.h"
70#define MATRIXG_MAP_MIKROBUS( cfg, mikrobus ) \
71 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
72 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
73 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
74 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
75 cfg.csn = MIKROBUS( mikrobus, MIKROBUS_AN );
82#define MATRIXG_RETVAL uint8_t
84#define MATRIXG_OK 0x00
85#define MATRIXG_INIT_ERROR 0xFF
92#define MATRIXG_DECODE_MODE_REG 0x09
93#define MATRIXG_INTENSITY_REG 0x0A
94#define MATRIXG_SCAN_LIMIT_REG 0x0B
95#define MATRIXG_SHUTDOWN_REG 0x0C
96#define MATRIXG_DISPLAY_TEST_REG 0x0F
103#define MATRIXG_NO_DECODE 0x00
104#define MATRIXG_DECODE_DIGIT_0 0x01
105#define MATRIXG_DECODE_DIGIT_3_0 0x0F
106#define MATRIXG_DECODE_DIGIT_7 0xFF
113#define MATRIXG_INTEN_LVL_0 0x00
114#define MATRIXG_INTEN_LVL_1 0x03
115#define MATRIXG_INTEN_LVL_2 0x06
116#define MATRIXG_INTEN_LVL_3 0x09
117#define MATRIXG_INTEN_LVL_4 0x0C
118#define MATRIXG_INTEN_LVL_5 0x0F
125#define MATRIXG_DISPLAY_DIGIT_0 0x00
126#define MATRIXG_DISPLAY_DIGIT_0_1 0x01
127#define MATRIXG_DISPLAY_DIGIT_0_2 0x02
128#define MATRIXG_DISPLAY_DIGIT_0_3 0x03
129#define MATRIXG_DISPLAY_DIGIT_0_4 0x04
130#define MATRIXG_DISPLAY_DIGIT_0_5 0x05
131#define MATRIXG_DISPLAY_DIGIT_0_6 0x06
132#define MATRIXG_DISPLAY_DIGIT_0_7 0x07
139#define MATRIXG_SHUTDOWN_MODE 0x00
140#define MATRIXG_NORMAL_OPERATION 0x01
146#define MATRIXG_DISPLAY_NORMAL_OPERATION 0x00
147#define MATRIXG_DISPLAY_TEST_MODE 0X01
#define MATRIXG_RETVAL
Definition matrixg.h:82
void matrixg_default_cfg(matrixg_t *ctx)
Click Default Configuration function.
void matrixg_write_reg(matrixg_t *ctx, uint8_t address, uint8_t input_data)
Register write function.
void matrixg_display_characters(matrixg_t *ctx, uint8_t left_char, uint8_t right_char)
Display characters function.
MATRIXG_RETVAL matrixg_init(matrixg_t *ctx, matrixg_cfg_t *cfg)
Initialization function.
void matrixg_set_csn_low(matrixg_t *ctx)
Set CSN pin to low function.
void matrixg_cfg_setup(matrixg_cfg_t *cfg)
Config Object Initialization function.
void matrixg_set_csn_high(matrixg_t *ctx)
Set CSN pin to high function.
Click configuration structure definition.
Definition matrixg.h:180
pin_name_t csn
Definition matrixg.h:190
spi_master_chip_select_polarity_t cs_polarity
Definition matrixg.h:196
pin_name_t sck
Definition matrixg.h:185
spi_master_mode_t spi_mode
Definition matrixg.h:195
pin_name_t mosi
Definition matrixg.h:184
uint32_t spi_speed
Definition matrixg.h:194
pin_name_t miso
Definition matrixg.h:183
pin_name_t cs
Definition matrixg.h:186
Click ctx object definition.
Definition matrixg.h:163
digital_out_t cs
Definition matrixg.h:167
spi_master_t spi
Definition matrixg.h:171
digital_out_t csn
Definition matrixg.h:166
pin_name_t chip_select
Definition matrixg.h:172