optoencoder4 2.1.0.0
Opto Encoder 4 Click Driver

API for configuring and manipulating Opto Encoder 4 Click driver. More...

Topics

 Opto Encoder 4 MikroBUS Map
 MikroBUS pin mapping of Opto Encoder 4 Click driver.
 

Functions

void optoencoder4_cfg_setup (optoencoder4_cfg_t *cfg)
 Opto Encoder 4 configuration object setup function.
 
err_t optoencoder4_init (optoencoder4_t *ctx, optoencoder4_cfg_t *cfg)
 Opto Encoder 4 initialization function.
 
uint8_t optoencoder4_get_out_pin (optoencoder4_t *ctx)
 Opto Encoder 4 get out pin function.
 
uint8_t optoencoder4_get_our_pin (optoencoder4_t *ctx)
 Opto Encoder 4 get our pin function.
 

Detailed Description

API for configuring and manipulating Opto Encoder 4 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ optoencoder4_cfg_setup()

void optoencoder4_cfg_setup ( optoencoder4_cfg_t * cfg)

Opto Encoder 4 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See optoencoder4_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ optoencoder4_get_our_pin()

uint8_t optoencoder4_get_our_pin ( optoencoder4_t * ctx)

Opto Encoder 4 get our pin function.

This function returns the output pin reversed logic state.

Parameters
[in]ctx: Click context object. See optoencoder4_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ optoencoder4_get_out_pin()

uint8_t optoencoder4_get_out_pin ( optoencoder4_t * ctx)

Opto Encoder 4 get out pin function.

This function returns the output pin logic state.

Parameters
[in]ctx: Click context object. See optoencoder4_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state.
Note
None.

◆ optoencoder4_init()

err_t optoencoder4_init ( optoencoder4_t * ctx,
optoencoder4_cfg_t * cfg )

Opto Encoder 4 initialization function.

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

Parameters
[out]ctx: Click context object. See optoencoder4_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See optoencoder4_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.