From 31a22858d5c9661af070ace1dc681e081a174948 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Tue, 24 Sep 2019 10:05:40 -0400 Subject: [PATCH] text fixes --- ports/stm32f4/peripherals/stm32f4/pins.h | 16 +++++------ .../peripherals/stm32f4/stm32f405xx/gpio.c | 27 ++++++++----------- .../peripherals/stm32f4/stm32f405xx/periph.c | 16 +++++------ .../peripherals/stm32f4/stm32f411xe/periph.c | 22 +++++++-------- .../peripherals/stm32f4/stm32f412zx/periph.c | 24 ++++++++--------- 5 files changed, 50 insertions(+), 55 deletions(-) diff --git a/ports/stm32f4/peripherals/stm32f4/pins.h b/ports/stm32f4/peripherals/stm32f4/pins.h index 6d5d0618df..ced83562ec 100644 --- a/ports/stm32f4/peripherals/stm32f4/pins.h +++ b/ports/stm32f4/peripherals/stm32f4/pins.h @@ -45,21 +45,21 @@ typedef struct { } mcu_pin_obj_t; //Standard stm32 adc unit combinations -#define ADC_1 1 -#define ADC_12 3 -#define ADC_123 7 -#define ADC_3 4 +#define ADC_1 1 +#define ADC_12 3 +#define ADC_123 7 +#define ADC_3 4 //STM32 ADC pins can have a combination of 1, 2 or all 3 ADCs on a single pin, //but all 3 ADCs will share the same input number per pin. //F4 family has 3 ADC max, 24 channels max. #define ADC_INPUT(mask, number) \ - .adc_unit = mask, \ - .adc_channel = number, + .adc_unit = mask, \ + .adc_channel = number, #define NO_ADC \ - .adc_unit = 0x00, \ - .adc_channel = 0x1f + .adc_unit = 0x00, \ + .adc_channel = 0x1f extern const mp_obj_type_t mcu_pin_type; diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c index f0a2a35056..2545e0470e 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/gpio.c @@ -29,24 +29,19 @@ #include "common-hal/microcontroller/Pin.h" void stm32f4_peripherals_gpio_init(void) { - //Enable all GPIO for now - __HAL_RCC_GPIOE_CLK_ENABLE(); - __HAL_RCC_GPIOC_CLK_ENABLE(); - __HAL_RCC_GPIOF_CLK_ENABLE(); - __HAL_RCC_GPIOH_CLK_ENABLE(); - __HAL_RCC_GPIOA_CLK_ENABLE(); - __HAL_RCC_GPIOB_CLK_ENABLE(); - __HAL_RCC_GPIOG_CLK_ENABLE(); - __HAL_RCC_GPIOD_CLK_ENABLE(); + //Enable all GPIO for now + __HAL_RCC_GPIOC_CLK_ENABLE(); + __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); - //Status LED chain - stm32f4_peripherals_status_led(0,1); - stm32f4_peripherals_status_led(1,0); - stm32f4_peripherals_status_led(2,0); - stm32f4_peripherals_status_led(3,0); + //Status LED chain + stm32f4_peripherals_status_led(0,1); + stm32f4_peripherals_status_led(1,0); + stm32f4_peripherals_status_led(2,0); + stm32f4_peripherals_status_led(3,0); - //Never reset pins - never_reset_pin_number(2,13); //PC13 anti tamp + //Never reset pins + never_reset_pin_number(2,13); //PC13 anti tamp never_reset_pin_number(2,14); //PC14 OSC32_IN never_reset_pin_number(2,15); //PC15 OSC32_OUT never_reset_pin_number(0,13); //PA13 SWDIO diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c index 005adafdd5..f2ace8204f 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f405xx/periph.c @@ -34,16 +34,16 @@ I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; const mcu_i2c_sda_obj_t mcu_i2c_sda_list[4] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), - I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 4, &pin_PB11), + I2C_SDA(3, 4, &pin_PC09), }; const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) }; //SPI, UART, Etc diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c index ea3fea0de0..645e937170 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f411xe/periph.c @@ -34,19 +34,19 @@ I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; const mcu_i2c_sda_obj_t mcu_i2c_sda_list[7] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 9, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), - I2C_SDA(3, 9, &pin_PB08) + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 9, &pin_PB09), + I2C_SDA(2, 9, &pin_PB03), + I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(3, 9, &pin_PB04), + I2C_SDA(3, 9, &pin_PB08) }; const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) }; //SPI, UART, Etc diff --git a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c index 857a8039b1..9156d3bea4 100644 --- a/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c +++ b/ports/stm32f4/peripherals/stm32f4/stm32f412zx/periph.c @@ -34,20 +34,20 @@ I2C_TypeDef * mcu_i2c_banks[3] = {I2C1, I2C2, I2C3}; const mcu_i2c_sda_obj_t mcu_i2c_sda_list[8] = { - I2C_SDA(1, 4, &pin_PB07), - I2C_SDA(1, 4, &pin_PB09), - I2C_SDA(2, 4, &pin_PB11), //not on LQFP100 - I2C_SDA(2, 9, &pin_PB09), - I2C_SDA(2, 9, &pin_PB03), - I2C_SDA(3, 4, &pin_PC09), - I2C_SDA(3, 9, &pin_PB04), - I2C_SDA(3, 9, &pin_PB08) + I2C_SDA(1, 4, &pin_PB07), + I2C_SDA(1, 4, &pin_PB09), + I2C_SDA(2, 4, &pin_PB11), //not on LQFP100 + I2C_SDA(2, 9, &pin_PB09), + I2C_SDA(2, 9, &pin_PB03), + I2C_SDA(3, 4, &pin_PC09), + I2C_SDA(3, 9, &pin_PB04), + I2C_SDA(3, 9, &pin_PB08) }; const mcu_i2c_scl_obj_t mcu_i2c_scl_list[4] = { - I2C_SCL(1, 4, &pin_PB06), - I2C_SCL(1, 4, &pin_PB08), - I2C_SCL(2, 4, &pin_PB10), - I2C_SCL(3, 4, &pin_PA08) + I2C_SCL(1, 4, &pin_PB06), + I2C_SCL(1, 4, &pin_PB08), + I2C_SCL(2, 4, &pin_PB10), + I2C_SCL(3, 4, &pin_PA08) }; //SPI, UART, Etc