Hi
I do apologize if this is the wrong place to post this. If that's the case then please let me know and I'll remove this an put it in the appropriate place.
So I am currently working on a project that uses a chip that uses a custom I2C protocol. They supply a demo project that compiles successfully for an Uno but when I try to compile for the DFRobot board it gives me the following errors (I get more but I believe they're all link and also because of the word limit):
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.cpp: In member function 'uint8_t I2C::read(uint16_t, uint8_t, uint8_t*, I2C_Stop_e)':
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.cpp:444:12: error: 'TWDR' was not declared in this scope
*pData = TWDR;
^
In file included from C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.cpp:27:0:
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.cpp: In member function 'void I2C::setup()':
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.cpp:566:10: error: 'PORTD' was not declared in this scope
SetBit(PORTD, 0);
^
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.h:42:28: note: in definition of macro 'SetBit'
#define SetBit(VAR,Index) VAR |= (1<<Index)
^
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.cpp:572:11: error: 'TWSR' was not declared in this scope
ClearBit(TWSR, TWPS0);
^
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.h:43:30: note: in definition of macro 'ClearBit'
#define ClearBit(VAR,Index) VAR &= (uint8_t)(~(1<<Index))
^
C:\Users\andre\AppData\Local\Temp\arduino_build_729502\sketch\src\I2C\I2C.cpp:572:17: error: 'TWPS0' was not declared in this scope
ClearBit(TWSR, TWPS0);
^
From what I understand is that the beetle esp32 doesn't actually have those registers, hence the errors. The board does have I2C functionality and the Wire.h library seems to work with it. I tried looking to see if I can make the wire library use a sort of custom protocol but I can't seem to find all the appropriate information.
So basically I want to know if I can use the sequence in the image attached with the Wire library?
I found this thread which makes me hopeful but I'm still not 100% sure how to go about it?
Note I am also willing to use any other library, wire is just the only one I know