optoencoder3  2.0.0.0
Functions

Functions

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

Detailed Description

Function Documentation

◆ optoencoder3_cfg_setup()

void optoencoder3_cfg_setup ( optoencoder3_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.

◆ optoencoder3_cnt()

uint8_t optoencoder3_cnt ( optoencoder3_t ctx)

Functions for reading number of swipes.

Parameters
ctxClick object.
Returns
8-bit data of swipe number.

◆ optoencoder3_dir_cnt()

int8_t optoencoder3_dir_cnt ( optoencoder3_t ctx)

Functions for reading number of swipe directions.

Parameters
ctxClick object.
Note
:
    This function adds 1 to counter if it detects swipe from one direction or deducts 1
    if it detects swipe from other direction
Returns
8-bit data of counter number.

◆ optoencoder3_enable()

void optoencoder3_enable ( optoencoder3_t ctx,
uint8_t  active 
)

Sets state of click.

Parameters
ctxClick object.
activeState to be set

◆ optoencoder3_init()

OPTOENCODER3_RETVAL optoencoder3_init ( optoencoder3_t ctx,
optoencoder3_cfg_t cfg 
)

Initialization function.

Parameters
optoencoder3Click object.
cfgClick configuration structure.

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

◆ optoencoder3_read_all_pins()

void optoencoder3_read_all_pins ( optoencoder3_t ctx,
optoencoder3_pins_t pins 
)

Sets state of all pins.

Parameters
ctxClick object.
*pinsPointer on struct of all pins that is being set

◆ optoencoder3_read_pin_o1()

uint8_t optoencoder3_read_pin_o1 ( optoencoder3_t ctx)

Functions for reading state of pin o1.

Parameters
ctxClick object.
Returns
8-bit data that is read from the pin.

◆ optoencoder3_read_pin_o2()

uint8_t optoencoder3_read_pin_o2 ( optoencoder3_t ctx)

Functions for reading state of pin o2.

Parameters
ctxClick object.
Returns
8-bit data that is read from the pin.

◆ optoencoder3_read_pin_o3()

uint8_t optoencoder3_read_pin_o3 ( optoencoder3_t ctx)

Functions for reading state of pin o3.

Parameters
ctxClick object.
Returns
8-bit data that is read from the pin.

◆ optoencoder3_read_pin_o4()

uint8_t optoencoder3_read_pin_o4 ( optoencoder3_t ctx)

Functions for reading state of pin o4.

Parameters
ctxClick object.
Returns
8-bit data that is read from the pin.

◆ optoencoder3_reset_counters()

void optoencoder3_reset_counters ( optoencoder3_t ctx)

Functions for reseting counters.

Parameters
ctxClick object.