optoencoder3 2.0.0.0
optoencoder3.h File Reference

This file contains API for Opto Encoder 3 Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  optoencoder3_t
 Click ctx object definition. More...
 
struct  optoencoder3_cfg_t
 Click configuration structure definition. More...
 
struct  optoencoder3_pins_t
 Click pins state. More...
 

Macros

#define OPTOENCODER3_MAP_MIKROBUS(cfg, mikrobus)
 
#define OPTOENCODER3_RETVAL   uint8_t
 
#define OPTOENCODER3_OK   0x00
 
#define OPTOENCODER3_INIT_ERROR   0xFF
 
#define OPTOENCODER3_ENABLE   0
 
#define OPTOENCODER3_DISABLE   1
 
#define OPTOENCODER3_PIN_ACTIVE   0
 
#define OPTOENCODER3_PIN_NOT_ACTIVE   1
 

Functions

void optoencoder3_cfg_setup (optoencoder3_cfg_t *cfg)
 Config Object Initialization function.
 
OPTOENCODER3_RETVAL optoencoder3_init (optoencoder3_t *ctx, optoencoder3_cfg_t *cfg)
 Initialization function.
 
void optoencoder3_enable (optoencoder3_t *ctx, uint8_t active)
 Sets state of click.
 
uint8_t optoencoder3_read_pin_o1 (optoencoder3_t *ctx)
 Functions for reading state of pin o1.
 
uint8_t optoencoder3_read_pin_o2 (optoencoder3_t *ctx)
 Functions for reading state of pin o2.
 
uint8_t optoencoder3_read_pin_o3 (optoencoder3_t *ctx)
 Functions for reading state of pin o3.
 
uint8_t optoencoder3_read_pin_o4 (optoencoder3_t *ctx)
 Functions for reading state of pin o4.
 
uint8_t optoencoder3_cnt (optoencoder3_t *ctx)
 Functions for reading number of swipes.
 
int8_t optoencoder3_dir_cnt (optoencoder3_t *ctx)
 Functions for reading number of swipe directions.
 
void optoencoder3_reset_counters (optoencoder3_t *ctx)
 Functions for reseting counters.
 
void optoencoder3_read_all_pins (optoencoder3_t *ctx, optoencoder3_pins_t *pins)
 Sets state of all pins.
 

Detailed Description

This file contains API for Opto Encoder 3 Click driver.