optoencoder3 2.0.0.0
main.c File Reference

Opto Encoder 3 Click example. More...

#include "board.h"
#include "log.h"
#include "optoencoder3.h"

Macros

#define DEMO_CNT   1
 
#define DEMO_GRAPH   2
 

Functions

void draw_pins_status (void)
 
void view_counters (void)
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

optoencoder3_pins_t pins
 

Detailed Description

Opto Encoder 3 Click example.

Description

The demo application displays the counter value or displays the status of each O pins.

The demo application is composed of two sections :

Application Init

Configures the driver and logger, and selects the demo application mode.

Application Task

Depending on the demo application mode set in the application init it:

  • Measures and displays the value of the counter - DEMO_CNT mode; or
  • Draws the status of each O pin - DEMO_GRAPH mode.
Author
Luka Filipovic

Macro Definition Documentation

◆ DEMO_CNT

#define DEMO_CNT   1

◆ DEMO_GRAPH

#define DEMO_GRAPH   2

Function Documentation

◆ application_init()

void application_init ( void )

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 )

◆ draw_pins_status()

void draw_pins_status ( void )

◆ main()

int main ( void )

◆ view_counters()

void view_counters ( void )

Variable Documentation

◆ pins