speedsense 2.1.0.0
main.c File Reference

Speed Sense Click Example. More...

#include "board.h"
#include "log.h"
#include "speedsense.h"

Macros

#define SPEEDSENSE_MAG_POLE_PAIRS   3
 
#define SPEEDSENSE_CALC_RMP   SPEEDSENSE_CNV_MIN_TO_MS / SPEEDSENSE_MAG_POLE_PAIRS
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

uint8_t start_measure = SPEEDSENSE_STOP_MEASURE
 
uint32_t time_cnt = 0
 
uint32_t signal_duration = 0
 
uint32_t start_timer = 0
 

Detailed Description

Speed Sense Click Example.

Description

This library contains the API for the Speed Sense Click driver for the speed and direction signal state detection for every magnetic pole pair.

The demo application is composed of two sections :

Application Init

Initialization of GPIO and log UART.

Application Task

This example demonstrates the use of the Speed Sense Click board. The demo application displays the direction of movement and rotation speed (rotations per minute) of the ring magnet with three pairs of rotating poles positioned in the sensor operating range.

Author
Nenad Filipovic

Macro Definition Documentation

◆ SPEEDSENSE_CALC_RMP

#define SPEEDSENSE_CALC_RMP   SPEEDSENSE_CNV_MIN_TO_MS / SPEEDSENSE_MAG_POLE_PAIRS

◆ SPEEDSENSE_MAG_POLE_PAIRS

#define SPEEDSENSE_MAG_POLE_PAIRS   3

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

Variable Documentation

◆ signal_duration

uint32_t signal_duration = 0

◆ start_measure

uint8_t start_measure = SPEEDSENSE_STOP_MEASURE

◆ start_timer

uint32_t start_timer = 0

◆ time_cnt

uint32_t time_cnt = 0