Skip to content

Commit d7094cd

Browse files
pennamandreagilardoni
authored andcommitted
Initial zephyr support
1 parent 06c74a5 commit d7094cd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/ECCX08.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@
2424
const uint32_t ECCX08Class::_wakeupFrequency = 100000u; // 100 kHz
2525
#ifdef __AVR__
2626
const uint32_t ECCX08Class::_normalFrequency = 400000u; // 400 kHz
27+
#elif defined(ARDUINO_ARCH_ZEPHYR) && defined(ARDUINO_PORTENTA_H7_M7)
28+
// FIXME speed above 400kHz require manual configuration in stm32 running on zephyr
29+
const uint32_t ECCX08Class::_normalFrequency = 400000u;
2730
#else
2831
const uint32_t ECCX08Class::_normalFrequency = 1000000u; // 1 MHz
2932
#endif
@@ -970,6 +973,12 @@ uint16_t ECCX08Class::crc16(const byte data[], size_t length)
970973
return crc;
971974
}
972975

976+
#if __ZEPHYR__
977+
#ifndef CRYPTO_WIRE
978+
#define CRYPTO_WIRE Wire1
979+
#endif
980+
#endif
981+
973982
#ifdef CRYPTO_WIRE
974983
ECCX08Class ECCX08(CRYPTO_WIRE, 0x60);
975984
#else

0 commit comments

Comments
 (0)