rotaryb 2.0.0.0
|
API for configuring and manipulating ROTARY B Click driver. More...
Topics | |
ROTARY B MikroBUS Map | |
MikroBUS pin mapping of ROTARY B Click driver. | |
Rotaryb_led | |
Functions | |
void | rotaryb_cfg_setup (rotaryb_cfg_t *cfg) |
ROTARY B configuration object setup function. | |
err_t | rotaryb_init (rotaryb_t *ctx, rotaryb_cfg_t *cfg) |
ROTARY B initialization function. | |
void | rotaryb_generic_transfer (rotaryb_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
ROTARY B data transfer function. | |
void | rotaryb_turn_on_led_by_data (rotaryb_t *ctx, uint16_t write_data) |
ROTARY B generic data write function. | |
void | rotaryb_turn_on_led_by_position (rotaryb_t *ctx, uint8_t led_position) |
ROTARY B turn on led by position function. | |
uint8_t | rotaryb_button_push (rotaryb_t *ctx) |
Button push state. | |
uint16_t | rotaryb_get_led_data (uint8_t current_led_state) |
Get led data state. | |
void | rotaryb_reset_led (rotaryb_t *ctx) |
Reset led. | |
uint8_t | rotaryb_get_ecb_state (rotaryb_t *ctx) |
State ecb pin. | |
uint8_t | rotaryb_get_eca_state (rotaryb_t *ctx) |
State eca pin. | |
API for configuring and manipulating ROTARY B Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
uint8_t rotaryb_button_push | ( | rotaryb_t * | ctx | ) |
Button push state.
Function return 1 if button is pushed and return 0 if not
[in] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
1
- Button is pushed, 0
- Button isn't pushed.void rotaryb_cfg_setup | ( | rotaryb_cfg_t * | cfg | ) |
ROTARY B configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See rotaryb_cfg_t object definition for detailed explanation. |
void rotaryb_generic_transfer | ( | rotaryb_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
ROTARY B data transfer function.
This function reads and writes a desired number of data bytes starting from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
[in] | wr_buf | : Write data buffer. |
[in] | wr_len | : Number of byte in write data buffer. |
[in] | rd_buf | : Read data buffer. |
[in] | rd_len | : Number of byte in read data buffer. |
uint8_t rotaryb_get_eca_state | ( | rotaryb_t * | ctx | ) |
State eca pin.
Function return eca state.
[in] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
uint8_t rotaryb_get_ecb_state | ( | rotaryb_t * | ctx | ) |
State ecb pin.
Function return ecb state.
[in] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
uint16_t rotaryb_get_led_data | ( | uint8_t | current_led_state | ) |
Get led data state.
Function return 16-bit data by current led state.
[in] | current_led_state | : Current state of led. |
err_t rotaryb_init | ( | rotaryb_t * | ctx, |
rotaryb_cfg_t * | cfg ) |
ROTARY B initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See rotaryb_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void rotaryb_reset_led | ( | rotaryb_t * | ctx | ) |
Reset led.
Function turn off all led.
[in] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
void rotaryb_turn_on_led_by_data | ( | rotaryb_t * | ctx, |
uint16_t | write_data ) |
ROTARY B generic data write function.
Function turn on led by data.
[in] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
[in] | write_data | : Data to write. |
void rotaryb_turn_on_led_by_position | ( | rotaryb_t * | ctx, |
uint8_t | led_position ) |
ROTARY B turn on led by position function.
Function turn on led by position
[in] | ctx | : Click context object. See rotaryb_t object definition for detailed explanation. |
[in] | led_position | : Led position. |