usbcsource 2.0.0.0
main.c File Reference

USBCSource Click example. More...

#include "board.h"
#include "log.h"
#include "usbcsource.h"

Functions

void display_port_status (void)
 USB-C Source display port status.
 
void display_monitoring_status (void)
 USB-C Source display monitoring status.
 
void display_connection_status (void)
 USB-C Source display connection status.
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

port_status_t port_status
 
monitor_status_t monitor_status
 
connection_status_t conn_status
 
pdo_config_t pdo_data
 

Detailed Description

USBCSource Click example.

Description

This is an example that demonstrates the use of the USB-C Source Click board.

The demo application is composed of two sections :

Application Init

Initialization driver enables - I2C, set hardware reset and default configuration and display configuration of the five PDOs, also write log.

Application Task

In this example, we show port status, monitoring, and connections. All data logs write on USB uart changes every 5 sec.

Additional Functions :

  • void display_port_status ( ) - Display port status info.
  • void display_monitoring_status ( ) - Display monitoring status info.
  • void display_connection_status ( ) - Display connection status info.
Author
Stefan Ilic

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 )

◆ display_connection_status()

void display_connection_status ( void )

USB-C Source display connection status.

This function is used for displaying connection status.

◆ display_monitoring_status()

void display_monitoring_status ( void )

USB-C Source display monitoring status.

This function is used for displaying monitoring status.

◆ display_port_status()

void display_port_status ( void )

USB-C Source display port status.

This function is used for displaying port status.

◆ main()

int main ( void )

Variable Documentation

◆ conn_status

connection_status_t conn_status

◆ monitor_status

monitor_status_t monitor_status

◆ pdo_data

pdo_config_t pdo_data

◆ port_status

port_status_t port_status