rotaryo2 2.1.0.0
rotaryo2.h File Reference

This file contains API for Rotary O 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  rotaryo2_t
 Rotary O 2 Click context object. More...
 
struct  rotaryo2_cfg_t
 Rotary O 2 Click configuration object. More...
 

Macros

#define ROTARYO2_SET_LED_OFF   0x0000u
 Rotary O 2 led data values.
 
#define ROTARYO2_SET_LED_DATA_1   0x0001u
 
#define ROTARYO2_SET_LED_DATA_2   0x0002u
 
#define ROTARYO2_SET_LED_DATA_3   0x0004u
 
#define ROTARYO2_SET_LED_DATA_4   0x0008u
 
#define ROTARYO2_SET_LED_DATA_5   0x0010u
 
#define ROTARYO2_SET_LED_DATA_6   0x0020u
 
#define ROTARYO2_SET_LED_DATA_7   0x0040u
 
#define ROTARYO2_SET_LED_DATA_8   0x0080u
 
#define ROTARYO2_SET_LED_DATA_9   0x0100u
 
#define ROTARYO2_SET_LED_DATA_10   0x0200u
 
#define ROTARYO2_SET_LED_DATA_11   0x0400u
 
#define ROTARYO2_SET_LED_DATA_12   0x0800u
 
#define ROTARYO2_SET_LED_DATA_13   0x1000u
 
#define ROTARYO2_SET_LED_DATA_14   0x2000u
 
#define ROTARYO2_SET_LED_DATA_15   0x4000u
 
#define ROTARYO2_SET_LED_DATA_16   0x8000u
 
#define ROTARYO2_SET_LED_POS_1   1
 Rotary O 2 led position values.
 
#define ROTARYO2_SET_LED_POS_2   2
 
#define ROTARYO2_SET_LED_POS_3   3
 
#define ROTARYO2_SET_LED_POS_4   4
 
#define ROTARYO2_SET_LED_POS_5   5
 
#define ROTARYO2_SET_LED_POS_6   6
 
#define ROTARYO2_SET_LED_POS_7   7
 
#define ROTARYO2_SET_LED_POS_8   8
 
#define ROTARYO2_SET_LED_POS_9   9
 
#define ROTARYO2_SET_LED_POS_10   10
 
#define ROTARYO2_SET_LED_POS_11   11
 
#define ROTARYO2_SET_LED_POS_12   12
 
#define ROTARYO2_SET_LED_POS_13   13
 
#define ROTARYO2_SET_LED_POS_14   14
 
#define ROTARYO2_SET_LED_POS_15   15
 
#define ROTARYO2_SET_LED_POS_16   16
 
#define ROTARYO2_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
 
#define ROTARYO2_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
 
#define ROTARYO2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rotaryo2_return_value_t { ROTARYO2_OK = 0 , ROTARYO2_ERROR = -1 }
 Rotary O 2 Click return value data. More...
 

Functions

void rotaryo2_cfg_setup (rotaryo2_cfg_t *cfg)
 Rotary O 2 configuration object setup function.
 
err_t rotaryo2_init (rotaryo2_t *ctx, rotaryo2_cfg_t *cfg)
 Rotary O 2 initialization function.
 
err_t rotaryo2_default_cfg (rotaryo2_t *ctx)
 Rotary O 2 default configuration function.
 
err_t rotaryo2_set_led_data (rotaryo2_t *ctx, uint16_t data_in)
 Rotary O 2 set LED data function.
 
err_t rotaryo2_get_led_data (rotaryo2_t *ctx, uint16_t *data_out)
 Rotary O 2 get LED data function.
 
err_t rotaryo2_set_led_pos (rotaryo2_t *ctx, uint8_t led_pos)
 Rotary O 2 set LED position function.
 
uint8_t rotaryo2_get_state_switch (rotaryo2_t *ctx)
 Rotary O 2 get switch state function.
 
uint8_t rotaryo2_get_state_ena (rotaryo2_t *ctx)
 Rotary O 2 get ena state function.
 
uint8_t rotaryo2_get_state_enb (rotaryo2_t *ctx)
 Rotary O 2 get enb state function.
 

Detailed Description

This file contains API for Rotary O 2 Click Driver.

Enumeration Type Documentation

◆ rotaryo2_return_value_t

Rotary O 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
ROTARYO2_OK 
ROTARYO2_ERROR