Functions | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_execute_transfer (mtb_pmbus_ctrl_stc_t *inst, mtb_pmbus_ctrl_stc_transfer_cfg_t *cfg) |
| Execute a generic PMBus transfer. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_quick_cmd (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr) |
| Execute SMBus Quick Command protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_received_byte (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint8_t *data, bool pec) |
| Execute SMBus Receive Byte protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_send_byte (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint8_t *data, bool pec) |
| Execute SMBus Send Byte protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_write_byte (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Write Byte protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_read_byte (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Read Byte protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_write_word (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Write Word protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_read_word (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Read Word protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_process_call (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Process Call protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_block_write (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, uint32_t size, bool pec) |
| Execute SMBus Block Write protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_block_read (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, uint32_t *size, bool pec) |
| Execute SMBus Block Read protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_block_process_call (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, uint32_t size_wr, uint32_t *size, bool pec) |
| Execute SMBus Block Write-Block Read Process Call protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_write_32 (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Write 32 protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_write_64 (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Write 64 protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_read_32 (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute SMBus Read 32 protocol. | |
| mtb_pmbus_ctrl_status_t | mtb_pmbus_ctrl_ex_read_64 (mtb_pmbus_ctrl_stc_t *inst, uint8_t addr, uint32_t cmd_code, uint8_t *data, bool pec) |
| Execute PMBus Read 64 protocol. | |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_execute_transfer | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| mtb_pmbus_ctrl_stc_transfer_cfg_t * | cfg ) |
Execute a generic PMBus transfer.
It accepts a transfer configuration structure containing all transfer parameters, allowing the application to construct custom protocol sequences.
The function handles low-level bus operations and the error detection while giving the application full control over:
Transfer behavior based on parameter combinations:
Example: PMBus Group Command Protocol
The Group Command protocol allows sending the same command to multiple devices atomically. This can be achieved by calling this function multiple times with execute_stop set to false for all transfers except the last one. For example, to set VOUT_COMMAND on three devices (0x20, 0x21, 0x22), execute three transfers with only the final transfer generating a STOP condition, and so ensures all devices receive the command and update their outputs simultaneously.
| inst | The pointer to the PMBus controller instance structure |
| cfg | The pointer to the transfer configuration structure (mtb_pmbus_ctrl_stc_transfer_cfg_t) |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_quick_cmd | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr ) |
Execute SMBus Quick Command protocol.
This function performs the SMBus Quick Command Protocol, which sends only the write-direction bit of the target device address write-direction bit.
The function constructs a complete transaction packet including:
Transaction format:
Where: S=Start, P=Stop, A=ACK, W=Write bit
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the W bit. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_received_byte | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Receive Byte protocol.
This function performs the SMBus Receive Byte protocol, which reads a single byte of data from the target device.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, P=Stop, A=ACK, N=NACK, R=Read bit
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| data | The pointer to a 1-byte buffer to store received data. Must point to valid memory with at least 1 byte. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_send_byte | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Send Byte protocol.
This function performs the SMBus Send Byte protocol, which sends a single byte of data to the target device.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, P=Stop, A=ACK, W=Write bit
| inst | The pointer to the PMBus controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| data | The pointer to a 1-byte data value to send. Must point to valid memory with at least 1 byte. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and transmission. When enabled, adds CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_write_byte | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Write Byte protocol.
This function performs the SMBus Write Byte protocol, which sends a command code followed by 1 byte of data to the target device.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, P=Stop, A=ACK, W=Write bit
| inst | The pointer to the PMBus controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to a 1-byte data value to write. Must point to valid memory with at least 1 byte. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and transmission. When enabled, adds CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_read_byte | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Read Byte protocol.
This function performs the SMBus Read Byte protocol, which sends a command code to the target device and then reads 1 byte of data from it.
The function constructs the complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, Sr=Repeated Start, P=Stop, A=ACK, N=NACK, W=Write bit, R=Read bit
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | Pointer to a 1-byte buffer to store the read data. Must point to valid memory with at least 1 byte. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_write_word | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Write Word protocol.
This function performs the SMBus Write Word protocol, which sends a command code followed by 2 bytes of data to the target device.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, P=Stop, A=ACK, W=Write bit
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to a 2-byte array containing the data to write. Must point to valid memory with at least 2 bytes. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and transmission. When enabled, adds CRC-8 checksum for the error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_read_word | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Read Word protocol.
This function performs the SMBus Read Word protocol, which sends a command code to the target device and then reads 2 bytes of data from it.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, Sr=Repeated Start, P=Stop, A=ACK, N=NACK, W=Write bit, R=Read bit
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to a 2-byte buffer to store read data. Must point to valid memory with at least 2 bytes. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_process_call | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Process Call protocol.
This function performs a SMBus Process Call protocol, which sends a command code followed by 2 bytes of data to a target device, and then reads 2 bytes of data back. This is a combined write-read operation in a single transaction.
The function constructs the complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, Sr=Repeated Start, P=Stop, A=ACK, N=NACK, W=Write bit, R=Read bit
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to the 4-byte buffer. The first 2 bytes contain data to send, and the last 2 bytes will be overwritten with the received data. Must point to valid memory with at least 4 bytes. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for error detection on the read part only. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_block_write | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| uint32_t | size, | ||
| bool | pec ) |
Execute SMBus Block Write protocol.
This function performs the SMBus Block Write protocol, which sends a command code followed by a byte count and a variable number of data bytes to a target device.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, P=Stop, A=ACK, W=Write bit, N=Number of data bytes (1-255)
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to the data buffer containing bytes to write. Must point to valid memory with at least 'size' bytes. |
| size | Number of bytes to write (0 to 255 bytes). This value is automatically sent as the byte count in the transaction. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and transmission. When enabled, adds CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_block_read | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| uint32_t * | size, | ||
| bool | pec ) |
Execute SMBus Block Read protocol.
This function performs the SMBus Block Read protocol, which sends a command code to the target device and then reads a variable number of data bytes from it. The target device first responds with a byte count indicating how many data bytes will follow.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, Sr=Repeated Start, P=Stop, A=ACK, N=NACK, W=Write bit, R=Read bit
| inst | The pointer to the PMBus Controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to the data buffer to store read data. Must point to valid memory with at least the size specified in the size parameter. The byte count is not stored in this buffer, only actual data bytes. |
| size | The pointer to the variable containing the maximum buffer size on the input and actual read size on the output. Input: The maximum number of bytes that can be stored in the data buffer. Output: The actual number of bytes read (as reported by the target byte count). |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_block_process_call | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| uint32_t | size_wr, | ||
| uint32_t * | size, | ||
| bool | pec ) |
Execute SMBus Block Write-Block Read Process Call protocol.
This function performs the SMBus Block Write-Block Read Process Call protocol, which sends command code followed by a byte count and variable number of data bytes to the target device, and then reads the variable number of data bytes back. This is a combined block write-block read operation in a single transaction.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, Sr=Repeated Start, P=Stop, A=ACK, N=NACK, W=Write bit, R=Read bit
| inst | The pointer to the PMBus controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to the data buffer containing write data followed by space for read data. The first size_wr bytes contain the data to write. The remaining buffer space will be overwritten with received data. Must point to valid memory with at least (size_wr + maximum expected read size) bytes. |
| size_wr | Number of bytes to write (0 to 255 bytes). Must be less than or equal to the size of the data buffer. This value is automatically sent as a write byte count in the transaction. |
| size | The pointer to the variable containing the maximum read buffer size on the input and actual read size on the output. Input: The size of the buffer space. Output: The actual number of bytes read (as reported by the target's read byte count). |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for error detection on the read part only. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_write_32 | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Write 32 protocol.
This function performs a SMBus Write 32 Protocol, which sends command code followed by 4 bytes of data to a target device.
The function constructs the complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, P=Stop, A=ACK, W=Write bit
| inst | The pointer to the PMBus controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to a 4-byte array containing data to write. Must point to valid memory with at least 4 bytes. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and transmission. When enabled, adds CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_write_64 | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Write 64 protocol.
This function performs the SMBus Write 64 Protocol, which sends command code followed by 8 bytes of data to the target device.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, P=Stop, A=ACK, W=Write bit
| inst | The pointer to the PMBus controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to an 8-byte array containing data to write. Must point to valid memory with at least 8 bytes. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and transmission. When enabled, adds CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_read_32 | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute SMBus Read 32 protocol.
This function performs the SMBus Read 32 protocol, which sends a command code to the target device and then reads 4 bytes of data from it.
The function constructs a complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, Sr=Repeated Start, P=Stop, A=ACK, N=NACK, W=Write bit, R=Read bit
| inst | The pointer to the PMBus controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to the 4-byte buffer to store the read data. Must point to valid memory with at least 4 bytes. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for error detection. |
| mtb_pmbus_ctrl_status_t mtb_pmbus_ctrl_ex_read_64 | ( | mtb_pmbus_ctrl_stc_t * | inst, |
| uint8_t | addr, | ||
| uint32_t | cmd_code, | ||
| uint8_t * | data, | ||
| bool | pec ) |
Execute PMBus Read 64 protocol.
This function performs the PMBus Read 64 protocol, which sends command code to the target device and then reads 8 bytes of data from it.
The function constructs the complete transaction packet including:
Transaction format without PEC:
Transaction format with PEC:
Where: S=Start, Sr=Repeated Start, P=Stop, A=ACK, N=NACK, W=Write bit, R=Read bit
| inst | The pointer to the PMBus controller instance structure. |
| addr | Target device 7-bit I2C address (0x00 to 0x7F). The function automatically handles the R/W bit. |
| cmd_code | Command code to send. |
| data | The pointer to the 8-byte buffer to store read data. Must point to valid memory with at least 8 bytes. |
| pec | Enable (true) or disable (false) Packet Error Code calculation and verification. When enabled, verifies CRC-8 checksum for the error detection. |