Data Structures | |
| struct | hpm_pmbus_cfg_t |
Functions | |
| static hpm_pmbus_cfg_t * | hpm_pmbus_get_cfg_obj (I2C_Type *ptr) |
| static uint8_t | hpm_smbus_pec_crc8_in_command (uint8_t slave_addr, uint8_t command, uint8_t *data, uint32_t len, bool read, bool block) |
| void | hpm_pmbus_isr_handler (I2C_Type *ptr) |
| Handles the HPM PMBUS interrupt service request. More... | |
| hpm_stat_t | hpm_pmbus_slave_init (I2C_Type *ptr, uint8_t slave_addr) |
| PMBus Slave Initialization. More... | |
| hpm_stat_t | hpm_pmbus_master_read (I2C_Type *ptr, uint8_t slave_address, uint8_t command, uint8_t *data, uint32_t *len) |
| Reads data from a PMBus slave device. More... | |
| hpm_stat_t | hpm_pmbus_master_write (I2C_Type *ptr, uint8_t slave_address, uint8_t command, uint8_t *data, uint32_t len) |
| Writes data to a PMBus slave device. More... | |
| hpm_stat_t | hpm_pmbus_slave_command_transaction_install (I2C_Type *ptr, uint8_t command, uint8_t *wdata, uint8_t *rdata, uint32_t len, hpm_pmbus_complete_cb_t callback) |
| Installs a PMBus Slave Command Transaction. More... | |
| hpm_stat_t | hpm_pmbus_slave_command_transaction_uninstall (I2C_Type *ptr, uint8_t command) |
| Uninstalls a specified PMBus slave command transaction. More... | |
Variables | |
| const hpm_pmbus_cmd_param_t | pmbus_cmd_param_table [] |
| static hpm_pmbus_cfg_t | hpm_pmbus_cfg_table [] |
|
static |
| void hpm_pmbus_isr_handler | ( | I2C_Type * | ptr | ) |
Handles the HPM PMBUS interrupt service request.
This function serves as an interrupt service routine (ISR) handler for communication with PMBUS devices over I2C.
| ptr | A pointer to the I2C |
| hpm_stat_t hpm_pmbus_master_read | ( | I2C_Type * | ptr, |
| uint8_t | slave_address, | ||
| uint8_t | command, | ||
| uint8_t * | data, | ||
| uint32_t * | len | ||
| ) |
Reads data from a PMBus slave device.
This function reads data from a specified PMBus slave device over the I2C bus. It first sends a command and then reads the response data. Primarily used for communication with PMBus-compatible power management devices to retrieve device status or measurement data.
| ptr | Pointer to the base address of the I2C controller |
| slave_address | The 7-bit PMBus address of the slave device, used to select the correct slave device |
| command | The PMBus command sent to the slave device, specifying the type of data or register to read |
| data | Pointer to store the data returned from the slave device; this function will store the read data into the buffer pointed to by this pointer |
| len | Pointer to a variable that specifies the maximum read length; this function will write the actual read length into this variable |
| hpm_stat_t hpm_pmbus_master_write | ( | I2C_Type * | ptr, |
| uint8_t | slave_address, | ||
| uint8_t | command, | ||
| uint8_t * | data, | ||
| uint32_t | len | ||
| ) |
Writes data to a PMBus slave device.
function is used to send commands and data to a slave device over the I2C interface. It is primarily intended for communication with PMBus-compatible devices, allowing the host to send instructions and data to PMBus-compatible devices.
| ptr | Pointer to the base address of the I2C controller |
| slave_address | The 7-bit address of the slave device, used to address the slave device on the I2C bus |
| command | The command or register address to be sent to the slave device |
| data | Pointer to the data to be written to the slave device; the data will be written in order |
| len | The length of the data to be written, in bytes |
Note: Before using this function, ensure that the I2C controller has been properly initialized, and the clock and interrupts (if needed) have also been configured.
| hpm_stat_t hpm_pmbus_slave_command_transaction_install | ( | I2C_Type * | ptr, |
| uint8_t | command, | ||
| uint8_t * | wdata, | ||
| uint8_t * | rdata, | ||
| uint32_t | len, | ||
| hpm_pmbus_complete_cb_t | callback | ||
| ) |
Installs a PMBus Slave Command Transaction.
This function installs a PMBus slave command transaction for writing and reading data. The command is for the master, such as the read command, which is read for the master and write for the slave
| ptr | Pointer to the base address of the I2C |
| command | PMBus command byte specifying the PMBus command to be sen |
| wdata | Pointer to the data to be written, containing the data to write to the slave |
| rdata | Pointer to the buffer where the data read from the slave will be stored |
| len | Length of the data to be transferred, in bytes |
| callback | Pointer to the completion callback function that will be called when the transaction completes |
| hpm_stat_t hpm_pmbus_slave_command_transaction_uninstall | ( | I2C_Type * | ptr, |
| uint8_t | command | ||
| ) |
Uninstalls a specified PMBus slave command transaction.
This function is used to uninstall a PMBus slave command transaction to reduce unnecessary resource usage. In certain cases, if a specific slave command transaction is no longer needed, it can be uninstalled using this function to free up related resources.
| ptr | Pointer to the I2C |
| command | The PMBus command to uninstall. This parameter specifies the exact command to be uninstalled. |
| hpm_stat_t hpm_pmbus_slave_init | ( | I2C_Type * | ptr, |
| uint8_t | slave_addr | ||
| ) |
PMBus Slave Initialization.
This function initializes an I2C slave device to respond to a specific slave address and communicate according to the PMBus protocol.
| ptr | Pointer to the base address of the I2C, pointing to the I2C slave device to be initialized |
| slave_addr | Address of the slave device, used to identify the specific slave on the I2C bus |
|
static |
|
static |
|
extern |