36 extern "C" { |
36 extern "C" { |
37 #endif |
37 #endif |
38 |
38 |
39 typedef enum { |
39 typedef enum { |
40 ADC_1 = (int)ADC1_BASE, |
40 ADC_1 = (int)ADC1_BASE, |
|
41 #if defined ADC2_BASE |
41 ADC_2 = (int)ADC2_BASE, |
42 ADC_2 = (int)ADC2_BASE, |
|
43 #endif |
|
44 #if defined ADC3_BASE |
42 ADC_3 = (int)ADC3_BASE, |
45 ADC_3 = (int)ADC3_BASE, |
|
46 #endif |
|
47 #if defined ADC4_BASE |
43 ADC_4 = (int)ADC4_BASE |
48 ADC_4 = (int)ADC4_BASE |
|
49 #endif |
44 } ADCName; |
50 } ADCName; |
45 |
51 |
46 typedef enum { |
52 typedef enum { |
47 DAC_1 = (int)DAC_BASE |
53 DAC_1 = (int)DAC1_BASE, |
|
54 #if defined DAC2_BASE |
|
55 DAC_2 = (int)DAC2_BASE |
|
56 #endif |
48 } DACName; |
57 } DACName; |
49 |
58 |
50 typedef enum { |
59 typedef enum { |
51 UART_1 = (int)USART1_BASE, |
60 UART_1 = (int)USART1_BASE, |
52 UART_2 = (int)USART2_BASE, |
61 UART_2 = (int)USART2_BASE, |
53 UART_3 = (int)USART3_BASE, |
62 UART_3 = (int)USART3_BASE, |
|
63 #if defined UART4_BASE |
54 UART_4 = (int)UART4_BASE, |
64 UART_4 = (int)UART4_BASE, |
|
65 #endif |
|
66 #if defined UART5_BASE |
55 UART_5 = (int)UART5_BASE |
67 UART_5 = (int)UART5_BASE |
|
68 #endif |
56 } UARTName; |
69 } UARTName; |
57 |
70 |
58 #define DEVICE_SPI_COUNT 4 |
71 #define DEVICE_SPI_COUNT 4 |
59 typedef enum { |
72 typedef enum { |
|
73 #if defined SPI1_BASE |
60 SPI_1 = (int)SPI1_BASE, |
74 SPI_1 = (int)SPI1_BASE, |
|
75 #endif |
|
76 #if defined SPI2_BASE |
61 SPI_2 = (int)SPI2_BASE, |
77 SPI_2 = (int)SPI2_BASE, |
|
78 #endif |
|
79 #if defined SPI3_BASE |
62 SPI_3 = (int)SPI3_BASE, |
80 SPI_3 = (int)SPI3_BASE, |
|
81 #endif |
|
82 #if defined SPI4_BASE |
63 SPI_4 = (int)SPI4_BASE |
83 SPI_4 = (int)SPI4_BASE |
|
84 #endif |
64 } SPIName; |
85 } SPIName; |
65 |
86 |
66 typedef enum { |
87 typedef enum { |
67 I2C_1 = (int)I2C1_BASE, |
88 I2C_1 = (int)I2C1_BASE, |
|
89 #if defined I2C2_BASE |
68 I2C_2 = (int)I2C2_BASE, |
90 I2C_2 = (int)I2C2_BASE, |
|
91 #endif |
|
92 #if defined I2C3_BASE |
69 I2C_3 = (int)I2C3_BASE |
93 I2C_3 = (int)I2C3_BASE |
|
94 #endif |
70 } I2CName; |
95 } I2CName; |
71 |
96 |
72 typedef enum { |
97 typedef enum { |
73 PWM_1 = (int)TIM1_BASE, |
98 PWM_1 = (int)TIM1_BASE, |
74 PWM_2 = (int)TIM2_BASE, |
99 PWM_2 = (int)TIM2_BASE, |
|
100 #if defined TIM3_BASE |
75 PWM_3 = (int)TIM3_BASE, |
101 PWM_3 = (int)TIM3_BASE, |
|
102 #endif |
|
103 #if defined TIM4_BASE |
76 PWM_4 = (int)TIM4_BASE, |
104 PWM_4 = (int)TIM4_BASE, |
|
105 #endif |
|
106 #if defined TIM8_BASE |
77 PWM_8 = (int)TIM8_BASE, |
107 PWM_8 = (int)TIM8_BASE, |
|
108 #endif |
78 PWM_15 = (int)TIM15_BASE, |
109 PWM_15 = (int)TIM15_BASE, |
79 PWM_16 = (int)TIM16_BASE, |
110 PWM_16 = (int)TIM16_BASE, |
80 PWM_17 = (int)TIM17_BASE, |
111 PWM_17 = (int)TIM17_BASE, |
|
112 #if defined TIM20_BASE |
81 PWM_20 = (int)TIM20_BASE |
113 PWM_20 = (int)TIM20_BASE |
|
114 #endif |
82 } PWMName; |
115 } PWMName; |
83 |
116 |
84 typedef enum { |
117 typedef enum { |
85 CAN_1 = (int)CAN_BASE |
118 CAN_1 = (int)CAN_BASE |
86 } CANName; |
119 } CANName; |
87 |
120 |
|
121 #if defined USB_BASE |
88 typedef enum { |
122 typedef enum { |
89 USB_FS = (int)USB_BASE, |
123 USB_FS = (int)USB_BASE, |
90 } USBName; |
124 } USBName; |
|
125 #endif |
91 |
126 |
92 #ifdef __cplusplus |
127 #ifdef __cplusplus |
93 } |
128 } |
94 #endif |
129 #endif |
95 |
130 |