usbcsink2 2.1.0.0
|
API for configuring and manipulating USB-C Sink 2 Click driver. More...
Topics | |
USB-C Sink 2 Registers List | |
List of registers of USB-C Sink 2 Click driver. | |
USB-C Sink 2 Registers Settings | |
Settings for registers of USB-C Sink 2 Click driver. | |
USB-C Sink 2 MikroBUS Map | |
MikroBUS pin mapping of USB-C Sink 2 Click driver. | |
Functions | |
void | usbcsink2_cfg_setup (usbcsink2_cfg_t *cfg) |
USB-C Sink 2 configuration object setup function. | |
err_t | usbcsink2_init (usbcsink2_t *ctx, usbcsink2_cfg_t *cfg) |
USB-C Sink 2 initialization function. | |
err_t | usbcsink2_default_cfg (usbcsink2_t *ctx) |
USB-C Sink 2 default configuration function. | |
err_t | usbcsink2_generic_write (usbcsink2_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len) |
USB-C Sink 2 data writing function. | |
err_t | usbcsink2_generic_read (usbcsink2_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t len) |
USB-C Sink 2 data reading function. | |
err_t | usbcsink2_read_raw_adc (usbcsink2_t *ctx, uint16_t *raw_adc) |
USB-C Sink 2 read raw ADC value function. | |
err_t | usbcsink2_read_voltage (usbcsink2_t *ctx, float *voltage) |
USB-C Sink 2 read voltage level function. | |
err_t | usbcsink2_set_vref (usbcsink2_t *ctx, float vref) |
USB-C Sink 2 set vref function. | |
err_t | usbcsink2_read_pdo (usbcsink2_t *ctx, uint8_t *pdo) |
USB-C Sink 2 PDO data reading function. | |
err_t | usbcsink2_get_pdo_num (usbcsink2_t *ctx, uint8_t *pdo_num) |
USB-C Sink 2 PDO number reading function. | |
err_t | usbcsink2_read_status (usbcsink2_t *ctx, uint8_t *status) |
USB-C Sink 2 status reading function. | |
err_t | usbcsink2_wait_rdo_req_success (usbcsink2_t *ctx) |
USB-C Sink 2 wait RDO request function. | |
err_t | usbcsink2_get_pdo_voltage (usbcsink2_t *ctx, float *voltage_mv) |
USB-C Sink 2 get the voltage function. | |
err_t | usbcsink2_get_pdo_current (usbcsink2_t *ctx, float *current_ma) |
USB-C Sink 2 get the current function. | |
err_t | usbcsink2_get_temperature (usbcsink2_t *ctx, uint8_t *temperature) |
USB-C Sink 2 get the temperature function. | |
err_t | usbcsink2_write_rdo (usbcsink2_t *ctx, uint8_t *rdo) |
USB-C Sink 2 write the RDO function. | |
err_t | usbcsink2_reset (usbcsink2_t *ctx) |
USB-C Sink 2 hard reset the RDO function. | |
uint8_t | usbcsink2_get_interrupt (usbcsink2_t *ctx) |
USB-C Sink 2 get interrupt function. | |
API for configuring and manipulating USB-C Sink 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void usbcsink2_cfg_setup | ( | usbcsink2_cfg_t * | cfg | ) |
USB-C Sink 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See usbcsink2_cfg_t object definition for detailed explanation. |
err_t usbcsink2_default_cfg | ( | usbcsink2_t * | ctx | ) |
USB-C Sink 2 default configuration function.
This function executes a default configuration of USB-C Sink 2 click board.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_generic_read | ( | usbcsink2_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
USB-C Sink 2 data reading function.
This function reads a desired number of data bytes using desired command of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[in] | cmd | : Desired command. |
[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 usbcsink2_generic_write | ( | usbcsink2_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
USB-C Sink 2 data writing function.
This function writes a desired number of data bytes starting using desired command of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[in] | cmd | : Desired command. |
[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. uint8_t usbcsink2_get_interrupt | ( | usbcsink2_t * | ctx | ) |
USB-C Sink 2 get interrupt function.
This function get states of the Interrupt ( INT ) pin of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. See #err_t definition for detailed explanation. err_t usbcsink2_get_pdo_current | ( | usbcsink2_t * | ctx, |
float * | current_ma ) |
USB-C Sink 2 get the current function.
This function reads the PDO current measured of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | voltage_mv | : Current [mA]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_get_pdo_num | ( | usbcsink2_t * | ctx, |
uint8_t * | pdo_num ) |
USB-C Sink 2 PDO number reading function.
This function reads the total number of valid PDOs of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | pdo_num | : Total number of valid PDOs. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_get_pdo_voltage | ( | usbcsink2_t * | ctx, |
float * | voltage_mv ) |
USB-C Sink 2 get the voltage function.
This function reads the PDO voltage measured of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | voltage_mv | : Voltage [mV]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_get_temperature | ( | usbcsink2_t * | ctx, |
uint8_t * | temperature ) |
USB-C Sink 2 get the temperature function.
This function reads the temperature of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | temperature | : Temperature [degree Celsius]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_init | ( | usbcsink2_t * | ctx, |
usbcsink2_cfg_t * | cfg ) |
USB-C Sink 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See usbcsink2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_read_pdo | ( | usbcsink2_t * | ctx, |
uint8_t * | pdo ) |
USB-C Sink 2 PDO data reading function.
This function reads a source power delivery data of 28 bytes and used to expose PD Source (SRC) power capabilities of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | pdo | : Source Power Data Object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_read_raw_adc | ( | usbcsink2_t * | ctx, |
uint16_t * | raw_adc ) |
USB-C Sink 2 read raw ADC value function.
This function reads raw ADC value.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | raw_adc | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_read_status | ( | usbcsink2_t * | ctx, |
uint8_t * | status ) |
USB-C Sink 2 status reading function.
This function reads the status data to reports the Sink Controller’s of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | status | : Status data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_read_voltage | ( | usbcsink2_t * | ctx, |
float * | voltage ) |
USB-C Sink 2 read voltage level function.
This function reads raw ADC value and converts it to proportional voltage level.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | voltage | : Output voltage level [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_reset | ( | usbcsink2_t * | ctx | ) |
USB-C Sink 2 hard reset the RDO function.
This function is used to reset by writing RDO register with all-zero data of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | rdo | : Request Data Object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_set_vref | ( | usbcsink2_t * | ctx, |
float | vref ) |
USB-C Sink 2 set vref function.
This function sets the voltage reference for USB-C Sink 2 click driver.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[in] | vref | : Reference voltage (volts). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_wait_rdo_req_success | ( | usbcsink2_t * | ctx | ) |
USB-C Sink 2 wait RDO request function.
This function waith a successful RDO request of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | status | : Status data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t usbcsink2_write_rdo | ( | usbcsink2_t * | ctx, |
uint8_t * | rdo ) |
USB-C Sink 2 write the RDO function.
This function PDO request negotiation procedure, 4-byte data is written to RDO (Request Data Object) of the AP33772, High-Performance USB PD Sink Controller on the USB-C Sink 2 click board™.
[in] | ctx | : Click context object. See usbcsink2_t object definition for detailed explanation. |
[out] | rdo | : Request Data Object. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.