From 2155ab2b72cc4f076dc0a25d0e3a5fdd4d218998 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 15 Jan 2017 15:04:02 +0100 Subject: 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. --- stm32f103/include/mcu/init.h | 136 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 stm32f103/include/mcu/init.h (limited to 'stm32f103/include') 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 + +namespace mcu { + +template +static inline constexpr +R SizeOfArray(const T(&)[N]) { + static_assert(std::numeric_limits::max() >= N, "N does not fit in R"); + return static_cast(N); +} + +}; // namespace mcu + +#endif -- cgit v1.2.3