TOP Contributors

  1. MIKROE (2649 codes)
  2. Alcides Ramos (350 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136492 times)
  2. FAT32 Library (69704 times)
  3. Network Ethernet Library (55813 times)
  4. USB Device Library (46150 times)
  5. Network WiFi Library (41791 times)
  6. FT800 Library (40971 times)
  7. GSM click (28918 times)
  8. PID Library (26377 times)
  9. mikroSDK (26260 times)
  10. microSD click (25290 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

USB-C Source click

Rating:

5

Author: MIKROE

Last Updated: 2021-01-29

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: USB-C PD

Downloaded: 1451 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

USB-C Source Click

USB-C Source Click

Native view of the USB-C Source Click board.

View full image
USB-C Source Click

USB-C Source Click

Front and back view of the USB-C Source Click board.

View full image

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 :

  • System Initialization - Initializes I2C and start to write log.
  • Application Initialization - Initialization driver enables - I2C, set hardware reset and default configuration and display configuration of the five PDOs, also write log.
  • Application Task - (code snippet) This is an example that demonstrates the use of the USB-C Source Click board™. In this example, we show port status, monitoring, and connections. All data logs write on USB uart changes every 5 sec.
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:

  • I2C
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

DAC 3 click

0

DAC3 click carries Microchip’s MCP4726 IC, a 12-bit digital-to-analog converter, along with voltage output screw terminals. The digital value is converted to the appropriate voltage level in the range between GND and REFERENCE (VCC or 4.096V), which is proportional to the received 12-bit number.

[Learn More]

Power/Reset click

0

Power/Reset Click is equipped with two capacitive touch pads on a single click board™.

[Learn More]

GNSS 12 click

0

GNSS 12 Click is a compact add-on board that provides fast positioning capability. This board features the CAM-M8C, a professional-grade GNSS module built on the high-performing M8 GNSS engine from u-blox. This module utilizes concurrent reception of up to three GNSS systems (GPS/Galileo together with either BeiDou or GLONASS), offering high sensitivity and strong signal levels. Besides internal, the CAM-M8C can use an optional external active antenna. It has a configurable host interface, advanced jamming/spoofing detection, and provides outstanding positioning accuracy even in GNSS-hostile environments.

[Learn More]