usbcsink2 2.1.0.0
main.c File Reference

USB-C Sink 2 Click Example. More...

#include "board.h"
#include "log.h"
#include "usbcsink2.h"

Functions

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

Detailed Description

USB-C Sink 2 Click Example.

Description

This example demonstrates the use of the USB-C Sink 2 Click boardâ„¢ by setting DC power requests and control for Type-C connector-equipped devices (TCD).

The demo application is composed of two sections :

Application Init

Initializes I2C and ADC modules and log UART. After driver initialization the app set default settings.

Application Task

In this example, the app configures Power Data Objects (PDO) highest priority profile and requests power from a standard USB PD source adapter. After connecting the PD source and USB-C Sink 2 Click with the Type-C cable, the app gets the total number of valid PDO's and switches all PDO configurations every 10 seconds. When the PD source accepts the request, the app displays information about VOUT Voltage [mV] and Current [mA] and the temperature [degree Celsius] of the USB-C connector.

Note
FAULT LED flickering notified of the system status:
  • Charging: Breathing light (2 sec dimming), 1 cycle is 4 sec.
  • Fully charged: Continuously lit Charging current < 500mA.
  • Mismatch: 1s flicker Voltage or power mismatch. Non-PD power source, 1 cycle is 2sec.
  • Fault: 300ms flicker OVP, 1 cycle is 600ms.
Author
Nenad 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 )