usbcpower 2.1.0.0
|
API for configuring and manipulating USB-C Power Click driver. More...
Topics | |
USB-C Power Registers List | |
List of registers of USB-C Power Click driver. | |
USB-C Power Registers Settings | |
Settings for registers of USB-C Power Click driver. | |
USB-C Power MikroBUS Map | |
MikroBUS pin mapping of USB-C Power Click driver. | |
Functions | |
void | usbcpower_cfg_setup (usbcpower_cfg_t *cfg) |
USB-C Power configuration object setup function. | |
err_t | usbcpower_init (usbcpower_t *ctx, usbcpower_cfg_t *cfg) |
USB-C Power initialization function. | |
err_t | usbcpower_default_cfg (usbcpower_t *ctx) |
USB-C Power default configuration function. | |
err_t | usbcpower_generic_write (usbcpower_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
USB-C Power I2C writing function. | |
err_t | usbcpower_generic_read (usbcpower_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
USB-C Power I2C reading function. | |
err_t | usbcpower_get_device_mode (usbcpower_t *ctx, uint8_t *device_mode) |
USB-C Power get device mode function. | |
err_t | usbcpower_get_device_capabilities (usbcpower_t *ctx, uint8_t *device_cap) |
USB-C Power get device capabilities function. | |
err_t | usbcpower_device_info (usbcpower_t *ctx, uint8_t *device_info) |
USB-C Power device info function. | |
err_t | usbcpower_set_patch_mode (usbcpower_t *ctx, uint32_t *response) |
USB-C Power set patch mode function. | |
err_t | usbcpower_start_patch_burst_mode (usbcpower_t *ctx, usbcpower_pbms_cfg_t pbms_cfg, uint32_t *response) |
USB-C Power starts the patch burst mode function. | |
err_t | usbcpower_complete_patch_burst_mode (usbcpower_t *ctx, uint32_t *response) |
USB-C Power complete the patch burst mode function. | |
err_t | usbcpower_exit_patch_burst_mode (usbcpower_t *ctx, uint32_t *response) |
USB-C Power exit the patch burst mode function. | |
err_t | usbcpower_get_selected_mode (usbcpower_t *ctx, uint8_t *sel_mode) |
USB-C Power gets selected mode function. | |
err_t | usbcpower_update_patch_bundle (usbcpower_t *ctx, usbcpower_pbms_cfg_t pbms_cfg) |
USB-C Power update patch bundle function. | |
err_t | usbcpower_get_status (usbcpower_t *ctx, usbcpower_status_t *status) |
USB-C Power gets status function. | |
err_t | usbcpower_get_pwr_path_status (usbcpower_t *ctx, usbcpower_pwr_path_status_t *pp_status) |
USB-C Power gets power path status function. | |
err_t | usbcpower_get_boot_status (usbcpower_t *ctx, usbcpower_boot_status_t *boot_status) |
USB-C Power gets boot status function. | |
err_t | usbcpower_get_rx_caps (usbcpower_t *ctx, usbcpower_rx_caps_t *rx_caps) |
USB-C Power gets RX caps function. | |
err_t | usbcpower_get_pwr_status (usbcpower_t *ctx, usbcpower_pwr_status_t *pwr_status) |
USB-C Power gets PWR status function. | |
err_t | usbcpower_get_pd_status (usbcpower_t *ctx, usbcpower_pd_status_t *pd_status) |
USB-C Power gets PD status function. | |
uint8_t | usbcpower_get_int_pin (usbcpower_t *ctx) |
USB-C Power gets interrupt function. | |
API for configuring and manipulating USB-C Power Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void usbcpower_cfg_setup | ( | usbcpower_cfg_t * | cfg | ) |
USB-C Power configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See usbcpower_cfg_t object definition for detailed explanation. |
err_t usbcpower_complete_patch_burst_mode | ( | usbcpower_t * | ctx, |
uint32_t * | response ) |
USB-C Power complete the patch burst mode function.
This function ends the patch loading sequence of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | response | : Response code. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_default_cfg | ( | usbcpower_t * | ctx | ) |
USB-C Power default configuration function.
This function executes a default configuration of USB-C Power click board.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_device_info | ( | usbcpower_t * | ctx, |
uint8_t * | device_info ) |
USB-C Power device info function.
This function reads a ASCII string with hardware and firmware version information of the PD Controller of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | device_info | : Device information. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_exit_patch_burst_mode | ( | usbcpower_t * | ctx, |
uint32_t * | response ) |
USB-C Power exit the patch burst mode function.
This function ends the patch loading sequence of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | response | : Response code. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_generic_read | ( | usbcpower_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
USB-C Power I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_generic_write | ( | usbcpower_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
USB-C Power I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_boot_status | ( | usbcpower_t * | ctx, |
usbcpower_boot_status_t * | boot_status ) |
USB-C Power gets boot status function.
This function reads a boot status of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | boot_status | : Boot status object. See usbcpower_boot_status_t definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_device_capabilities | ( | usbcpower_t * | ctx, |
uint8_t * | device_cap ) |
USB-C Power get device capabilities function.
This function reads a device capabilities value of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | device_cap | : Device capabilities. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_device_mode | ( | usbcpower_t * | ctx, |
uint8_t * | device_mode ) |
USB-C Power get device mode function.
This function reads a device information value of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | device_mode | : Device mode string. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t usbcpower_get_int_pin | ( | usbcpower_t * | ctx | ) |
USB-C Power gets interrupt function.
This function get states of the Interrupt ( INT ) pin of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. See #err_t definition for detailed explanation. err_t usbcpower_get_pd_status | ( | usbcpower_t * | ctx, |
usbcpower_pd_status_t * | pd_status ) |
USB-C Power gets PD status function.
This function reads a power status of PD and Type-C state-machine of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | pd_status | : Source and sink capabilities object. See usbcpower_pd_status_t definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_pwr_path_status | ( | usbcpower_t * | ctx, |
usbcpower_pwr_path_status_t * | pp_status ) |
USB-C Power gets power path status function.
This function reads a power path status of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | pp_status | : Power path status object. See usbcpower_pwr_path_status_t definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_pwr_status | ( | usbcpower_t * | ctx, |
usbcpower_pwr_status_t * | pwr_status ) |
USB-C Power gets PWR status function.
This function reads a power of the connection status info of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | pwr_status | : Power of the connection status object. See usbcpower_pwr_status_t definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_rx_caps | ( | usbcpower_t * | ctx, |
usbcpower_rx_caps_t * | rx_caps ) |
USB-C Power gets RX caps function.
This function reads a source and sink capabilities of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | rx_caps | : Source and sink capabilities object. See usbcpower_rx_caps_t definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_selected_mode | ( | usbcpower_t * | ctx, |
uint8_t * | sel_mode ) |
USB-C Power gets selected mode function.
This function reads application operation mode of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | sel_mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_get_status | ( | usbcpower_t * | ctx, |
usbcpower_status_t * | status ) |
USB-C Power gets status function.
This function reads a status information of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | status | : Status information object. See usbcpower_status_t definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_init | ( | usbcpower_t * | ctx, |
usbcpower_cfg_t * | cfg ) |
USB-C Power initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See usbcpower_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_set_patch_mode | ( | usbcpower_t * | ctx, |
uint32_t * | response ) |
USB-C Power set patch mode function.
This function set the patch mode, forces PD controller to return to 'PTCH' mode and wait for patch over I2C of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[out] | response | : Response code. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_start_patch_burst_mode | ( | usbcpower_t * | ctx, |
usbcpower_pbms_cfg_t | pbms_cfg, | ||
uint32_t * | response ) |
USB-C Power starts the patch burst mode function.
This function write sequence for loading a patch bundle in burst mode to the PD controller from an external host over I2C of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[in] | pbms_cfg | : The 'PBMs' task configuration object. See usbcpower_pbms_cfg_t definition for detailed explanation. |
[out] | response | : Response code. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcpower_update_patch_bundle | ( | usbcpower_t * | ctx, |
usbcpower_pbms_cfg_t | pbms_cfg ) |
USB-C Power update patch bundle function.
This function writes the entire patch-bundle data in a single I2C transaction of the TPS25750 USB Type-C® and USB PD Controller with Integrated Power Switches Optimized for Power Applications on the USB-C Power Click board™.
[in] | ctx | : Click context object. See usbcpower_t object definition for detailed explanation. |
[in] | pbms_cfg | : The 'PBMs' task configuration object. See usbcpower_pbms_cfg_t definition for detailed explanation. |
[out] | response | : Response code. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.