TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139563 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57254 times)
  4. USB Device Library (47615 times)
  5. Network WiFi Library (43219 times)
  6. FT800 Library (42556 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26930 times)
  10. microSD click (26309 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 Power Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.7

mikroSDK Library: 2.0.0.0

Category: USB-C PD

Downloaded: 143 times

Not followed.

License: MIT license  

USB-C Power Click is a compact add-on board that provides a quick and easy way to supply power without carrying multiple adapters or cables. This board features the TPS25750S, a highly integrated USB Type-C and Power Delivery (PD) controller with integrated power switches optimized for power applications from Texas Instruments. The TPS25750S integrates fully managed power paths (5V/3A with 36mΩ sourcing switch) with robust protection (reverse and inrush current as well as over/under voltage protection) and control for external battery charger IC for a complete USB-C PD solution. Besides web-based GUI and pre-configured firmware, the TPS25750S also has some GPIOs and LED indicators that are user-defined for either status or control information.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "USB-C Power Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "USB-C Power Click" changes.

Do you want to report abuse regarding "USB-C Power Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


USB-C Power Click

USB-C Power Click is a compact add-on board that provides a quick and easy way to supply power without carrying multiple adapters or cables. This board features the TPS25750S, a highly integrated USB Type-C and Power Delivery (PD) controller with integrated power switches optimized for power applications from Texas Instruments. The TPS25750S integrates fully managed power paths (5V/3A with 36mΩ sourcing switch) with robust protection (reverse and inrush current as well as over/under voltage protection) and control for external battery charger IC for a complete USB-C PD solution. Besides web-based GUI and pre-configured firmware, the TPS25750S also has some GPIOs and LED indicators that are user-defined for either status or control information.

usbcpower_click.png

Click Product page


Click library

  • Author : Nenad Filipovic
  • Date : Mar 2023.
  • Type : I2C type

Software Support

We provide a library for the USB-C Power Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for USB-C Power Click driver.

Standard key functions :

  • usbcpower_cfg_setup Config Object Initialization function.

    void usbcpower_cfg_setup ( usbcpower_cfg_t *cfg );
  • usbcpower_init Initialization function.

    err_t usbcpower_init ( usbcpower_t *ctx, usbcpower_cfg_t *cfg );
  • usbcpower_default_cfg Click Default Configuration function.

    err_t usbcpower_default_cfg ( usbcpower_t *ctx );

Example key functions :

  • usbcpower_get_status USB-C Power gets status function.

    err_t usbcpower_get_status ( usbcpower_t *ctx, usbcpower_status_t *status )
  • usbcpower_get_pwr_status USB-C Power gets PWR status function.

    err_t usbcpower_get_pwr_status ( usbcpower_t *ctx, usbcpower_pwr_status_t *pwr_status );
  • usbcpower_start_patch_burst_mode USB-C Power starts the patch burst mode function.

    err_t usbcpower_start_patch_burst_mode ( usbcpower_t *ctx, usbcpower_pbms_cfg_t pbms_cfg, uint32_t *response );

Example Description

This example demonstrates the use of the USB-C Power Click board™ by configuring the PD controller to attempt to become a Power Source.

The demo application is composed of two sections :

Application Init

The initialization of I2C module, log UART, and additional pins. After the driver init, the app executes a default configuration, depending on PD Device Mode, the app performs the patch bundle update tasks for loading a patch bundle in burst mode to the PD controller.

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    usbcpower_cfg_t usbcpower_cfg;  /**< 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 @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, " Application Init " );

    // Click initialization.
    usbcpower_cfg_setup( &usbcpower_cfg );
    USBCPOWER_MAP_MIKROBUS( usbcpower_cfg, MIKROBUS_1 );
    if ( I2C_MASTER_ERROR == usbcpower_init( &usbcpower, &usbcpower_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( USBCPOWER_ERROR == usbcpower_default_cfg ( &usbcpower ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }

    usbcpower_set_patch_mode( &usbcpower, &response );
    if ( USBCPOWER_RSP_OK != response )
    {
        log_error( &logger, " Go to Patch Mode." );
        for ( ; ; );
    }

    uint8_t device_mode[ 6 ] = { 0 };
    usbcpower_get_device_mode( &usbcpower, &device_mode );
    log_printf( &logger, " PD Device Mode: %s\r\n", &device_mode[ 1 ] );
    log_printf( &logger, "-----------------------------\r\n" );
    Delay_ms ( 100 );

    log_info( &logger, " Application Task " );
    log_printf( &logger, "-----------------------------\r\n" );
    Delay_ms ( 100 );
}

Application Task

The application display status information about the PD controller data role and power of the connection. Results are being sent to the UART Terminal, where you can track their changes.

void application_task ( void ) 
{
    if ( USBCPOWER_OK == usbcpower_get_status( &usbcpower, &status ) )
    {
        if ( USBCPOWER_OK == usbcpower_get_pwr_status( &usbcpower, &pwr_status ) )
        {
            usbcpower_display_status( );
            log_printf( &logger, "- - - - - - - - - - - - - - -\r\n" );
            usbcpower_display_pwr_status( );
            log_printf( &logger, "-----------------------------\r\n" );
        }
    }
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
}

Note

For the advanced configuration, use the TPS25750 Application Customization Tool: https://dev.ti.com/gallery/search/TPS25750_Application_Customization_Tool

The full application code, and ready to use projects can be installed directly from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.USBCPower

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

LED Ring 2 Click

0

LED Ring 2 Click is a compact add-on board that provides a circular-shaped electronic lighting solution. This board features three I2C-configurable high-performance LED matrix drivers, the LP5862 from Texas Instruments. The LP5862 integrates 18 constant current sinks for driving 18 yellow LEDs. With the help of two additional LP5862 drivers, it is possible to realize, as shown on this board, a solution of 54 yellow LEDs arranged in a circular pattern. In addition, it also provides excellent PWM dimming effects.

[Learn More]

SolidSwitch Click

0

SolidSwitch Click is a compact add-on board that contains load switch devices. This board features the TPS22918, four single-channel load switches from Texas Instruments.

[Learn More]

Multi Stepper TB67S102 Click

0

Multi Stepper Click is a compact add-on board that contains a bipolar stepper motor driver. This board features the TB67S102AFNG, CLOCK-in controlled bipolar stepping motor driver from Toshiba Semiconductor. It supports a PWM constant-current control drive and allows full-, half-, and quarter-step operation for less motor noise and smoother control. It has a wide operating voltage range of 10V to 47V with an output current capacity of 2.8A in addition to several built-in error detection circuits.

[Learn More]