rotaryswitch 2.1.0.0
Loading...
Searching...
No Matches
rotaryswitch.h File Reference

This file contains API for Rotary Switch Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  rotaryswitch_t
 Rotary Switch Click context object. More...
 
struct  rotaryswitch_cfg_t
 Rotary Switch Click configuration object. More...
 

Macros

#define ROTARYSWITCH_REG_INPUT_PORT   0x00
 Rotary Switch register list.
 
#define ROTARYSWITCH_REG_OUTPUT_PORT   0x01
 
#define ROTARYSWITCH_REG_POLARITY_INV   0x02
 
#define ROTARYSWITCH_REG_CONFIG   0x03
 
#define ROTARYSWITCH_REG_SPECIAL_FUNC   0x50
 
#define ROTARYSWITCH_CONFIG_DEFAULT   0xFF
 Rotary Switch default register settings.
 
#define ROTARYSWITCH_POLARITY_INV_DEFAULT   0x0F
 
#define ROTARYSWITCH_SPECIAL_FUNC_DEFAULT   0x00
 
#define ROTARYSWITCH_NO_PIN_MASK   0x00
 Rotary Switch pin mask values.
 
#define ROTARYSWITCH_PIN_0_MASK   0x01
 
#define ROTARYSWITCH_PIN_1_MASK   0x02
 
#define ROTARYSWITCH_PIN_2_MASK   0x04
 
#define ROTARYSWITCH_PIN_3_MASK   0x08
 
#define ROTARYSWITCH_ALL_PINS_MASK   0x0F
 
#define ROTARYSWITCH_DEVICE_ADDRESS   0x41
 Rotary Switch device address setting.
 
#define ROTARYSWITCH_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rotaryswitch_return_value_t { ROTARYSWITCH_OK = 0 , ROTARYSWITCH_ERROR = -1 }
 Rotary Switch Click return value data. More...
 

Functions

void rotaryswitch_cfg_setup (rotaryswitch_cfg_t *cfg)
 Rotary Switch configuration object setup function.
 
err_t rotaryswitch_init (rotaryswitch_t *ctx, rotaryswitch_cfg_t *cfg)
 Rotary Switch initialization function.
 
err_t rotaryswitch_default_cfg (rotaryswitch_t *ctx)
 Rotary Switch default configuration function.
 
err_t rotaryswitch_write_reg (rotaryswitch_t *ctx, uint8_t reg, uint8_t data_in)
 Rotary Switch write reg function.
 
err_t rotaryswitch_read_reg (rotaryswitch_t *ctx, uint8_t reg, uint8_t *data_out)
 Rotary Switch read reg function.
 
err_t rotaryswitch_get_position (rotaryswitch_t *ctx, uint8_t *position)
 Rotary Switch get position function.
 

Detailed Description

This file contains API for Rotary Switch Click Driver.

Enumeration Type Documentation

◆ rotaryswitch_return_value_t

Rotary Switch Click return value data.

Predefined enum values for driver return values.

Enumerator
ROTARYSWITCH_OK 
ROTARYSWITCH_ERROR