optoencoder5  2.1.0.0
Modules | Functions
Opto Encoder 5 Click Driver

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

Modules

 Opto Encoder 5 MikroBUS Map
 MikroBUS pin mapping of Opto Encoder 5 Click driver.
 
 Optoencoder5_set
 

Functions

void optoencoder5_cfg_setup (optoencoder5_cfg_t *cfg)
 Opto Encoder 5 configuration object setup function. More...
 
err_t optoencoder5_init (optoencoder5_t *ctx, optoencoder5_cfg_t *cfg)
 Opto Encoder 5 initialization function. More...
 
void optoencoder5_enable (optoencoder5_t *ctx)
 Opto Encoder 5 enable function. More...
 
void optoencoder5_disable (optoencoder5_t *ctx)
 Opto Encoder 5 disable function. More...
 
uint8_t optoencoder5_get_out_state (optoencoder5_t *ctx)
 Opto Encoder 5 get state function. More...
 

Detailed Description

API for configuring and manipulating Opto Encoder 5 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

◆ optoencoder5_cfg_setup()

void optoencoder5_cfg_setup ( optoencoder5_cfg_t cfg)

Opto Encoder 5 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ optoencoder5_disable()

void optoencoder5_disable ( optoencoder5_t ctx)

Opto Encoder 5 disable function.

This function disables the slotted optical switch of Opto Encoder 5 click board.

Parameters
[in]ctx: Click context object. See optoencoder5_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ optoencoder5_enable()

void optoencoder5_enable ( optoencoder5_t ctx)

Opto Encoder 5 enable function.

This function enables the slotted optical switch of Opto Encoder 5 click board.

Parameters
[in]ctx: Click context object. See optoencoder5_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ optoencoder5_get_out_state()

uint8_t optoencoder5_get_out_state ( optoencoder5_t ctx)

Opto Encoder 5 get state function.

This function detecting slotted optical switch states of Opto Encoder 5 click board.

Parameters
[in]ctx: Click context object. See optoencoder5_t object definition for detailed explanation.
Returns
  • 0 - Open,
  • 1 - Closed.
Note
None.

◆ optoencoder5_init()

err_t optoencoder5_init ( optoencoder5_t ctx,
optoencoder5_cfg_t cfg 
)

Opto Encoder 5 initialization function.

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

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