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 ROTARYR_ONE_LED 0x0001
69#define ROTARYR_TWO_LED 0x0101
70#define ROTARYR_FOUR_LED 0x1111
71#define ROTARYR_EIGHT_LED 0x5555
72#define ROTARYR_RESET_LED 0x0000
90#define ROTARYR_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 )
uint8_t rotaryr_button_push(rotaryr_t *ctx)
Button push state.
uint8_t rotaryr_get_ecb_state(rotaryr_t *ctx)
State ecb pin.
void rotaryr_generic_transfer(rotaryr_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
ROTARY R data transfer function.
uint8_t rotaryr_get_eca_state(rotaryr_t *ctx)
State eca pin.
void rotaryr_cfg_setup(rotaryr_cfg_t *cfg)
ROTARY R configuration object setup function.
uint16_t rotaryr_get_led_data(uint8_t current_led_state)
Get led data state.
void rotaryr_turn_on_led_by_data(rotaryr_t *ctx, uint16_t write_data)
ROTARY R generic data write function.
void rotaryr_reset_led(rotaryr_t *ctx)
Reset led.
err_t rotaryr_init(rotaryr_t *ctx, rotaryr_cfg_t *cfg)
ROTARY R initialization function.
void rotaryr_turn_on_led_by_position(rotaryr_t *ctx, uint8_t led_position)
ROTARY R turn on led by position function.
rotaryr_return_value_t
ROTARY R Click return value data.
Definition rotaryr.h:161
@ ROTARYR_ERROR
Definition rotaryr.h:163
@ ROTARYR_OK
Definition rotaryr.h:162
ROTARY R Click configuration object.
Definition rotaryr.h:133
spi_master_chip_select_polarity_t cs_polarity
Definition rotaryr.h:152
pin_name_t eca
Definition rotaryr.h:145
pin_name_t sck
Definition rotaryr.h:138
spi_master_mode_t spi_mode
Definition rotaryr.h:151
pin_name_t mosi
Definition rotaryr.h:137
uint32_t spi_speed
Definition rotaryr.h:150
pin_name_t sw
Definition rotaryr.h:146
pin_name_t miso
Definition rotaryr.h:136
pin_name_t rst
Definition rotaryr.h:144
pin_name_t cs
Definition rotaryr.h:139
pin_name_t ecb
Definition rotaryr.h:143
ROTARY R Click context object.
Definition rotaryr.h:108
digital_out_t cs
Definition rotaryr.h:112
digital_in_t eca
Definition rotaryr.h:117
spi_master_t spi
Definition rotaryr.h:122
digital_in_t ecb
Definition rotaryr.h:116
digital_in_t sw
Definition rotaryr.h:118
digital_out_t rst
Definition rotaryr.h:111
pin_name_t chip_select
Definition rotaryr.h:124