aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-06-02 20:26:10 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2012-06-02 20:31:52 -0400
commitff6a1e449f6e722ca33c8a0d4131574b6efc02f9 (patch)
treeb1ecafd2f2c0acb37c349503bbf3a00f0c4e674a
parent33b972e7e214e291bd62f83a0621fb87c267a9de (diff)
downloadlibrambutan-ff6a1e449f6e722ca33c8a0d4131574b6efc02f9.tar.gz
librambutan-ff6a1e449f6e722ca33c8a0d4131574b6efc02f9.zip
Sort the rcc_clk_id enumerators semi-alphabetically.
Only semi-alphabetically because peripherals are kept together (so the UARTs sort as if they were USARTs). Advantages: - It lets us play numeric comparison and lookup-table hacks, as we now have the property that the rcc_clk_ids for a given peripheral are a contiguous range of integers. - It will hopefully let the compiler emit faster/smaller code for switches over a dev->clk_id. - It's better intuitively. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--libmaple/stm32f1/include/series/rcc.h54
-rw-r--r--libmaple/stm32f2/include/series/rcc.h100
2 files changed, 77 insertions, 77 deletions
diff --git a/libmaple/stm32f1/include/series/rcc.h b/libmaple/stm32f1/include/series/rcc.h
index e6afe0e..225ca49 100644
--- a/libmaple/stm32f1/include/series/rcc.h
+++ b/libmaple/stm32f1/include/series/rcc.h
@@ -391,52 +391,52 @@ typedef struct rcc_reg_map {
* @brief STM32F1 rcc_clk_id.
*/
typedef enum rcc_clk_id {
- RCC_GPIOA,
- RCC_GPIOB,
- RCC_GPIOC,
- RCC_GPIOD,
- RCC_AFIO,
RCC_ADC1,
RCC_ADC2,
RCC_ADC3,
- RCC_USART1,
- RCC_USART2,
- RCC_USART3,
- RCC_TIMER1,
- RCC_TIMER2,
- RCC_TIMER3,
- RCC_TIMER4,
- RCC_SPI1,
- RCC_SPI2,
- RCC_DMA1,
- RCC_PWR,
+ RCC_AFIO,
RCC_BKP,
- RCC_I2C1,
- RCC_I2C2,
RCC_CRC,
+ RCC_DAC,
+ RCC_DMA1,
+ RCC_DMA2,
RCC_FLITF,
- RCC_SRAM,
- RCC_USB,
+ RCC_FSMC,
+ RCC_GPIOA,
+ RCC_GPIOB,
+ RCC_GPIOC,
+ RCC_GPIOD,
RCC_GPIOE,
RCC_GPIOF,
RCC_GPIOG,
- RCC_UART4,
- RCC_UART5,
+ RCC_I2C1,
+ RCC_I2C2,
+ RCC_PWR,
+ RCC_SDIO,
+ RCC_SPI1,
+ RCC_SPI2,
+ RCC_SPI3,
+ RCC_SRAM,
+ RCC_TIMER1,
+ RCC_TIMER2,
+ RCC_TIMER3,
+ RCC_TIMER4,
RCC_TIMER5,
RCC_TIMER6,
RCC_TIMER7,
RCC_TIMER8,
- RCC_FSMC,
- RCC_DAC,
- RCC_DMA2,
- RCC_SDIO,
- RCC_SPI3,
RCC_TIMER9,
RCC_TIMER10,
RCC_TIMER11,
RCC_TIMER12,
RCC_TIMER13,
RCC_TIMER14,
+ RCC_USART1,
+ RCC_USART2,
+ RCC_USART3,
+ RCC_UART4,
+ RCC_UART5,
+ RCC_USB,
} rcc_clk_id;
/**
diff --git a/libmaple/stm32f2/include/series/rcc.h b/libmaple/stm32f2/include/series/rcc.h
index 1d9de85..441a5a8 100644
--- a/libmaple/stm32f2/include/series/rcc.h
+++ b/libmaple/stm32f2/include/series/rcc.h
@@ -759,67 +759,67 @@ typedef enum rcc_clk {
* @brief STM32F2 rcc_clk_id.
*/
typedef enum rcc_clk_id {
- RCC_OTGHSULPI,
- RCC_OTGHS,
- RCC_ETHMACPTP,
- RCC_ETHMACRX,
- RCC_ETHMACTX,
- RCC_ETHMAC,
- RCC_DMA2,
- RCC_DMA1,
+ RCC_ADC1,
+ RCC_ADC2,
+ RCC_ADC3,
RCC_BKPSRAM,
+ RCC_CAN1,
+ RCC_CAN2,
RCC_CRC,
- RCC_GPIOI,
- RCC_GPIOH,
- RCC_GPIOG,
- RCC_GPIOF,
- RCC_GPIOE,
- RCC_GPIOD,
-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CC_UART4,
+ RCC_UART5,
+ RCC_USART6,
+ RCC_WWDG,
} rcc_clk_id;
/**