press 2.1.0.0
main.c File Reference

PRESS Click example. More...

#include "board.h"
#include "log.h"
#include "press.h"

Macros

#define EXAMPLE_MODE_PRESS_TEMP   0
 
#define EXAMPLE_MODE_SWIPE_SENSING   1
 
#define EXAMPLE_MODE   EXAMPLE_MODE_PRESS_TEMP
 
#define PRESS_THOLD_DETECT   10.0
 
#define PRESS_THOLD_TOUCH   15.0
 
#define PRESS_THOLD_SWIPE   30.0
 

Functions

void example_pressure_temperature (void)
 PRESS example pressure and temperature function.
 
void example_swipe_sensing (void)
 PRESS example swipe sensing function.
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

PRESS Click example.

Description

This example demonstrates the use of PRESS Click boardâ„¢ by reading and displaying the pressure, temperature and Qvar measurements.

The demo application is composed of two sections :

Application Init

The initialization of I2C module and log UART. After driver initialization, the app sets the default configuration.

Application Task

The demo application shows the module working depending on the example mode:

  • EXAMPLE_MODE_PRESS_TEMP: Reads and displays the Pressure [mBar] and Temperature [degree Celsius] data.
  • EXAMPLE_MODE_SWIPE_SENSING: Detect a touch or a swipe. Results are being sent to the UART Terminal, where you can track their changes.

Additional Functions :

  • void example_pressure_temperature ( void ) - Example pressure and temperature function.
  • void example_swipe_sensing ( void ) - Example swipe sensing function.
Author
Nenad Filipovic

Macro Definition Documentation

◆ EXAMPLE_MODE

#define EXAMPLE_MODE   EXAMPLE_MODE_PRESS_TEMP

◆ EXAMPLE_MODE_PRESS_TEMP

#define EXAMPLE_MODE_PRESS_TEMP   0

◆ EXAMPLE_MODE_SWIPE_SENSING

#define EXAMPLE_MODE_SWIPE_SENSING   1

◆ PRESS_THOLD_DETECT

#define PRESS_THOLD_DETECT   10.0

◆ PRESS_THOLD_SWIPE

#define PRESS_THOLD_SWIPE   30.0

◆ PRESS_THOLD_TOUCH

#define PRESS_THOLD_TOUCH   15.0

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 )

◆ example_pressure_temperature()

void example_pressure_temperature ( void )

PRESS example pressure and temperature function.

This function reads and displays the Pressure [mBar] and Temperature [degree Celsius] data.

Returns
Nothing.
Note
None.

◆ example_swipe_sensing()

void example_swipe_sensing ( void )

PRESS example swipe sensing function.

This function is used to detect a touch, a press, or even a swipe.

Returns
Nothing.
Note
None.

◆ main()

int main ( void )