cdc 2.1.0.0
main.c File Reference

CDC Click example. More...

#include "board.h"
#include "log.h"
#include "cdc.h"

Macros

#define CDC_EXT_CAP_C1_C0_PF   0.0f
 
#define CDC_INT_CAP_PF   10.0f
 
#define CDC_REF   ( CDC_EXT_CAP_C1_C0_PF + CDC_INT_CAP_PF )
 

Functions

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

Detailed Description

CDC Click example.

Description

This example demonstrates the use of CDC click board by reading capacitance measurements from C3/C2 and C5/C4 ports calculated from pure capacitance ratio between those ports and port C1/C0 which is used as external C reference.

The demo application is composed of two sections :

Application Init

Initializes the driver and performs the click default configuration.

Application Task

Starts measurement and reads the results. The results data is displayed on the USB UART.

Note
For better accuracy and higher measurement range, add 200pF external capacitor between C1/C0 ports and set it below as CDC_EXT_CAP_C1_C0_PF macro before running the application. This way you will be able to measure capacitance in range from 1 to 2000pF.
Author
Stefan Filipovic

Macro Definition Documentation

◆ CDC_EXT_CAP_C1_C0_PF

#define CDC_EXT_CAP_C1_C0_PF   0.0f

◆ CDC_INT_CAP_PF

#define CDC_INT_CAP_PF   10.0f

◆ CDC_REF

#define CDC_REF   ( CDC_EXT_CAP_C1_C0_PF + CDC_INT_CAP_PF )

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 )