optoencoder 2.0.0.0

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

Function Documentation

◆ optoencoder_cfg_setup()

void optoencoder_cfg_setup ( optoencoder_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ optoencoder_get_o1()

uint8_t optoencoder_get_o1 ( optoencoder_t * ctx)

Function for reading O1 state.

Parameters
ctxClick object.
Returns
O1 pin state

◆ optoencoder_get_o2()

uint8_t optoencoder_get_o2 ( optoencoder_t * ctx)

Function for reading O2 state.

Parameters
ctxClick object.
Returns
O2 pin state

◆ optoencoder_get_position()

int16_t optoencoder_get_position ( optoencoder_t * ctx)

Function for reading the position of the encoder.

Parameters
ctxClick object.
Returns
position of the encoder

◆ optoencoder_init()

OPTOENCODER_RETVAL optoencoder_init ( optoencoder_t * ctx,
optoencoder_cfg_t * cfg )

Initialization function.

Parameters
optoencoderClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ optoencoder_init_dev()

void optoencoder_init_dev ( optoencoder_t * ctx)

Initialization function.

Parameters
ctxClick object.