stm32/machine_i2c: Use hardware I2C for STM32H7.
This commit is contained in:
parent
9eff4029ab
commit
67d1dca9c2
@ -268,7 +268,12 @@ int i2c_write(i2c_t *i2c, const uint8_t *src, size_t len, size_t next_len) {
|
||||
return num_acks;
|
||||
}
|
||||
|
||||
#elif defined(STM32F0) || defined(STM32F7)
|
||||
#elif defined(STM32F0) || defined(STM32F7) || defined(STM32H7)
|
||||
|
||||
#if defined(STM32H7)
|
||||
#define APB1ENR APB1LENR
|
||||
#define RCC_APB1ENR_I2C1EN RCC_APB1LENR_I2C1EN
|
||||
#endif
|
||||
|
||||
STATIC uint16_t i2c_timeout_ms[MICROPY_HW_MAX_I2C];
|
||||
|
||||
@ -468,7 +473,7 @@ int i2c_write(i2c_t *i2c, const uint8_t *src, size_t len, size_t next_len) {
|
||||
|
||||
#endif
|
||||
|
||||
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7)
|
||||
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7) || defined(STM32H7)
|
||||
|
||||
int i2c_readfrom(i2c_t *i2c, uint16_t addr, uint8_t *dest, size_t len, bool stop) {
|
||||
int ret;
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
#define I2C_POLL_DEFAULT_TIMEOUT_US (50000) // 50ms
|
||||
|
||||
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7)
|
||||
#if defined(STM32F0) || defined(STM32F4) || defined(STM32F7) || defined(STM32H7)
|
||||
|
||||
typedef struct _machine_hard_i2c_obj_t {
|
||||
mp_obj_base_t base;
|
||||
|
Loading…
x
Reference in New Issue
Block a user