Skip to content

Commit

Permalink
Merge e886eb8 into 22c693a
Browse files Browse the repository at this point in the history
  • Loading branch information
iabdalkader committed Mar 19, 2018
2 parents 22c693a + e886eb8 commit 4c3548d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 10 deletions.
8 changes: 4 additions & 4 deletions ports/stm32/boards/NUCLEO_H743ZI/mpconfigboard.h
Expand Up @@ -27,10 +27,10 @@ void NUCLEO_H743ZI_board_early_init(void);
#define MICROPY_HW_UART_REPL_BAUD 115200

// I2C busses
//#define MICROPY_HW_I2C1_SCL (pin_B8)
//#define MICROPY_HW_I2C1_SDA (pin_B9)
//#define MICROPY_HW_I2C3_SCL (pin_H7)
//#define MICROPY_HW_I2C3_SDA (pin_H8)
#define MICROPY_HW_I2C1_SCL (pin_B8)
#define MICROPY_HW_I2C1_SDA (pin_B9)
#define MICROPY_HW_I2C2_SCL (pin_F1)
#define MICROPY_HW_I2C2_SDA (pin_F0)

// SPI
//#define MICROPY_HW_SPI2_NSS (pin_I0)
Expand Down
6 changes: 4 additions & 2 deletions ports/stm32/boards/NUCLEO_H743ZI/pins.csv
Expand Up @@ -30,8 +30,10 @@ TP3,PH15
AUDIO_INT,PD6
AUDIO_SDA,PH8
AUDIO_SCL,PH7
EXT_SDA,PB9
EXT_SCL,PB8
I2C1_SDA,PB9
I2C1_SCL,PB8
I2C2_SDA,PF0
I2C2_SCL,PF1
EXT_RST,PG3
SD_D0,PG9
SD_D1,PG10
Expand Down
2 changes: 1 addition & 1 deletion ports/stm32/boards/NUCLEO_H743ZI/stm32h7xx_hal_conf.h
Expand Up @@ -168,7 +168,7 @@
#define VDD_VALUE ((uint32_t)3300) /*!< Value of VDD in mv */
#define TICK_INT_PRIORITY ((uint32_t)0x0F) /*!< tick interrupt priority */
#define USE_RTOS 0
#define USE_SD_TRANSCEIVER 1U /*!< use uSD Transceiver */
#define USE_SD_TRANSCEIVER 0U /*!< use uSD Transceiver */

/* ########################### Ethernet Configuration ######################### */
#define ETH_TX_DESC_CNT 4 /* number of Ethernet Tx DMA descriptors */
Expand Down
2 changes: 1 addition & 1 deletion ports/stm32/dma.h
Expand Up @@ -28,7 +28,7 @@

typedef struct _dma_descr_t dma_descr_t;

#if defined(STM32F4) || defined(STM32F7)
#if defined(STM32F4) || defined(STM32F7) || defined(STM32H7)

extern const dma_descr_t dma_I2C_1_RX;
extern const dma_descr_t dma_SPI_3_RX;
Expand Down
15 changes: 13 additions & 2 deletions ports/stm32/i2c.c
Expand Up @@ -131,9 +131,9 @@ const pyb_i2c_obj_t pyb_i2c_obj[] = {
#endif
};

#if defined(STM32F7) || defined(STM32L4)
#if defined(STM32F7) || defined(STM32L4) || defined(STM32H7)

// The STM32F0, F3, F7 and L4 use a TIMINGR register rather than ClockSpeed and
// The STM32F0, F3, F7, H7 and L4 use a TIMINGR register rather than ClockSpeed and
// DutyCycle.

#if defined(STM32F746xx)
Expand Down Expand Up @@ -161,6 +161,17 @@ const pyb_i2c_obj_t pyb_i2c_obj[] = {
#define MICROPY_HW_I2C_BAUDRATE_DEFAULT (PYB_I2C_SPEED_FULL)
#define MICROPY_HW_I2C_BAUDRATE_MAX (PYB_I2C_SPEED_FAST)

#elif defined(STM32H7)

// I2C TIMINGs obtained from the STHAL examples.
#define MICROPY_HW_I2C_BAUDRATE_TIMING { \
{PYB_I2C_SPEED_STANDARD, 0x40604E73}, \
{PYB_I2C_SPEED_FULL, 0x00901954}, \
{PYB_I2C_SPEED_FAST, 0x10810915}, \
}
#define MICROPY_HW_I2C_BAUDRATE_DEFAULT (PYB_I2C_SPEED_FULL)
#define MICROPY_HW_I2C_BAUDRATE_MAX (PYB_I2C_SPEED_FAST)

#elif defined(STM32L4)

// The value 0x90112626 was obtained from the DISCOVERY_I2C1_TIMING constant
Expand Down

0 comments on commit 4c3548d

Please sign in to comment.