I have code that emulates I2C slaves for the Arduino Uno. I am trying to re-use the same code, but for the Portenta H7. However, when compiling the sketch, it cannot find / include a file since the original code is using the AVR core (Arduino Uno uses Atmel Atmega MCU). So I get the following error since Portenta is not AVR
C:\Users\cchen\AppData\Local\Arduino15\packages\arduino\hardware\mbed_portenta\3.3.0\libraries\Wire\utility\twi.c:26:10: fatal error: avr/io.h: No such file or directory
#include <avr/io.h>
^~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board Arduino Portenta H7 (M4 core).
What can I do to reuse the code? Is there any way I can move some folders around so that it can find the file/directory? Or would it not work regardless since the MCU on the Portenta is ARM STM32 and not AVR? Thank you for your help.