11#include " I3C.h"
22
3- #define I3C_BUS I3C1Bus
43static I3CDiscoveredDevice devices[8 ];
54static volatile bool callbackSeen = false ;
65
@@ -24,13 +23,13 @@ void setup() {
2423
2524 Serial.println (" === Controller IBI Example ===" );
2625
27- if (!I3C_BUS .begin (I3C_SDA , I3C_SCL , 1000000U )) {
26+ if (!I3C .begin (I3C_SDA , I3C_SCL , 1000000U )) {
2827 Serial.println (" begin() failed" );
2928 while (1 ) {}
3029 }
3130
3231 size_t found = 0 ;
33- int rc = I3C_BUS .discover (devices, 8 , &found);
32+ int rc = I3C .discover (devices, 8 , &found);
3433
3534 if (rc != 0 || found == 0 ) {
3635 Serial.println (" No target found" );
@@ -39,29 +38,29 @@ void setup() {
3938
4039 uint8_t da = devices[0 ].dynAddr ;
4140
42- I3C_BUS .onIbi (myIbiCallback, (void *)&callbackSeen);
41+ I3C .onIbi (myIbiCallback, (void *)&callbackSeen);
4342
44- rc = I3C_BUS .enableIbi (1 , da, false , false , 1000 );
43+ rc = I3C .enableIbi (1 , da, false , false , 1000 );
4544 Serial.print (" enableIbi rc = " );
4645 Serial.println (rc);
4746
48- rc = I3C_BUS .enableControllerEvents ();
47+ rc = I3C .enableControllerEvents ();
4948 Serial.print (" enableControllerEvents rc = " );
5049 Serial.println (rc);
5150
5251 Serial.println (" Waiting for IBI..." );
5352}
5453
5554void loop () {
56- if (I3C_BUS .hasIbi ()) {
55+ if (I3C .hasIbi ()) {
5756 I3CControllerIbiInfo ibi{};
58- if (I3C_BUS .peekIbi (ibi)) {
57+ if (I3C .peekIbi (ibi)) {
5958 Serial.print (" peekIbi source DA = 0x" );
6059 printHex2 (ibi.sourceDa );
6160 Serial.println ();
6261 }
6362
64- if (I3C_BUS .readIbi (ibi)) {
63+ if (I3C .readIbi (ibi)) {
6564 Serial.print (" readIbi source DA = 0x" );
6665 printHex2 (ibi.sourceDa );
6766 Serial.println ();
0 commit comments