Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_one_wire.h"
69 #define THUMBWHEEL_CMD_CHANNEL_ACCESS_READ 0xF5
70 #define THUMBWHEEL_CMD_RESET_ACTIVITY_LATCHES 0xC3
71 #define THUMBWHEEL_CMD_WRITE_COND_SEARCH_REG 0xCC
72 #define THUMBWHEEL_CMD_READ_PIO_REG 0xF0
90 #define THUMBWHEEL_REG_CONTROL_STATUS 0x008D
91 #define THUMBWHEEL_REG_COND_SEARCH_SELECTION 0x008B
92 #define THUMBWHEEL_REG_PIO_LOGIC 0x0088
105 #define THUMBWHEEL_FAMILY_CODE 0x29
106 #define THUMBWHEEL_CONFIG_RESERVED_BITS 0x70
124 #define THUMBWHEEL_MAP_MIKROBUS( cfg, mikrobus ) \
125 cfg.gp0 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
126 cfg.gp1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
127 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST );
316 #endif // THUMBWHEEL_H
err_t thumbwheel_get_position(thumbwheel_t *ctx, uint8_t *position)
Thumbwheel get position function.
void thumbwheel_cfg_setup(thumbwheel_cfg_t *cfg)
Thumbwheel configuration object setup function.
@ THUMBWHEEL_OK
Definition: thumbwheel.h:182
digital_out_t rst
Definition: thumbwheel.h:150
err_t thumbwheel_check_communication(thumbwheel_t *ctx)
Thumbwheel check communication function.
thumbwheel_return_value_t
Thumbwheel Click return value data.
Definition: thumbwheel.h:181
pin_name_t gp1
Definition: thumbwheel.h:167
@ THUMBWHEEL_GPIO_0
Definition: thumbwheel.h:138
void thumbwheel_gpio_selection(thumbwheel_cfg_t *cfg, thumbwheel_gpio_sel_t gpio_sel)
Thumbwheel driver interface setup function.
void thumbwheel_set_rst_pin(thumbwheel_t *ctx, uint8_t state)
Thumbwheel set reset pin function.
err_t thumbwheel_reset_latches(thumbwheel_t *ctx)
Thumbwheel reset latches function.
thumbwheel_gpio_sel_t
Thumbwheel Click gpio selector.
Definition: thumbwheel.h:137
err_t thumbwheel_write_register(thumbwheel_t *ctx, uint16_t reg, uint8_t data_in)
Thumbwheel write register function.
err_t thumbwheel_init(thumbwheel_t *ctx, thumbwheel_cfg_t *cfg)
Thumbwheel initialization function.
one_wire_t ow
Definition: thumbwheel.h:153
pin_name_t gp0
Definition: thumbwheel.h:166
thumbwheel_gpio_sel_t gpio_sel
Definition: thumbwheel.h:172
@ THUMBWHEEL_GPIO_1
Definition: thumbwheel.h:139
@ THUMBWHEEL_ERROR
Definition: thumbwheel.h:183
Thumbwheel Click context object.
Definition: thumbwheel.h:148
pin_name_t rst
Definition: thumbwheel.h:170
err_t thumbwheel_read_register(thumbwheel_t *ctx, uint16_t reg, uint8_t *data_out)
Thumbwheel read register function.
one_wire_rom_address_t rom_addr
Definition: thumbwheel.h:155
Thumbwheel Click configuration object.
Definition: thumbwheel.h:164