speedsense  2.1.0.0
Modules | Functions
Speed Sense Click Driver

API for configuring and manipulating Speed Sense Click driver. More...

Modules

 Speed Sense MikroBUS Map
 MikroBUS pin mapping of Speed Sense Click driver.
 
 Speedsense_set
 

Functions

void speedsense_cfg_setup (speedsense_cfg_t *cfg)
 Speed Sense configuration object setup function. More...
 
err_t speedsense_init (speedsense_t *ctx, speedsense_cfg_t *cfg)
 Speed Sense initialization function. More...
 
uint8_t speedsense_get_speed (speedsense_t *ctx)
 Speed Sense CHA pin reading function. More...
 
uint8_t speedsense_get_direction (speedsense_t *ctx)
 Speed Sense CHB pin reading function. More...
 

Detailed Description

API for configuring and manipulating Speed Sense Click driver.

Function Documentation

◆ speedsense_cfg_setup()

void speedsense_cfg_setup ( speedsense_cfg_t cfg)

Speed Sense configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ speedsense_get_direction()

uint8_t speedsense_get_direction ( speedsense_t ctx)

Speed Sense CHB pin reading function.

This function reads the state of the CHB pin used for direction output protocols of Speed Sens click board.

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

◆ speedsense_get_speed()

uint8_t speedsense_get_speed ( speedsense_t ctx)

Speed Sense CHA pin reading function.

This function reads the state of the CHA pin used for speed output protocols Speed Sense click board.

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

◆ speedsense_init()

err_t speedsense_init ( speedsense_t ctx,
speedsense_cfg_t cfg 
)

Speed Sense initialization function.

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

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