sparkfun Power Delivery Board - USB-C (Qwiic) Hook-Up Manual page 12

Table of Contents

Advertisement

2/25/2020
SparkFun has written a library to control the Power Delivery board for the STUSB4500. You can obtain this library
through the Arduino Library Manager. By searching for STUSB4500, you should see one written by SparkFun
Electronics and you should be able to install the latest version. If you prefer downloading libraries manually, you
can grab them from the GitHub Repository.
DOWNLOAD THE SPARKFUN POWER DELIVERY BOARD - USB-C ARDUINO LIBRARY (ZIP)
Functions
The library has a ton of functions available for reading each of the NVM parameters for the Power Delivery board.
Below is a list of the functions available along with a description of what each function does and how to use it.
uint8_t begin( uint8_t deviceAddress, TwoWire &wirePort ) - Call at the beginning of the sketch to
initialize the device. This function takes two optional parameters: deviceAddress and wirePort. This function
will return true when the device is intialized, and false if it is unable to communicate with the device.
wirePort - By default, the library uses the standard Wire bus, but if your board has multiple I2C
buses, you can define Wire1 here.
deviceAddress - If both of the address jumpers on the back of the board are closed, this parameter
does not need to be provided. Otherwise, you can use the table below to get the I C address of the
Power Delivery Board.
void read( void ) - This function reads the NVM parameters and loads them into memory. This function is
called in the begin() function, and shouldn't need to be called in your program.
void write( uint8_t defaultVals ) - This function writes the NVM parameters to the STUSB4500. After all of
the parameters have been changed, calling this function will save the parameters to the device. This
function takes an optional argument of DEFAULT . When DEFAULT is passed to the write function, the
default NVM parameters are written to the device.
float getVoltage( uint8_t pdo_numb ) - Returns the voltage requested for the PDO number (1-3).
float getCurrent( uint8_t pdo_numb ) - Returns the current requested for the PDO number (1-3).
uint8_t getLowerVoltageLimit( uint8_t pdo_numb ) - Returns the under voltage lockout parameter for the
PDO number (1-3). PDO1 has a fixed value that cannot be changed and will always return 0. The under
voltage limit is fixed at 3.3V. PDO2 and PDO3 will return a value between 5% and 20%.
https://learn.sparkfun.com/tutorials/power-delivery-board---usb-c-qwiic-hookup-guide?_ga=2.178703713.438471343.1582643437-1178948360.158...
Power Delivery Board - USB-C (Qwiic) Hookup Guide - learn.sparkfun.com
ADDR0 ADDR1 Device Address
Closed
Closed
Open
Closed
Closed
Open
Open
Open
0x28 (default)
0x29
0x2A
0x2B
2
12/23

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Power Delivery Board - USB-C (Qwiic) and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Dev-15801

Table of Contents