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"
68#define ROTARYY_ONE_LED 0x0001
69#define ROTARYY_TWO_LED 0x0101
70#define ROTARYY_FOUR_LED 0x1111
71#define ROTARYY_EIGHT_LED 0x5555
72#define ROTARYY_RESET_LED 0x0000
90#define ROTARYY_MAP_MIKROBUS( cfg, mikrobus ) \
91 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
92 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
93 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
94 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
95 cfg.ecb = MIKROBUS( mikrobus, MIKROBUS_AN ); \
96 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
97 cfg.eca = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
98 cfg.sw = MIKROBUS( mikrobus, MIKROBUS_INT )
uint16_t rotaryy_get_led_data(uint8_t current_led_state)
Get led data state.
uint8_t rotaryy_get_eca_state(rotaryy_t *ctx)
State eca pin.
uint8_t rotaryy_get_ecb_state(rotaryy_t *ctx)
State ecb pin.
uint8_t rotaryy_button_push(rotaryy_t *ctx)
Button push state.
void rotaryy_generic_transfer(rotaryy_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
ROTARY Y data transfer function.
err_t rotaryy_init(rotaryy_t *ctx, rotaryy_cfg_t *cfg)
ROTARY Y initialization function.
void rotaryy_reset_led(rotaryy_t *ctx)
Reset led.
void rotaryy_turn_on_led_by_data(rotaryy_t *ctx, uint16_t write_data)
ROTARY Y generic data write function.
void rotaryy_cfg_setup(rotaryy_cfg_t *cfg)
ROTARY Y configuration object setup function.
void rotaryy_turn_on_led_by_position(rotaryy_t *ctx, uint8_t led_position)
ROTARY Y turn on led by position function.
rotaryy_return_value_t
ROTARY Y Click return value data.
Definition rotaryy.h:161
@ ROTARYY_OK
Definition rotaryy.h:162
@ ROTARYY_ERROR
Definition rotaryy.h:163
ROTARY Y Click configuration object.
Definition rotaryy.h:133
spi_master_chip_select_polarity_t cs_polarity
Definition rotaryy.h:152
pin_name_t eca
Definition rotaryy.h:145
pin_name_t sck
Definition rotaryy.h:138
spi_master_mode_t spi_mode
Definition rotaryy.h:151
pin_name_t mosi
Definition rotaryy.h:137
uint32_t spi_speed
Definition rotaryy.h:150
pin_name_t sw
Definition rotaryy.h:146
pin_name_t miso
Definition rotaryy.h:136
pin_name_t rst
Definition rotaryy.h:144
pin_name_t cs
Definition rotaryy.h:139
pin_name_t ecb
Definition rotaryy.h:143
ROTARY Y Click context object.
Definition rotaryy.h:108
digital_out_t cs
Definition rotaryy.h:112
digital_in_t eca
Definition rotaryy.h:117
spi_master_t spi
Definition rotaryy.h:122
digital_in_t ecb
Definition rotaryy.h:116
digital_in_t sw
Definition rotaryy.h:118
digital_out_t rst
Definition rotaryy.h:111
pin_name_t chip_select
Definition rotaryy.h:124