optoencoder2 2.0.0.0
optoencoder2.h File Reference

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

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

Go to the source code of this file.

Data Structures

struct  optoencoder2_t
 Click ctx object definition. More...
 
struct  optoencoder2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define OPTOENCODER2_MAP_MIKROBUS(cfg, mikrobus)
 
#define OPTOENCODER2_OK   0
 
#define OPTOENCODER2_ERROR   -1
 

Functions

void optoencoder2_cfg_setup (optoencoder2_cfg_t *cfg)
 Config Object Initialization function.
 
err_t optoencoder2_init (optoencoder2_t *ctx, optoencoder2_cfg_t *cfg)
 Initialization function.
 
uint8_t optoencoder2_pwm_get (optoencoder2_t *ctx)
 Getting PWM pin state.
 
uint8_t optoencoder2_int_get (optoencoder2_t *ctx)
 Getting INT pin state.
 
int32_t optoencoder2_get_position (optoencoder2_t *ctx)
 Getting encoder position.
 
void optoencoder2_zero_counter (optoencoder2_t *ctx)
 Reset encoder counter.
 
uint8_t optoencoder2_isr (optoencoder2_t *ctx, uint8_t n_cycles)
 Incrementing/decrementing encoder counter.
 

Detailed Description

This file contains API for Opto Encoder 2 Click driver.