optoencoder 2.0.0.0
optoencoder.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  optoencoder_t
 Click ctx object definition. More...
 
struct  optoencoder_cfg_t
 Click configuration structure definition. More...
 

Macros

#define OPTOENCODER_MAP_MIKROBUS(cfg, mikrobus)
 
#define OPTOENCODER_RETVAL   uint8_t
 
#define OPTOENCODER_OK   0x00
 
#define OPTOENCODER_INIT_ERROR   0xFF
 

Functions

void optoencoder_cfg_setup (optoencoder_cfg_t *cfg)
 Config Object Initialization function.
 
OPTOENCODER_RETVAL optoencoder_init (optoencoder_t *ctx, optoencoder_cfg_t *cfg)
 Initialization function.
 
uint8_t optoencoder_get_o1 (optoencoder_t *ctx)
 Function for reading O1 state.
 
uint8_t optoencoder_get_o2 (optoencoder_t *ctx)
 Function for reading O2 state.
 
void optoencoder_init_dev (optoencoder_t *ctx)
 Initialization function.
 
int16_t optoencoder_get_position (optoencoder_t *ctx)
 Function for reading the position of the encoder.
 

Detailed Description

This file contains API for Opto Encoder Click driver.