accel16 2.0.0.0
main.c File Reference

Accel16 Click example. More...

#include "board.h"
#include "log.h"
#include "accel16.h"
#include "conversions.h"

Functions

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

Detailed Description

Accel16 Click example.

Description

This showcases ability of the click board to read x, y, and z axes data in different resolution, read IC temperature and also have additional functionality to read ADC data. Device also has ability to store data in internal fifo buffer.

The demo application is composed of two sections :

Application Init

Initialization of communication modules(SPI, UART) and additional interrupt pins. Reads device ID's and revision. Then configures device to work in FIFO mode or to read data from the registers, sets 2g resolution, 12.5Hz output data rate, sets interrupt 1 active low, powers on device, and calibrates temperature.

Application Task

Depending of the application mode selects example.

  • If fifo example is selected waits for the interrupt to indicate that data is ready in fifo buffer and reads number of fifo entries. Data that should be read are X, Y, Z axes and temperature.
  • If register example is selected also waits for interrupt to indicate that data is ready to read. Then reads X, Y, Z axes, temperature, and ADC data.
Author
Luka Filipovic

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 )