speedsense 2.1.0.0
Speed Sense Click Driver

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

Topics

 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.
 
err_t speedsense_init (speedsense_t *ctx, speedsense_cfg_t *cfg)
 Speed Sense initialization function.
 
uint8_t speedsense_get_speed (speedsense_t *ctx)
 Speed Sense CHA pin reading function.
 
uint8_t speedsense_get_direction (speedsense_t *ctx)
 Speed Sense CHB pin reading function.
 

Detailed Description

API for configuring and manipulating Speed Sense 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

◆ 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.