|
是有原因的!
1。 为了迎合 TI DSP281X些列软件的使用。 2. 逐渐建立自己的 库文件。和清晰的寄存器、位段的说明 3. 同时使用,而非兼容! 4。 名字 各位可以随意 更改的,喜欢就行!
下一不就是验证这个方法了。 各位多给意见!
#define STM32_Pwr_Regs (((volatile struct PWR_REGS *)(PWR_BASE)))
#define STM32_Rcc_Regs (((volatile struct RCC_REGS *)(RCC_BASE)))
#define STM32_Gpioa_Regs (((volatile struct GPIO_REGS *)(GPIOA_BASE))) #define STM32_Gpiob_Regs (((volatile struct GPIO_REGS *)(GPIOB_BASE))) #define STM32_Gpioc_Regs (((volatile struct GPIO_REGS *)(GPIOC_BASE))) #define STM32_Gpiod_Regs (((volatile struct GPIO_REGS *)(GPIOD_BASE))) #define STM32_Gpioe_Regs (((volatile struct GPIO_REGS *)(GPIOE_BASE)))
#define STM32_Afio_Regs (((volatile struct AFIO_REGS *)(AFIO_BASE)))
#define STM32_Exti_Regs (((volatile struct EXTI_REGS *)(EXTI_BASE)))
#define STM32_Dma_ch1_Regs (((volatile struct DMA_REGS *)(DMA_Channel1_BASE))) #define STM32_Dma_ch2_Regs (((volatile struct DMA_REGS *)(DMA_Channel2_BASE))) #define STM32_Dma_ch3_Regs (((volatile struct DMA_REGS *)(DMA_Channel3_BASE))) #define STM32_Dma_ch4_Regs (((volatile struct DMA_REGS *)(DMA_Channel4_BASE))) #define STM32_Dma_ch5_Regs (((volatile struct DMA_REGS *)(DMA_Channel5_BASE))) #define STM32_Dma_ch6_Regs (((volatile struct DMA_REGS *)(DMA_Channel6_BASE))) #define STM32_Dma_ch7_Regs (((volatile struct DMA_REGS *)(DMA_Channel7_BASE)))
#define STM32_Rtc_Regs (((volatile struct RTC_REGS *)(RTC_BASE)))
#define STM32_Bkp_Regs (((volatile struct BKP_REGS *)(BKP_BASE)))
#define STM32_Iwdg_Regs (((volatile struct IWDG_REGS *)(IWDG_BASE)))
#define STM32_Wwdg_Regs (((volatile struct WWDG_REGS *)(WWDG_BASE)))
#define STM32_Tim2_Regs (((volatile struct TIM1_REGS *)(TIM2_BASE))) #define STM32_Tim3_Regs (((volatile struct TIM1_REGS *)(TIM3_BASE))) #define STM32_Tim4_Regs (((volatile struct TIM1_REGS *)(TIM4_BASE)))
#define STM32_Tim1_Regs (((volatile struct TIM_REGS *)(TIM1_BASE)))
#define STM32_Can_Regs (((volatile struct CAN_REGS *)(CAN_BASE)))
#define STM32_I2c1_Regs (((volatile struct I2C_REGS *)(I2C1_BASE))) #define STM32_I2c2_Regs (((volatile struct I2C_REGS *)(I2C2_BASE)))
#define STM32_Adc1_Regs (((volatile struct ADC_REGS *)(ADC1_BASE))) #define STM32_Adc2_Regs (((volatile struct ADC_REGS *)(ADC2_BASE)))
#define STM32_Usb_Regs (((volatile struct USB_REGS *)(USB_BASE)))
#define STM32_Spi1_Regs (((volatile struct SPI_REGS *)(SPI1_BASE))) #define STM32_Spi2_Regs (((volatile struct SPI_REGS *)(SPI2_BASE)))
#define STM32_Usart1_Regs (((volatile struct USART_REGS *)(USART1_BASE))) #define STM32_Usart2_Regs (((volatile struct USART_REGS *)(USART2_BASE))) #define STM32_Usart3_Regs (((volatile struct USART_REGS *)(USART3_BASE)))
#define STM32_Nvic_Regs (((volatile struct NVIC_REGS *)(NVIC_BASE)))
#define STM32_Scb_Regs (((volatile struct SCB_REGS *)(SCB_BASE)))
#define STM32_SysTick_Regs (((volatile struct SysTick_REGS *)(SysTick_BASE)))
#define STM32_Flash_Regs (((volatile struct FLASH_REGS *)(FLASH_BASE))) |
|