We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2021-01-29
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: USB-C PD
Downloaded: 2009 times
Not followed.
License: MIT license
USB-C Source Click is a compact add-on board that contains a standalone autonomous USB power delivery controller. This board features the STUSB4700, an independent USB power delivery controller optimized as a provider to negotiate a given amount of power to be sourced to an inquiring consumer device from STMicroelectronics.
Do you want to subscribe in order to receive notifications regarding "USB-C Source click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "USB-C Source click" changes.
Do you want to report abuse regarding "USB-C Source click".
Library Description
The library covers all the necessary functions to control USB-C Source Click board™. A library performs the communication with the device via I2C interface.
Key functions:
void usbcsource_default_config ( void )
- Default configuration function.uint8_t usbcsource_get_pdo_config ( uint8_t pdo_numb, pdo_config_t *pdo_cfg_data )
- Get PDO configuration function.void usbcsource_get_port_status ( port_status_t *port_status_data )
- Get port status function.Examples description
The application is composed of three sections :
void application_task ( )
{
usbcsource_get_port_status( &port_status );
display_port_status( );
Delay_ms( 100 );
mikrobus_logWrite( "- - - - - - - - - - - - - -", _LOG_TEXT );
mikrobus_logWrite( "- - - - - - - - - - - - - -", _LOG_LINE );
usbcsource_get_monitoring_status( &monitor_status );
display_monitoring_status( );
Delay_ms( 100 );
mikrobus_logWrite( "- - - - - - - - - - - - - -", _LOG_TEXT );
mikrobus_logWrite( "- - - - - - - - - - - - - -", _LOG_LINE );
usbcsource_get_connection_status( &conn_status );
display_connection_status( );
Delay_ms( 100 );
mikrobus_logWrite( "---------------------------", _LOG_TEXT );
mikrobus_logWrite( "---------------------------", _LOG_LINE );
Delay_ms( 5000 );
}
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.Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.