diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-15 15:04:02 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-15 15:04:02 +0100 |
commit | 2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998 (patch) | |
tree | 8f89f8a86b949382456a2813d467518033995782 /stm32f103/include/mcu | |
parent | 7bd30b64fb5eaccb9c4a78b0bb4413d5a476089c (diff) | |
download | mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.tar.gz mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.tar.bz2 mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.tar.xz mcu.cmake-2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998.zip |
o Adding a generic binutils part for creating the info files (.nm, disassembly, size, hex and bin files.)
o Adding initial support for STM32F103xx chips. Can easily be expanded to all at least the F1 series.
Diffstat (limited to 'stm32f103/include/mcu')
-rw-r--r-- | stm32f103/include/mcu/init.h | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/stm32f103/include/mcu/init.h b/stm32f103/include/mcu/init.h new file mode 100644 index 0000000..6c870c2 --- /dev/null +++ b/stm32f103/include/mcu/init.h @@ -0,0 +1,136 @@ +#ifndef INIT_HIGH_H +#define INIT_HIGH_H + +extern "C" +int halt(); + +extern "C" +int main(); + +extern "C" { + +// Symbols for interrupt handlers. They all have a default implementation, but can be overridden by creating a function +// with the same name. + +extern void _Reset_Handler(); + +extern void NMI_Handler(); + +extern void HardFault_Handler(); + +extern void MemManage_Handler(); + +extern void BusFault_Handler(); + +extern void UsageFault_Handler(); + +extern void SVC_Handler(); + +extern void DebugMon_Handler(); + +extern void PendSV_Handler(); + +extern void SysTick_Handler(); + +extern void WWDG_IRQHandler(); + +extern void PVD_IRQHandler(); + +extern void TAMPER_IRQHandler(); + +extern void RTC_IRQHandler(); + +extern void FLASH_IRQHandler(); + +extern void RCC_IRQHandler(); + +extern void EXTI0_IRQHandler(); + +extern void EXTI1_IRQHandler(); + +extern void EXTI2_IRQHandler(); + +extern void EXTI3_IRQHandler(); + +extern void EXTI4_IRQHandler(); + +extern void DMA1_Channel1_IRQHandler(); + +extern void DMA1_Channel2_IRQHandler(); + +extern void DMA1_Channel3_IRQHandler(); + +extern void DMA1_Channel4_IRQHandler(); + +extern void DMA1_Channel5_IRQHandler(); + +extern void DMA1_Channel6_IRQHandler(); + +extern void DMA1_Channel7_IRQHandler(); + +extern void ADC1_2_IRQHandler(); + +extern void USB_HP_CAN1_TX_IRQHandler(); + +extern void USB_LP_CAN1_RX0_IRQHandler(); + +extern void CAN1_RX1_IRQHandler(); + +extern void CAN1_SCE_IRQHandler(); + +extern void EXTI9_5_IRQHandler(); + +extern void TIM1_BRK_IRQHandler(); + +extern void TIM1_UP_IRQHandler(); + +extern void TIM1_TRG_COM_IRQHandler(); + +extern void TIM1_CC_IRQHandler(); + +extern void TIM2_IRQHandler(); + +extern void TIM3_IRQHandler(); + +extern void TIM4_IRQHandler(); + +extern void I2C1_EV_IRQHandler(); + +extern void I2C1_ER_IRQHandler(); + +extern void I2C2_EV_IRQHandler(); + +extern void I2C2_ER_IRQHandler(); + +extern void SPI1_IRQHandler(); + +extern void SPI2_IRQHandler(); + +extern void USART1_IRQHandler(); + +extern void USART2_IRQHandler(); + +extern void USART3_IRQHandler(); + +extern void EXTI15_10_IRQHandler(); + +extern void RTCAlarm_IRQHandler(); + +extern void USBWakeUp_IRQHandler(); +} + + +#include <limits> + +namespace mcu { + +template<typename R = std::size_t, typename T, std::size_t N> +static inline constexpr +R SizeOfArray(const T(&)[N]) { + static_assert(std::numeric_limits<R>::max() >= N, "N does not fit in R"); + return static_cast<R>(N); +} + +}; // namespace mcu + +#endif |