usbcsink3 2.1.0.0
main.c File Reference

USB-C Sink 3 Click example. More...

#include "board.h"
#include "log.h"
#include "usbcsink3.h"

Functions

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

Detailed Description

USB-C Sink 3 Click example.

Description

This example demonstrates the use of USB-C Sink 3 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 SPI, I2C and ADC modules and log UART. After driver initialization the app set default settings: Voltage Selection: 5 [V] and Power: 15.0 [W].

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. It interprets power input requirements (voltage/current and maximum power) from the TCD. The example uses two configurations:

  • Voltage 5 [V] and Power 15.0 [W]
  • Voltage 9 [V] and Power 18.0 [W] Results are being sent to the Usart Terminal where you can track their changes.
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 )