lightranger7 2.1.0.0
main.c File Reference

LightRanger 7 Click Example. More...

#include "board.h"
#include "log.h"
#include "lightranger7.h"

Macros

#define PROCESS_BUFFER_SIZE   200
 

Functions

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

Detailed Description

LightRanger 7 Click Example.

Description

This example demonstrates the use of LightRanger 7 click board by processing the incoming data and displaying them on the USB UART.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration.

Application Task

Reads and processes all incoming data and displays them on the USB UART.

Note
By default, the click board is programmed with the AFBR_S50_Example_RA4M2 firmware. At the beginning this FW returns API version, chip ID, and module version. After that it starts the measurements and prints the recent measurement results that consists of:
  1. Time stamp in seconds since the last MCU reset.
  2. Range in mm (converting the Q9.22 value to mm).
  3. Amplitude in LSB (converting the UQ12.4 value to LSB).
  4. Signal Quality in % (100% = good signal).
  5. Status (0: OK; < 0: Error; > 0: Warning. For more information refer to the AFBR-S50 GitHub repository: https://github.com/Broadcom/AFBR-S50-API

Additional Function

  • static void lightranger7_clear_app_buf ( void )
  • static err_t lightranger7_process ( lightranger7_t *ctx )
Author
Stefan Filipovic

Macro Definition Documentation

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

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 )