rotaryo 2.0.0.0
ROTARY O Click Driver

API for configuring and manipulating ROTARY O Click driver. More...

Topics

 ROTARY O MikroBUS Map
 MikroBUS pin mapping of ROTARY O Click driver.
 
 Rotaryo_led
 

Functions

void rotaryo_cfg_setup (rotaryo_cfg_t *cfg)
 ROTARY O configuration object setup function.
 
err_t rotaryo_init (rotaryo_t *ctx, rotaryo_cfg_t *cfg)
 ROTARY O initialization function.
 
void rotaryo_generic_transfer (rotaryo_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len)
 ROTARY O data transfer function.
 
void rotaryo_turn_on_led_by_data (rotaryo_t *ctx, uint16_t write_data)
 ROTARY O generic data write function.
 
void rotaryo_turn_on_led_by_position (rotaryo_t *ctx, uint8_t led_position)
 ROTARY O turn on led by position function.
 
uint8_t rotaryo_button_push (rotaryo_t *ctx)
 Button push state.
 
uint16_t rotaryo_get_led_data (uint8_t current_led_state)
 Get led data state.
 
void rotaryo_reset_led (rotaryo_t *ctx)
 Reset led.
 
uint8_t rotaryo_get_ecb_state (rotaryo_t *ctx)
 State ecb pin.
 
uint8_t rotaryo_get_eca_state (rotaryo_t *ctx)
 State eca pin.
 

Detailed Description

API for configuring and manipulating ROTARY O Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ rotaryo_button_push()

uint8_t rotaryo_button_push ( rotaryo_t * ctx)

Button push state.

Function return 1 if button is pushed and return 0 if not

Parameters
[in]ctx: Click context object. See rotaryo_t object definition for detailed explanation.
Returns
  • 1 - Button is pushed,
  • 0 - Button isn't pushed.
Note
None.

◆ rotaryo_cfg_setup()

void rotaryo_cfg_setup ( rotaryo_cfg_t * cfg)

ROTARY O configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See rotaryo_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ rotaryo_generic_transfer()

void rotaryo_generic_transfer ( rotaryo_t * ctx,
uint8_t * wr_buf,
uint16_t wr_len,
uint8_t * rd_buf,
uint16_t rd_len )

ROTARY O data transfer function.

This function reads and writes a desired number of data bytes starting from the selected register by using SPI serial interface.

Parameters
[in]ctx: Click context object. See rotaryo_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.
Returns
Nothing.
Note
None.

◆ rotaryo_get_eca_state()

uint8_t rotaryo_get_eca_state ( rotaryo_t * ctx)

State eca pin.

Function return eca state.

Parameters
[in]ctx: Click context object. See rotaryo_t object definition for detailed explanation.
Returns
eca pin state
Note
None.

◆ rotaryo_get_ecb_state()

uint8_t rotaryo_get_ecb_state ( rotaryo_t * ctx)

State ecb pin.

Function return ecb state.

Parameters
[in]ctx: Click context object. See rotaryo_t object definition for detailed explanation.
Returns
ecb pin state
Note
None.

◆ rotaryo_get_led_data()

uint16_t rotaryo_get_led_data ( uint8_t current_led_state)

Get led data state.

Function return 16-bit data by current led state.

Parameters
[in]current_led_state: Current state of led.
Returns
Led state.
Note
None.

◆ rotaryo_init()

err_t rotaryo_init ( rotaryo_t * ctx,
rotaryo_cfg_t * cfg )

ROTARY O initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See rotaryo_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See rotaryo_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ rotaryo_reset_led()

void rotaryo_reset_led ( rotaryo_t * ctx)

Reset led.

Function turn off all led.

Parameters
[in]ctx: Click context object. See rotaryo_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ rotaryo_turn_on_led_by_data()

void rotaryo_turn_on_led_by_data ( rotaryo_t * ctx,
uint16_t write_data )

ROTARY O generic data write function.

Function turn on led by data.

Parameters
[in]ctx: Click context object. See rotaryo_t object definition for detailed explanation.
[in]write_data: Data to write.
Returns
Nothing.
Note
None.

◆ rotaryo_turn_on_led_by_position()

void rotaryo_turn_on_led_by_position ( rotaryo_t * ctx,
uint8_t led_position )

ROTARY O turn on led by position function.

Function turn on led by position

Parameters
[in]ctx: Click context object. See rotaryo_t object definition for detailed explanation.
[in]led_position: Led position.
Returns
Nothing.
Note
None.