00001 00022 /* Define to prevent recursive inclusion -------------------------------------*/ 00023 #ifndef __STM8S_CONF_H 00024 #define __STM8S_CONF_H 00025 00026 00027 /* Includes ------------------------------------------------------------------*/ 00028 #include "stm8s.h" 00029 00030 /* Exported types ------------------------------------------------------------*/ 00031 /* Exported constants --------------------------------------------------------*/ 00032 00033 00034 /* Uncomment the line below to expanse the "assert_param" macro in the 00035 Standard Peripheral Library drivers code */ 00036 /* #define USE_FULL_ASSERT 1 */ 00037 00038 /* In the following line adjust the value of External High Speed oscillator (HSE) 00039 used in your application */ 00040 #if defined (STM8S208) || defined (STM8S207) 00041 #define HSE_VALUE ((u32)24000000) /* Value of the External oscillator in Hz*/ 00042 #else 00043 #define HSE_VALUE ((u32)16000000) /* Value of the External oscillator in Hz*/ 00044 #endif 00045 00046 /* Uncomment the line below to enable peripheral header file inclusion */ 00047 00048 /************************************* ADC ************************************/ 00049 #if defined(STM8S105) || defined(STM8S103) || defined(STM8S903) 00050 /* #define _ADC1 (1) */ 00051 #endif /* (STM8S105) ||(STM8S103) || (STM8S903) */ 00052 00053 #if defined(STM8S208) || defined(STM8S207) 00054 /* #define _ADC2 (1) */ 00055 #endif /* (STM8S208) ||(STM8S207) */ 00056 00057 /************************************* AWU ************************************/ 00058 /* #define _AWU (1) */ 00059 00060 /************************************* BEEP ***********************************/ 00061 /* #define _BEEP (1) */ 00062 00063 /************************************* CLK ************************************/ 00064 #ifdef STM8S208 00065 /* #define _CAN (1) */ 00066 #endif /* (STM8S208) */ 00067 00068 /************************************* CLK ************************************/ 00069 #define _CLK (1) 00070 00071 /************************************* EXTI ***********************************/ 00072 /* #define _EXTI (1) */ 00073 00074 /******************************* FLASH/DATA EEPROM ****************************/ 00075 /* #define _FLASH (1) */ 00076 00077 /********************************* OPTION BYTES *******************************/ 00078 /* #define _OPT (1) */ 00079 00080 /************************************* GPIO ***********************************/ 00081 #define _GPIO (1) 00082 00083 /************************************* I2C ************************************/ 00084 /* #define _I2C (1) */ 00085 00086 /************************************* ITC ************************************/ 00087 /* #define _ITC (1) */ 00088 00089 /************************************* IWDG ***********************************/ 00090 /* #define _IWDG (1) */ 00091 00092 /************************************* RST ************************************/ 00093 /* #define _RST (1) */ 00094 00095 /************************************* SPI ************************************/ 00096 /* #define _SPI (1) */ 00097 00098 /************************************* TIM1 ***********************************/ 00099 /* Atomthreads port: Use TIM1 for the system tick (10ms) */ 00100 #define _TIM1 (1) 00101 00102 /************************************* TIM2 ***********************************/ 00103 #if defined(STM8S208) ||defined(STM8S207) ||defined(STM8S103) ||defined(STM8S105) 00104 /* #define _TIM2 (1) */ 00105 #endif /* (STM8S208) ||(STM8S207) || (STM8S103) || (STM8S105) */ 00106 00107 /************************************* TIM3 ***********************************/ 00108 #if defined(STM8S208) ||defined(STM8S207) ||defined(STM8S105) 00109 /* #define _TIM3 (1) */ 00110 #endif /* (STM8S208) ||(STM8S207) || (STM8S105) */ 00111 00112 /************************************* TIM4 ***********************************/ 00113 #if defined(STM8S208) ||defined(STM8S207) ||defined(STM8S103) ||defined(STM8S105) 00114 /* #define _TIM4 (1) */ 00115 #endif /* (STM8S208) ||(STM8S207) || (STM8S103) || (STM8S105) */ 00116 00117 /************************************* TIM5 & TIM6 ****************************/ 00118 #ifdef STM8S903 00119 /* #define _TIM5 (1) */ 00120 /* #define _TIM6 (1) */ 00121 #endif /* STM8S903 */ 00122 00123 /************************************* UARTx **********************************/ 00124 #if defined(STM8S208) ||defined(STM8S207) ||defined(STM8S103) ||defined(STM8S903) 00125 /* #define _UART1 (1) */ 00126 #endif /* (STM8S208) ||(STM8S207) || (STM8S103) || (STM8S903) */ 00127 00128 /* Atomthreads port: Use UART2 on STM8S Discovery, change if required */ 00129 #ifdef STM8S105 00130 #define _UART2 (1) 00131 #endif /* STM8S105 */ 00132 00133 #if defined(STM8S208) ||defined(STM8S207) 00134 /* #define _UART3 (1) */ 00135 #endif /* (STM8S208) ||(STM8S207) */ 00136 00137 /************************************* WWDG ***********************************/ 00138 /* #define _WWDG (1) */ 00139 00140 /* Exported macro ------------------------------------------------------------*/ 00141 00142 #ifdef USE_FULL_ASSERT 00143 00151 #define assert_param(expr) ((expr) ? (void)0 : assert_failed((u8 *)__FILE__, __LINE__)) 00152 /* Exported functions ------------------------------------------------------- */ 00153 void assert_failed(u8* file, u32 line); 00154 #else 00155 #define assert_param(expr) ((void)0) 00156 #endif /* USE_FULL_ASSERT */ 00157 00158 00159 /* Peripheral header file inclusion ******************************************/ 00160 #ifdef _ADC1 00161 #include "stm8s_adc1.h" 00162 #endif /* _ADC1 */ 00163 00164 #ifdef _ADC2 00165 #include "stm8s_adc2.h" 00166 #endif /* _ADC2 */ 00167 00168 #ifdef _AWU 00169 #include "stm8s_awu.h" 00170 #endif /* _AWU */ 00171 00172 #ifdef _BEEP 00173 #include "stm8s_beep.h" 00174 #endif /* _BEEP */ 00175 00176 #ifdef _CLK 00177 #include "stm8s_clk.h" 00178 #endif /* _CLK */ 00179 00180 #ifdef _EXTI 00181 #include "stm8s_exti.h" 00182 #endif /* _EXTI */ 00183 00184 #if defined(_FLASH) || defined(_OPT) 00185 #include "stm8s_flash.h" 00186 #endif /* _FLASH/OPT */ 00187 00188 #ifdef _GPIO 00189 #include "stm8s_gpio.h" 00190 #endif /* _GPIOx */ 00191 00192 #ifdef _I2C 00193 #include "stm8s_i2c.h" 00194 #endif /* _I2C */ 00195 00196 #ifdef _ITC 00197 #include "stm8s_itc.h" 00198 #endif /* _ITC */ 00199 00200 #ifdef _IWDG 00201 #include "stm8s_iwdg.h" 00202 #endif /* _IWDG */ 00203 00204 #ifdef _RST 00205 #include "stm8s_rst.h" 00206 #endif /* _RST */ 00207 00208 #ifdef _SPI 00209 #include "stm8s_spi.h" 00210 #endif /* _SPI */ 00211 00212 #ifdef _TIM1 00213 #include "stm8s_tim1.h" 00214 #endif /* _TIM1 */ 00215 00216 #ifdef _TIM2 00217 #include "stm8s_tim2.h" 00218 #endif /* _TIM2 */ 00219 00220 #ifdef _TIM3 00221 #include "stm8s_tim3.h" 00222 #endif /* _TIM3 */ 00223 00224 #ifdef _TIM4 00225 #include "stm8s_tim4.h" 00226 #endif /* _TIM4 */ 00227 00228 #ifdef _TIM5 00229 #include "stm8s_tim5.h" 00230 #endif /* _TIM5 */ 00231 00232 #ifdef _TIM6 00233 #include "stm8s_tim6.h" 00234 #endif /* _TIM6 */ 00235 00236 #ifdef _UART1 00237 #include "stm8s_uart1.h" 00238 #endif /* _UART1 */ 00239 00240 #ifdef _UART2 00241 #include "stm8s_uart2.h" 00242 #endif /* _UART2 */ 00243 00244 #ifdef _UART3 00245 #include "stm8s_uart3.h" 00246 #endif /* _UART3 */ 00247 00248 #ifdef _WWDG 00249 #include "stm8s_wwdg.h" 00250 #endif /* _WWDG */ 00251 00252 #ifdef _CAN 00253 #include "stm8s_can.h" 00254 #endif /* _CAN */ 00255 00256 #endif /* __STM8S_CONF_H */ 00257 00258 /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/