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"
74#define ALPHANUMG2_NIBBLE_LOW 0x000Fu
75#define ALPHANUMG2_BYTE_LOW 0x00FFu
76#define ALPHANUMG2_WORD_BIT_POS_0 0x0001u
77#define ALPHANUMG2_WORD_BIT_POS_14 0x4000u
78#define ALPHANUMG2_WORD_BIT_POS_15 0x8000u
84#define ALPHANUMG2_BRIGHTNESS_MIN 0x0000u
85#define ALPHANUMG2_BRIGHTNESS_MAX 0x0FFFu
91#define ALPHANUMG2_DEFAULT_DUR_1000_MS 1000
101#define ALPHANUMG2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
102#define ALPHANUMG2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
120#define ALPHANUMG2_MAP_MIKROBUS( cfg, mikrobus ) \
121 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
122 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
123 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
124 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
125 cfg.blk = MIKROBUS( mikrobus, MIKROBUS_AN ); \
126 cfg.ca1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
127 cfg.ca2 = MIKROBUS( mikrobus, MIKROBUS_INT )
400 uint8_t right_char, uint16_t right_brightness );
alphanumg2_dot_t
AlphaNum G 2 Click dot symbol value data.
Definition alphanumg2.h:192
@ ALPHANUMG2_NO_DOT
Definition alphanumg2.h:193
@ ALPHANUMG2_SET_DOT
Definition alphanumg2.h:194
alphanumg2_return_value_t
AlphaNum G 2 Click return value data.
Definition alphanumg2.h:181
@ ALPHANUMG2_ERROR
Definition alphanumg2.h:183
@ ALPHANUMG2_OK
Definition alphanumg2.h:182
void alphanumg2_set_seg_left_off(alphanumg2_t *ctx)
AlphaNum G 2 set segment left OFF function.
err_t alphanumg2_default_cfg(alphanumg2_t *ctx)
AlphaNum G 2 default configuration function.
err_t alphanumg2_generic_read(alphanumg2_t *ctx, uint8_t *data_out, uint8_t len)
AlphaNum G 2 data reading function.
err_t alphanumg2_init(alphanumg2_t *ctx, alphanumg2_cfg_t *cfg)
AlphaNum G 2 initialization function.
void alphanumg2_cfg_setup(alphanumg2_cfg_t *cfg)
AlphaNum G 2 configuration object setup function.
void alphanumg2_set_seg_right_off(alphanumg2_t *ctx)
AlphaNum G 2 set segment right OFF function.
void alphanumg2_set_outputs_on(alphanumg2_t *ctx)
AlphaNum G 2 set outputs ON function.
void alphanumg2_set_outputs_off(alphanumg2_t *ctx)
AlphaNum G 2 set outputs OFF function.
void alphanumg2_set_seg_right_on(alphanumg2_t *ctx)
AlphaNum G 2 set segment right ON function.
err_t alphanumg2_set_led_output(alphanumg2_t *ctx, uint16_t seg_bit_mask, alphanumg2_dot_t seg_dot, uint16_t brightness)
AlphaNum G 2 set LED output function.
void alphanumg2_set_char_duration(alphanumg2_t *ctx, uint16_t duration_ms)
AlphaNum G 2 set character duration function.
void alphanumg2_set_seg_left_on(alphanumg2_t *ctx)
AlphaNum G 2 set segment left ON function.
err_t alphanumg2_generic_write(alphanumg2_t *ctx, uint8_t *data_in, uint8_t len)
AlphaNum G 2 data writing function.
err_t alphanumg2_display_character(alphanumg2_t *ctx, uint8_t left_char, uint16_t left_brightness, uint8_t right_char, uint16_t right_brightness)
AlphaNum G 2 display character function.
This file contains SPI specific macros, functions, etc.
AlphaNum G 2 Click configuration object.
Definition alphanumg2.h:157
spi_master_chip_select_polarity_t cs_polarity
Definition alphanumg2.h:172
pin_name_t sck
Definition alphanumg2.h:161
pin_name_t ca2
Definition alphanumg2.h:167
pin_name_t ca1
Definition alphanumg2.h:166
spi_master_mode_t spi_mode
Definition alphanumg2.h:171
pin_name_t blk
Definition alphanumg2.h:165
pin_name_t mosi
Definition alphanumg2.h:160
uint32_t spi_speed
Definition alphanumg2.h:170
pin_name_t miso
Definition alphanumg2.h:159
pin_name_t cs
Definition alphanumg2.h:162
AlphaNum G 2 Click context object.
Definition alphanumg2.h:137
spi_master_t spi
Definition alphanumg2.h:144
uint16_t char_duration
Definition alphanumg2.h:148
digital_out_t blk
Definition alphanumg2.h:139
digital_out_t ca2
Definition alphanumg2.h:141
pin_name_t chip_select
Definition alphanumg2.h:146
digital_out_t ca1
Definition alphanumg2.h:140