40.1. Pmbus master
40.1.1. Overview
The PMbus master example demonstrates the functionality of I2C in master mode as a PMbus for receiving and sending data. It uses loops with different PMbus commands, including byte, word, and block instructions, and prints out the length of the read or written data or error codes.
40.1.2. Board Setting
connect I2C Pins on the two boards。
40.1.3. Running the example
Run slave first, and then run master.
When the example runs successfully, the log would be seen on the terminal like:
PMbus master test
pmbus master write test begin...
pmbus master write test end...
pmbus master read test begin...
pmbus(cmd:0x00) master read len:1
pmbus(cmd:0x06) master read len:128
pmbus(cmd:0x22) master read len:2
pmbus master read test end...