mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-17 11:58:13 +00:00
50 lines
1.7 KiB
C
50 lines
1.7 KiB
C
#define MICROPY_HW_BOARD_NAME "TREZORv2"
|
|
#define MICROPY_HW_MCU_NAME "STM32F405VG"
|
|
#define MICROPY_PY_SYS_PLATFORM "trezor"
|
|
|
|
#define MICROPY_HW_HAS_SWITCH (0)
|
|
#define MICROPY_HW_HAS_FLASH (0)
|
|
#define MICROPY_HW_HAS_SDCARD (1)
|
|
#define MICROPY_HW_HAS_MMA7660 (0)
|
|
#define MICROPY_HW_HAS_LIS3DSH (0)
|
|
#define MICROPY_HW_HAS_LCD (0)
|
|
#define MICROPY_HW_ENABLE_RNG (1)
|
|
#define MICROPY_HW_ENABLE_RTC (0)
|
|
#define MICROPY_HW_ENABLE_TIMER (1)
|
|
#define MICROPY_HW_ENABLE_SERVO (0)
|
|
#define MICROPY_HW_ENABLE_DAC (0)
|
|
#define MICROPY_HW_ENABLE_CAN (0)
|
|
|
|
// HSE is 8MHz
|
|
#define MICROPY_HW_CLK_PLLM (8)
|
|
#define MICROPY_HW_CLK_PLLN (336)
|
|
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
|
|
#define MICROPY_HW_CLK_PLLQ (7)
|
|
#define MICROPY_HW_CLK_LAST_FREQ (1)
|
|
|
|
// I2C busses
|
|
#define MICROPY_HW_I2C1_NAME "I2C"
|
|
#define MICROPY_HW_I2C1_SCL (pin_B6)
|
|
#define MICROPY_HW_I2C1_SDA (pin_B7)
|
|
|
|
// UART config
|
|
#define MICROPY_HW_UART1_NAME "UART"
|
|
#define MICROPY_HW_UART1_TX (pin_A2)
|
|
#define MICROPY_HW_UART1_RX (pin_A3)
|
|
|
|
// The board has 2 LEDs
|
|
#define MICROPY_HW_LED1 (pin_C6)
|
|
#define MICROPY_HW_LED2 (pin_B13)
|
|
#define MICROPY_HW_LED2_PWM { TIM1, 1, TIM_CHANNEL_1, GPIO_AF1_TIM1 }
|
|
#define MICROPY_HW_LED_OTYPE (GPIO_MODE_OUTPUT_PP)
|
|
#define MICROPY_HW_LED_ON(pin) (mp_hal_pin_high(pin))
|
|
#define MICROPY_HW_LED_OFF(pin) (mp_hal_pin_low(pin))
|
|
|
|
// SD card detect switch
|
|
#define MICROPY_HW_SDCARD_DETECT_PIN (pin_C13)
|
|
#define MICROPY_HW_SDCARD_DETECT_PULL (GPIO_PULLUP)
|
|
#define MICROPY_HW_SDCARD_DETECT_PRESENT (GPIO_PIN_RESET)
|
|
|
|
// USB config
|
|
#define MICROPY_HW_USB_VBUS_DETECT_PIN (pin_A9)
|