STM32303C_EVAL BSP User Manual
|
stm32303c_eval.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file stm32303c_eval.h 00004 * @author MCD Application Team 00005 * @brief This file contains definitions for STM32303C_EVAL's Leds, push-buttons 00006 * and COM port hardware resources. 00007 ****************************************************************************** 00008 * @attention 00009 * 00010 * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> 00011 * 00012 * Redistribution and use in source and binary forms, with or without modification, 00013 * are permitted provided that the following conditions are met: 00014 * 1. Redistributions of source code must retain the above copyright notice, 00015 * this list of conditions and the following disclaimer. 00016 * 2. Redistributions in binary form must reproduce the above copyright notice, 00017 * this list of conditions and the following disclaimer in the documentation 00018 * and/or other materials provided with the distribution. 00019 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00020 * may be used to endorse or promote products derived from this software 00021 * without specific prior written permission. 00022 * 00023 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00024 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00025 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00026 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00027 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00028 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00029 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00030 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00031 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00032 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00033 * 00034 ****************************************************************************** 00035 */ 00036 00037 /* Define to prevent recursive inclusion -------------------------------------*/ 00038 #ifndef __STM32303C_EVAL_H 00039 #define __STM32303C_EVAL_H 00040 00041 #ifdef __cplusplus 00042 extern "C" { 00043 #endif 00044 00045 /** @addtogroup BSP 00046 * @{ 00047 */ 00048 00049 /** @defgroup STM32303C_EVAL STM32303C-EVAL 00050 * @{ 00051 */ 00052 00053 /* Includes ------------------------------------------------------------------*/ 00054 #include "stm32f3xx_hal.h" 00055 00056 /** @defgroup STM32303C_EVAL_Common STM32303C-EVAL Common 00057 * @{ 00058 */ 00059 00060 /** @defgroup STM32303C_EVAL_Private_Constants Private Constants 00061 * @{ 00062 */ 00063 /** 00064 * @} 00065 */ 00066 00067 /** @defgroup STM32303C_EVAL_Private_Variables Private Variables 00068 * @{ 00069 */ 00070 /** 00071 * @} 00072 */ 00073 00074 /** @defgroup STM32303C_EVAL_Exported_Types Exported Types 00075 * @{ 00076 */ 00077 00078 /** 00079 * @brief LED Types Definition 00080 */ 00081 typedef enum 00082 { 00083 LED1 = 0, 00084 LED2 = 1, 00085 LED3 = 2, 00086 LED4 = 3, 00087 /* Color led aliases */ 00088 LED_GREEN = LED1, 00089 LED_ORANGE = LED2, 00090 LED_RED = LED3, 00091 LED_BLUE = LED4 00092 }Led_TypeDef; 00093 00094 /** 00095 * @brief BUTTON Types Definition 00096 */ 00097 typedef enum 00098 { 00099 BUTTON_KEY = 0, 00100 BUTTON_SEL = 1, 00101 BUTTON_LEFT = 2, 00102 BUTTON_RIGHT = 3, 00103 BUTTON_DOWN = 4, 00104 BUTTON_UP = 5 00105 }Button_TypeDef; 00106 00107 typedef enum 00108 { 00109 BUTTON_MODE_GPIO = 0, 00110 BUTTON_MODE_EXTI = 1 00111 }ButtonMode_TypeDef; 00112 00113 /** 00114 * @brief JOYSTICK Types Definition 00115 */ 00116 typedef enum 00117 { 00118 JOY_SEL = 0, 00119 JOY_LEFT = 1, 00120 JOY_RIGHT = 2, 00121 JOY_DOWN = 3, 00122 JOY_UP = 4, 00123 JOY_NONE = 5 00124 }JOYState_TypeDef; 00125 00126 typedef enum 00127 { 00128 JOY_MODE_GPIO = 0, 00129 JOY_MODE_EXTI = 1 00130 }JOYMode_TypeDef; 00131 00132 /** 00133 * @brief COM Types Definition 00134 */ 00135 typedef enum 00136 { 00137 COM1 = 0 00138 }COM_TypeDef; 00139 00140 /** 00141 * @} 00142 */ 00143 00144 /** @defgroup STM32303C_EVAL_Exported_Constants Exported Constants 00145 * @{ 00146 */ 00147 00148 /** 00149 * @brief Define for STM32303C_EVAL board 00150 */ 00151 00152 #if !defined (USE_STM32303C_EVAL) 00153 #define USE_STM32303C_EVAL 00154 #endif 00155 00156 00157 /** @defgroup STM32303C_EVAL_LED STM32303C-EVAL LED 00158 * @{ 00159 */ 00160 #define LEDn 4 00161 00162 #define LED1_PIN GPIO_PIN_8 00163 #define LED1_GPIO_PORT GPIOE 00164 #define LED1_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00165 #define LED1_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00166 00167 #define LED2_PIN GPIO_PIN_9 00168 #define LED2_GPIO_PORT GPIOE 00169 #define LED2_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00170 #define LED2_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00171 00172 #define LED3_PIN GPIO_PIN_10 00173 #define LED3_GPIO_PORT GPIOE 00174 #define LED3_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00175 #define LED3_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00176 00177 #define LED4_PIN GPIO_PIN_11 00178 #define LED4_GPIO_PORT GPIOE 00179 #define LED4_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00180 #define LED4_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00181 00182 #define LEDx_GPIO_CLK_ENABLE(__LED__) do { if ((__LED__) == LED1) LED1_GPIO_CLK_ENABLE(); else\ 00183 if ((__LED__) == LED2) LED2_GPIO_CLK_ENABLE(); else\ 00184 if ((__LED__) == LED3) LED3_GPIO_CLK_ENABLE(); else\ 00185 if ((__LED__) == LED4) LED4_GPIO_CLK_ENABLE();} while(0) 00186 00187 #define LEDx_GPIO_CLK_DISABLE(__LED__) (((__LED__) == LED1) ? LED1_GPIO_CLK_DISABLE() :\ 00188 ((__LED__) == LED2) ? LED2_GPIO_CLK_DISABLE() :\ 00189 ((__LED__) == LED3) ? LED3_GPIO_CLK_DISABLE() :\ 00190 ((__LED__) == LED4) ? LED4_GPIO_CLK_DISABLE() : 0 ) 00191 00192 /** 00193 * @} 00194 */ 00195 00196 /** @defgroup STM32303C_EVAL_BUTTON STM32303C-EVAL BUTTON 00197 * @{ 00198 */ 00199 #define JOYn 5 00200 #define BUTTONn 1 + JOYn 00201 00202 /** 00203 * @brief Key push-button 00204 */ 00205 #define KEY_BUTTON_PIN GPIO_PIN_6 00206 #define KEY_BUTTON_GPIO_PORT GPIOE 00207 #define KEY_BUTTON_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00208 #define KEY_BUTTON_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00209 #define KEY_BUTTON_EXTI_IRQn EXTI9_5_IRQn 00210 00211 /** 00212 * @brief Joystick Right push-button 00213 */ 00214 #define RIGHT_JOY_PIN GPIO_PIN_6 00215 #define RIGHT_JOY_GPIO_PORT GPIOD 00216 #define RIGHT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() 00217 #define RIGHT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() 00218 #define RIGHT_JOY_EXTI_IRQn EXTI9_5_IRQn 00219 00220 /** 00221 * @brief Joystick Left push-button 00222 */ 00223 #define LEFT_JOY_PIN GPIO_PIN_5 00224 #define LEFT_JOY_GPIO_PORT GPIOB 00225 #define LEFT_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 00226 #define LEFT_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() 00227 #define LEFT_JOY_EXTI_IRQn EXTI9_5_IRQn 00228 00229 /** 00230 * @brief Joystick Up push-button 00231 */ 00232 #define UP_JOY_PIN GPIO_PIN_7 00233 #define UP_JOY_GPIO_PORT GPIOE 00234 #define UP_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00235 #define UP_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00236 #define UP_JOY_EXTI_IRQn EXTI9_5_IRQn 00237 00238 /** 00239 * @brief Joystick Down push-button 00240 */ 00241 #define DOWN_JOY_PIN GPIO_PIN_5 00242 #define DOWN_JOY_GPIO_PORT GPIOD 00243 #define DOWN_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() 00244 #define DOWN_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() 00245 #define DOWN_JOY_EXTI_IRQn EXTI9_5_IRQn 00246 00247 /** 00248 * @brief Joystick Sel push-button 00249 */ 00250 #define SEL_JOY_PIN GPIO_PIN_13 00251 #define SEL_JOY_GPIO_PORT GPIOC 00252 #define SEL_JOY_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00253 #define SEL_JOY_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() 00254 #define SEL_JOY_EXTI_IRQn EXTI15_10_IRQn 00255 00256 #define BUTTONx_GPIO_CLK_ENABLE(__BUTTON__) do { if ((__BUTTON__) == BUTTON_KEY) KEY_BUTTON_GPIO_CLK_ENABLE(); else\ 00257 if ((__BUTTON__) == BUTTON_SEL) SEL_JOY_GPIO_CLK_ENABLE(); else\ 00258 if ((__BUTTON__) == BUTTON_LEFT) LEFT_JOY_GPIO_CLK_ENABLE(); else\ 00259 if ((__BUTTON__) == BUTTON_RIGHT) RIGHT_JOY_GPIO_CLK_ENABLE(); else\ 00260 if ((__BUTTON__) == BUTTON_DOWN) DOWN_JOY_GPIO_CLK_ENABLE(); else\ 00261 if ((__BUTTON__) == BUTTON_UP) UP_JOY_GPIO_CLK_ENABLE();} while(0) 00262 00263 #define BUTTONx_GPIO_CLK_DISABLE(__BUTTON__) (((__BUTTON__) == BUTTON_KEY) ? KEY_BUTTON_GPIO_CLK_DISABLE() :\ 00264 ((__BUTTON__) == BUTTON_SEL) ? SEL_JOY_GPIO_CLK_DISABLE() :\ 00265 ((__BUTTON__) == BUTTON_LEFT) ? LEFT_JOY_GPIO_CLK_DISABLE() :\ 00266 ((__BUTTON__) == BUTTON_RIGHT) ? RIGHT_JOY_GPIO_CLK_DISABLE() :\ 00267 ((__BUTTON__) == BUTTON_DOWN) ? DOWN_JOY_GPIO_CLK_DISABLE() :\ 00268 ((__BUTTON__) == BUTTON_UP) ? UP_JOY_GPIO_CLK_DISABLE() : 0 ) 00269 00270 #define JOYx_GPIO_CLK_ENABLE(__JOY__) do { if ((__JOY__) == JOY_SEL) SEL_JOY_GPIO_CLK_ENABLE(); else\ 00271 if ((__JOY__) == JOY_LEFT) LEFT_JOY_GPIO_CLK_ENABLE(); else\ 00272 if ((__JOY__) == JOY_RIGHT) RIGHT_JOY_GPIO_CLK_ENABLE(); else\ 00273 if ((__JOY__) == JOY_DOWN) DOWN_JOY_GPIO_CLK_ENABLE(); else\ 00274 if ((__JOY__) == JOY_UP) UP_JOY_GPIO_CLK_ENABLE();} while(0) 00275 00276 #define JOYx_GPIO_CLK_DISABLE(__JOY__) (((__JOY__) == JOY_SEL) ? SEL_JOY_GPIO_CLK_DISABLE() :\ 00277 ((__JOY__) == JOY_LEFT) ? LEFT_JOY_GPIO_CLK_DISABLE() :\ 00278 ((__JOY__) == JOY_RIGHT) ? RIGHT_JOY_GPIO_CLK_DISABLE() :\ 00279 ((__JOY__) == JOY_DOWN) ? DOWN_JOY_GPIO_CLK_DISABLE() :\ 00280 ((__JOY__) == JOY_UP) ? UP_JOY_GPIO_CLK_DISABLE() : 0 ) 00281 00282 /** 00283 * @} 00284 */ 00285 00286 /** @defgroup STM32303C_EVAL_COM STM32303C-EVAL COM 00287 * @{ 00288 */ 00289 #if defined(HAL_UART_MODULE_ENABLED) 00290 00291 #define COMn 1 00292 00293 /** 00294 * @brief Definition for COM port1, connected to USART1 00295 */ 00296 #define EVAL_COM1 USART1 00297 #define EVAL_COM1_CLK_ENABLE() __HAL_RCC_USART1_CLK_ENABLE() 00298 #define EVAL_COM1_CLK_DISABLE() __HAL_RCC_USART1_CLK_DISABLE() 00299 00300 #define EVAL_COM1_TX_PIN GPIO_PIN_4 00301 #define EVAL_COM1_TX_GPIO_PORT GPIOC 00302 #define EVAL_COM1_TX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00303 #define EVAL_COM1_TX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() 00304 #define EVAL_COM1_TX_AF GPIO_AF7_USART1 00305 00306 #define EVAL_COM1_RX_PIN GPIO_PIN_1 00307 #define EVAL_COM1_RX_GPIO_PORT GPIOE 00308 #define EVAL_COM1_RX_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00309 #define EVAL_COM1_RX_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00310 #define EVAL_COM1_RX_AF GPIO_AF7_USART1 00311 00312 #define EVAL_COM1_IRQn USART1_IRQn 00313 00314 #define COMx_CLK_ENABLE(__INDEX__) do { if ((__INDEX__) == COM1) EVAL_COM1_CLK_ENABLE();} while(0) 00315 #define COMx_CLK_DISABLE(__INDEX__) (((__INDEX__) == COM1) ? EVAL_COM1_CLK_DISABLE() : 0) 00316 00317 #define COMx_TX_GPIO_CLK_ENABLE(__INDEX__) do { if ((__INDEX__) == COM1) EVAL_COM1_TX_GPIO_CLK_ENABLE();} while(0) 00318 #define COMx_TX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == COM1) ? EVAL_COM1_TX_GPIO_CLK_DISABLE() : 0) 00319 00320 #define COMx_RX_GPIO_CLK_ENABLE(__INDEX__) do { if ((__INDEX__) == COM1) EVAL_COM1_RX_GPIO_CLK_ENABLE();} while(0) 00321 #define COMx_RX_GPIO_CLK_DISABLE(__INDEX__) (((__INDEX__) == COM1) ? EVAL_COM1_RX_GPIO_CLK_DISABLE() : 0) 00322 00323 #endif /* HAL_UART_MODULE_ENABLED */ 00324 00325 #if defined(HAL_I2C_MODULE_ENABLED) 00326 /*##################### I2Cx ###################################*/ 00327 /* User can use this section to tailor I2Cx instance used and associated 00328 resources */ 00329 /* Definition for I2Cx Pins */ 00330 #define EVAL_I2Cx_SCL_PIN GPIO_PIN_6 00331 #define EVAL_I2Cx_SCL_GPIO_PORT GPIOF 00332 #define EVAL_I2Cx_SDA_PIN GPIO_PIN_10 00333 #define EVAL_I2Cx_SDA_GPIO_PORT GPIOA 00334 #define EVAL_I2Cx_SCL_SDA_AF GPIO_AF4_I2C2 00335 00336 /* Definition for I2Cx clock resources */ 00337 #define EVAL_I2Cx I2C2 00338 #define EVAL_I2Cx_CLK_ENABLE() __HAL_RCC_I2C2_CLK_ENABLE() 00339 #define EVAL_I2Cx_SDA_GPIO_CLK_ENABLE() __HAL_RCC_GPIOA_CLK_ENABLE() 00340 #define EVAL_I2Cx_SCL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE() 00341 00342 #define EVAL_I2Cx_FORCE_RESET() __HAL_RCC_I2C2_FORCE_RESET() 00343 #define EVAL_I2Cx_RELEASE_RESET() __HAL_RCC_I2C2_RELEASE_RESET() 00344 00345 /* Definition for I2Cx's NVIC */ 00346 #define EVAL_I2Cx_EV_IRQn I2C2_EV_IRQn 00347 #define EVAL_I2Cx_EV_IRQHandler I2C2_EV_IRQHandler 00348 #define EVAL_I2Cx_ER_IRQn I2C2_ER_IRQn 00349 #define EVAL_I2Cx_ER_IRQHandler I2C2_ER_IRQHandler 00350 00351 /* I2C TIMING Register define when I2C clock source is SYSCLK */ 00352 /* I2C TIMING is calculated in case of the I2C Clock source is the SYSCLK = 72 MHz */ 00353 /* Set 0xC062121F value to reach 100 KHz speed (Rise time = 640ns, Fall time = 20ns) */ 00354 #ifndef EVAL_I2Cx_TIMING 00355 #define EVAL_I2Cx_TIMING 0xC062121F 00356 #endif /* EVAL_I2Cx_TIMING */ 00357 00358 /* Maximum Timeout values for flags waiting loops. These timeouts are not based 00359 on accurate values, they just guarantee that the application will not remain 00360 stuck if the I2C communication is corrupted. 00361 You may modify these timeout values depending on CPU frequency and application 00362 conditions (interrupts routines ...). */ 00363 #define EVAL_I2Cx_TIMEOUT_MAX 1000 00364 00365 #endif /* HAL_I2C_MODULE_ENABLED */ 00366 00367 #if defined(HAL_SPI_MODULE_ENABLED) 00368 /** 00369 * @brief Definition for SPI Interface pins (SPI2 used) 00370 */ 00371 #define EVAL_SPIx SPI2 00372 #define EVAL_SPIx_CLK_ENABLE() __HAL_RCC_SPI2_CLK_ENABLE() 00373 #define EVAL_SPIx_CLK_DISABLE() __HAL_RCC_SPI2_CLK_DISABLE() 00374 #define EVAL_SPIx_FORCE_RESET() __HAL_RCC_SPI2_FORCE_RESET() 00375 #define EVAL_SPIx_RELEASE_RESET() __HAL_RCC_SPI2_RELEASE_RESET() 00376 00377 #define EVAL_SPIx_SCK_AF GPIO_AF5_SPI2 00378 #define EVAL_SPIx_SCK_GPIO_PORT GPIOF 00379 #define EVAL_SPIx_SCK_PIN GPIO_PIN_9 00380 #define EVAL_SPIx_SCK_GPIO_CLK_ENABLE() __HAL_RCC_GPIOF_CLK_ENABLE() 00381 #define EVAL_SPIx_SCK_GPIO_CLK_DISABLE() __HAL_RCC_GPIOF_CLK_DISABLE() 00382 00383 #define EVAL_SPIx_MISO_MOSI_AF GPIO_AF5_SPI2 00384 #define EVAL_SPIx_MISO_MOSI_GPIO_PORT GPIOB 00385 #define EVAL_SPIx_MISO_MOSI_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE() 00386 #define EVAL_SPIx_MISO_MOSI_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE() 00387 #define EVAL_SPIx_MISO_PIN GPIO_PIN_14 00388 #define EVAL_SPIx_MOSI_PIN GPIO_PIN_15 00389 00390 /* Maximum Timeout values for flags waiting loops. These timeouts are not based 00391 on accurate values, they just guarantee that the application will not remain 00392 stuck if the SPI communication is corrupted. 00393 You may modify these timeout values depending on CPU frequency and application 00394 conditions (interrupts routines ...). */ 00395 #define EVAL_SPIx_TIMEOUT_MAX 1000 00396 00397 #endif /* HAL_SPI_MODULE_ENABLED */ 00398 /** 00399 * @} 00400 */ 00401 00402 00403 /** @defgroup STM32303C_EVAL_COMPONENT STM32303C-EVAL COMPONENT 00404 * @{ 00405 */ 00406 /*##################### LCD ###################################*/ 00407 /* Chip Select macro definition */ 00408 #define LCD_CS_LOW() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_RESET) 00409 #define LCD_CS_HIGH() HAL_GPIO_WritePin(LCD_NCS_GPIO_PORT, LCD_NCS_PIN, GPIO_PIN_SET) 00410 00411 /** 00412 * @brief LCD Control Interface pins 00413 */ 00414 #define LCD_NCS_PIN GPIO_PIN_0 /* PE.00 */ 00415 #define LCD_NCS_GPIO_PORT GPIOE 00416 #define LCD_NCS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00417 #define LCD_NCS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00418 00419 /*##################### SD ###################################*/ 00420 /* Chip Select macro definition */ 00421 #define SD_CS_LOW() HAL_GPIO_WritePin(SD_CS_GPIO_PORT, SD_CS_PIN, GPIO_PIN_RESET) 00422 #define SD_CS_HIGH() HAL_GPIO_WritePin(SD_CS_GPIO_PORT, SD_CS_PIN, GPIO_PIN_SET) 00423 00424 /** 00425 * @brief SD card Control pins 00426 */ 00427 #define SD_CS_PIN GPIO_PIN_15 /* PE.15 */ 00428 #define SD_CS_GPIO_PORT GPIOE 00429 #define SD_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE() 00430 #define SD_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE() 00431 00432 /** 00433 * @brief SD Detect Interface pins 00434 */ 00435 #define SD_DETECT_PIN GPIO_PIN_6 /* PC.06 */ 00436 #define SD_DETECT_GPIO_PORT GPIOC 00437 #define SD_DETECT_GPIO_CLK_ENABLE() __HAL_RCC_GPIOC_CLK_ENABLE() 00438 #define SD_DETECT_GPIO_CLK_DISABLE() __HAL_RCC_GPIOC_CLK_DISABLE() 00439 #define SD_DETECT_EXTI_IRQn EXTI9_5_IRQn 00440 00441 /*##################### EEPROM SPI ###################################*/ 00442 /* Chip Select macro definition */ 00443 #define EEPROM_CS_LOW() HAL_GPIO_WritePin(EEPROM_CS_GPIO_PORT, EEPROM_CS_PIN, GPIO_PIN_RESET) 00444 #define EEPROM_CS_HIGH() HAL_GPIO_WritePin(EEPROM_CS_GPIO_PORT, EEPROM_CS_PIN, GPIO_PIN_SET) 00445 00446 /** 00447 * @brief EEPROM Control Interface pins 00448 */ 00449 #define EEPROM_CS_PIN GPIO_PIN_7 00450 #define EEPROM_CS_GPIO_PORT GPIOD 00451 #define EEPROM_CS_GPIO_CLK_ENABLE() __HAL_RCC_GPIOD_CLK_ENABLE() 00452 #define EEPROM_CS_GPIO_CLK_DISABLE() __HAL_RCC_GPIOD_CLK_DISABLE() 00453 /** 00454 * @} 00455 */ 00456 00457 /** 00458 * @} 00459 */ 00460 00461 /** @defgroup STM32303C_EVAL_Exported_Functions Exported Functions 00462 * @{ 00463 */ 00464 uint32_t BSP_GetVersion(void); 00465 void BSP_LED_Init(Led_TypeDef Led); 00466 void BSP_LED_On(Led_TypeDef Led); 00467 void BSP_LED_Off(Led_TypeDef Led); 00468 void BSP_LED_Toggle(Led_TypeDef Led); 00469 void BSP_PB_Init(Button_TypeDef Button, ButtonMode_TypeDef Button_Mode); 00470 uint32_t BSP_PB_GetState(Button_TypeDef Button); 00471 uint8_t BSP_JOY_Init(JOYMode_TypeDef Joy_Mode); 00472 JOYState_TypeDef BSP_JOY_GetState(void); 00473 #if defined(HAL_UART_MODULE_ENABLED) 00474 void BSP_COM_Init(COM_TypeDef COM, UART_HandleTypeDef* huart); 00475 #endif /* HAL_UART_MODULE_ENABLED */ 00476 00477 /** 00478 * @} 00479 */ 00480 00481 /** 00482 * @} 00483 */ 00484 00485 /** 00486 * @} 00487 */ 00488 00489 /** 00490 * @} 00491 */ 00492 00493 #ifdef __cplusplus 00494 } 00495 #endif 00496 00497 #endif /* __H */ 00498 00499 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Generated on Wed May 31 2017 10:00:44 for STM32303C_EVAL BSP User Manual by 1.7.6.1