28.2. Pmbus slave
28.2.1. Overview
The PMbus Slave example project demonstrates the I2C interface operating in slave mode as a PMbus device for receiving and transmitting data. It requires registering the PMbus command transaction handlers, and the PMbus slave protocol stack will print the received or transmitted data along with command-related messages via the callback function.
28.2.2. Tips
For detailed documentation about PMbus components, please refer to pmbus
28.2.3. Board Setting
connect I2C Pins on the two boards。
28.2.4. Running the example
Run the slave firmware first, followed by the master.
When the project runs correctly, the serial terminal will display output similar to the following:
PMbus slave test
pmbus(cmd:0x05) slave command transaction install success
pmbus(cmd:0x06) slave command transaction install success
pmbus(cmd:0x00) slave command transaction install success
pmbus(cmd:0x03) slave command transaction install success
pmbus(cmd:0x22) slave command transaction install success
cb:cmd: 0x05, read:true, pec_check:true, len:128, data_addr:0x0120a054
cb:cmd: 0x00, read:true, pec_check:true, len:1, data_addr:0x0120a054
cb:cmd: 0x03, read:true, pec_check:true, len:0, data_addr:0x0120a054
cb:cmd: 0x22, read:true, pec_check:true, len:2, data_addr:0x0120a054
cb:cmd: 0x00, read:false, pec_check:true, len:1, data_addr:0x01209fd4
cb:cmd: 0x06, read:false, pec_check:true, len:128, data_addr:0x01209fd4