A simple 128x32 graphical LCD program to quickstart with LCD on ARM mbed IoT Starter Kit. This requires mbed Applciation Shield with FRDM-K64F platform.
mbed/TARGET_NUCLEO_F334R8/stm32f3xx_hal_smartcard_ex.h@1:eb68c94a8ee5, 2015-04-12 (annotated)
- Committer:
- tushki7
- Date:
- Sun Apr 12 15:45:52 2015 +0000
- Revision:
- 1:eb68c94a8ee5
- Parent:
- 0:60d829a0353a
A simple 128x32 LCD program with ARM mbed IoT Starter Kit;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tushki7 | 0:60d829a0353a | 1 | /** |
tushki7 | 0:60d829a0353a | 2 | ****************************************************************************** |
tushki7 | 0:60d829a0353a | 3 | * @file stm32f3xx_hal_smartcard_ex.h |
tushki7 | 0:60d829a0353a | 4 | * @author MCD Application Team |
tushki7 | 0:60d829a0353a | 5 | * @version V1.1.0 |
tushki7 | 0:60d829a0353a | 6 | * @date 12-Sept-2014 |
tushki7 | 0:60d829a0353a | 7 | * @brief Header file of SMARTCARD HAL module. |
tushki7 | 0:60d829a0353a | 8 | ****************************************************************************** |
tushki7 | 0:60d829a0353a | 9 | * @attention |
tushki7 | 0:60d829a0353a | 10 | * |
tushki7 | 0:60d829a0353a | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
tushki7 | 0:60d829a0353a | 12 | * |
tushki7 | 0:60d829a0353a | 13 | * Redistribution and use in source and binary forms, with or without modification, |
tushki7 | 0:60d829a0353a | 14 | * are permitted provided that the following conditions are met: |
tushki7 | 0:60d829a0353a | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
tushki7 | 0:60d829a0353a | 16 | * this list of conditions and the following disclaimer. |
tushki7 | 0:60d829a0353a | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
tushki7 | 0:60d829a0353a | 18 | * this list of conditions and the following disclaimer in the documentation |
tushki7 | 0:60d829a0353a | 19 | * and/or other materials provided with the distribution. |
tushki7 | 0:60d829a0353a | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
tushki7 | 0:60d829a0353a | 21 | * may be used to endorse or promote products derived from this software |
tushki7 | 0:60d829a0353a | 22 | * without specific prior written permission. |
tushki7 | 0:60d829a0353a | 23 | * |
tushki7 | 0:60d829a0353a | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
tushki7 | 0:60d829a0353a | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
tushki7 | 0:60d829a0353a | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
tushki7 | 0:60d829a0353a | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
tushki7 | 0:60d829a0353a | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
tushki7 | 0:60d829a0353a | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
tushki7 | 0:60d829a0353a | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
tushki7 | 0:60d829a0353a | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
tushki7 | 0:60d829a0353a | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
tushki7 | 0:60d829a0353a | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
tushki7 | 0:60d829a0353a | 34 | * |
tushki7 | 0:60d829a0353a | 35 | ****************************************************************************** |
tushki7 | 0:60d829a0353a | 36 | */ |
tushki7 | 0:60d829a0353a | 37 | |
tushki7 | 0:60d829a0353a | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
tushki7 | 0:60d829a0353a | 39 | #ifndef __STM32F3xx_HAL_SMARTCARD_EX_H |
tushki7 | 0:60d829a0353a | 40 | #define __STM32F3xx_HAL_SMARTCARD_EX_H |
tushki7 | 0:60d829a0353a | 41 | |
tushki7 | 0:60d829a0353a | 42 | #ifdef __cplusplus |
tushki7 | 0:60d829a0353a | 43 | extern "C" { |
tushki7 | 0:60d829a0353a | 44 | #endif |
tushki7 | 0:60d829a0353a | 45 | |
tushki7 | 0:60d829a0353a | 46 | /* Includes ------------------------------------------------------------------*/ |
tushki7 | 0:60d829a0353a | 47 | #include "stm32f3xx_hal_def.h" |
tushki7 | 0:60d829a0353a | 48 | |
tushki7 | 0:60d829a0353a | 49 | /** @addtogroup STM32F3xx_HAL_Driver |
tushki7 | 0:60d829a0353a | 50 | * @{ |
tushki7 | 0:60d829a0353a | 51 | */ |
tushki7 | 0:60d829a0353a | 52 | |
tushki7 | 0:60d829a0353a | 53 | /** @addtogroup SMARTCARDEx SMARTCARD Extended HAL module driver |
tushki7 | 0:60d829a0353a | 54 | * @{ |
tushki7 | 0:60d829a0353a | 55 | */ |
tushki7 | 0:60d829a0353a | 56 | |
tushki7 | 0:60d829a0353a | 57 | /* Exported types ------------------------------------------------------------*/ |
tushki7 | 0:60d829a0353a | 58 | /* Exported constants --------------------------------------------------------*/ |
tushki7 | 0:60d829a0353a | 59 | /* Exported macro ------------------------------------------------------------*/ |
tushki7 | 0:60d829a0353a | 60 | |
tushki7 | 0:60d829a0353a | 61 | /** @defgroup SMARTCARDEx_Exported_Macros SMARTCARD Extended Exported Macros |
tushki7 | 0:60d829a0353a | 62 | * @{ |
tushki7 | 0:60d829a0353a | 63 | */ |
tushki7 | 0:60d829a0353a | 64 | |
tushki7 | 0:60d829a0353a | 65 | /** @brief Reports the SMARTCARD clock source. |
tushki7 | 0:60d829a0353a | 66 | * @param __HANDLE__: specifies the SMARTCARD Handle |
tushki7 | 0:60d829a0353a | 67 | * @param __CLOCKSOURCE__ : output variable |
tushki7 | 0:60d829a0353a | 68 | * @retval the SMARTCARD clocking source, written in __CLOCKSOURCE__. |
tushki7 | 0:60d829a0353a | 69 | */ |
tushki7 | 0:60d829a0353a | 70 | #if defined(STM32F334x8) || defined(STM32F303x8) || defined(STM32F328xx) |
tushki7 | 0:60d829a0353a | 71 | #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ |
tushki7 | 0:60d829a0353a | 72 | do { \ |
tushki7 | 0:60d829a0353a | 73 | if((__HANDLE__)->Instance == USART1) \ |
tushki7 | 0:60d829a0353a | 74 | { \ |
tushki7 | 0:60d829a0353a | 75 | switch(__HAL_RCC_GET_USART1_SOURCE()) \ |
tushki7 | 0:60d829a0353a | 76 | { \ |
tushki7 | 0:60d829a0353a | 77 | case RCC_USART1CLKSOURCE_PCLK1: \ |
tushki7 | 0:60d829a0353a | 78 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
tushki7 | 0:60d829a0353a | 79 | break; \ |
tushki7 | 0:60d829a0353a | 80 | case RCC_USART1CLKSOURCE_HSI: \ |
tushki7 | 0:60d829a0353a | 81 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
tushki7 | 0:60d829a0353a | 82 | break; \ |
tushki7 | 0:60d829a0353a | 83 | case RCC_USART1CLKSOURCE_SYSCLK: \ |
tushki7 | 0:60d829a0353a | 84 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
tushki7 | 0:60d829a0353a | 85 | break; \ |
tushki7 | 0:60d829a0353a | 86 | case RCC_USART1CLKSOURCE_LSE: \ |
tushki7 | 0:60d829a0353a | 87 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
tushki7 | 0:60d829a0353a | 88 | break; \ |
tushki7 | 0:60d829a0353a | 89 | } \ |
tushki7 | 0:60d829a0353a | 90 | } \ |
tushki7 | 0:60d829a0353a | 91 | else if((__HANDLE__)->Instance == USART2) \ |
tushki7 | 0:60d829a0353a | 92 | { \ |
tushki7 | 0:60d829a0353a | 93 | switch(__HAL_RCC_GET_USART2_SOURCE()) \ |
tushki7 | 0:60d829a0353a | 94 | { \ |
tushki7 | 0:60d829a0353a | 95 | case RCC_USART2CLKSOURCE_PCLK1: \ |
tushki7 | 0:60d829a0353a | 96 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
tushki7 | 0:60d829a0353a | 97 | break; \ |
tushki7 | 0:60d829a0353a | 98 | case RCC_USART2CLKSOURCE_HSI: \ |
tushki7 | 0:60d829a0353a | 99 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
tushki7 | 0:60d829a0353a | 100 | break; \ |
tushki7 | 0:60d829a0353a | 101 | case RCC_USART2CLKSOURCE_SYSCLK: \ |
tushki7 | 0:60d829a0353a | 102 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
tushki7 | 0:60d829a0353a | 103 | break; \ |
tushki7 | 0:60d829a0353a | 104 | case RCC_USART2CLKSOURCE_LSE: \ |
tushki7 | 0:60d829a0353a | 105 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
tushki7 | 0:60d829a0353a | 106 | break; \ |
tushki7 | 0:60d829a0353a | 107 | } \ |
tushki7 | 0:60d829a0353a | 108 | } \ |
tushki7 | 0:60d829a0353a | 109 | else if((__HANDLE__)->Instance == USART3) \ |
tushki7 | 0:60d829a0353a | 110 | { \ |
tushki7 | 0:60d829a0353a | 111 | switch(__HAL_RCC_GET_USART3_SOURCE()) \ |
tushki7 | 0:60d829a0353a | 112 | { \ |
tushki7 | 0:60d829a0353a | 113 | case RCC_USART3CLKSOURCE_PCLK1: \ |
tushki7 | 0:60d829a0353a | 114 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
tushki7 | 0:60d829a0353a | 115 | break; \ |
tushki7 | 0:60d829a0353a | 116 | case RCC_USART3CLKSOURCE_HSI: \ |
tushki7 | 0:60d829a0353a | 117 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
tushki7 | 0:60d829a0353a | 118 | break; \ |
tushki7 | 0:60d829a0353a | 119 | case RCC_USART3CLKSOURCE_SYSCLK: \ |
tushki7 | 0:60d829a0353a | 120 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
tushki7 | 0:60d829a0353a | 121 | break; \ |
tushki7 | 0:60d829a0353a | 122 | case RCC_USART3CLKSOURCE_LSE: \ |
tushki7 | 0:60d829a0353a | 123 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
tushki7 | 0:60d829a0353a | 124 | break; \ |
tushki7 | 0:60d829a0353a | 125 | } \ |
tushki7 | 0:60d829a0353a | 126 | } \ |
tushki7 | 0:60d829a0353a | 127 | } while(0) |
tushki7 | 0:60d829a0353a | 128 | #else |
tushki7 | 0:60d829a0353a | 129 | #define __HAL_SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \ |
tushki7 | 0:60d829a0353a | 130 | do { \ |
tushki7 | 0:60d829a0353a | 131 | if((__HANDLE__)->Instance == USART1) \ |
tushki7 | 0:60d829a0353a | 132 | { \ |
tushki7 | 0:60d829a0353a | 133 | switch(__HAL_RCC_GET_USART1_SOURCE()) \ |
tushki7 | 0:60d829a0353a | 134 | { \ |
tushki7 | 0:60d829a0353a | 135 | case RCC_USART1CLKSOURCE_PCLK2: \ |
tushki7 | 0:60d829a0353a | 136 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2; \ |
tushki7 | 0:60d829a0353a | 137 | break; \ |
tushki7 | 0:60d829a0353a | 138 | case RCC_USART1CLKSOURCE_HSI: \ |
tushki7 | 0:60d829a0353a | 139 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
tushki7 | 0:60d829a0353a | 140 | break; \ |
tushki7 | 0:60d829a0353a | 141 | case RCC_USART1CLKSOURCE_SYSCLK: \ |
tushki7 | 0:60d829a0353a | 142 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
tushki7 | 0:60d829a0353a | 143 | break; \ |
tushki7 | 0:60d829a0353a | 144 | case RCC_USART1CLKSOURCE_LSE: \ |
tushki7 | 0:60d829a0353a | 145 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
tushki7 | 0:60d829a0353a | 146 | break; \ |
tushki7 | 0:60d829a0353a | 147 | } \ |
tushki7 | 0:60d829a0353a | 148 | } \ |
tushki7 | 0:60d829a0353a | 149 | else if((__HANDLE__)->Instance == USART2) \ |
tushki7 | 0:60d829a0353a | 150 | { \ |
tushki7 | 0:60d829a0353a | 151 | switch(__HAL_RCC_GET_USART2_SOURCE()) \ |
tushki7 | 0:60d829a0353a | 152 | { \ |
tushki7 | 0:60d829a0353a | 153 | case RCC_USART2CLKSOURCE_PCLK1: \ |
tushki7 | 0:60d829a0353a | 154 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
tushki7 | 0:60d829a0353a | 155 | break; \ |
tushki7 | 0:60d829a0353a | 156 | case RCC_USART2CLKSOURCE_HSI: \ |
tushki7 | 0:60d829a0353a | 157 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
tushki7 | 0:60d829a0353a | 158 | break; \ |
tushki7 | 0:60d829a0353a | 159 | case RCC_USART2CLKSOURCE_SYSCLK: \ |
tushki7 | 0:60d829a0353a | 160 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
tushki7 | 0:60d829a0353a | 161 | break; \ |
tushki7 | 0:60d829a0353a | 162 | case RCC_USART2CLKSOURCE_LSE: \ |
tushki7 | 0:60d829a0353a | 163 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
tushki7 | 0:60d829a0353a | 164 | break; \ |
tushki7 | 0:60d829a0353a | 165 | } \ |
tushki7 | 0:60d829a0353a | 166 | } \ |
tushki7 | 0:60d829a0353a | 167 | else if((__HANDLE__)->Instance == USART3) \ |
tushki7 | 0:60d829a0353a | 168 | { \ |
tushki7 | 0:60d829a0353a | 169 | switch(__HAL_RCC_GET_USART3_SOURCE()) \ |
tushki7 | 0:60d829a0353a | 170 | { \ |
tushki7 | 0:60d829a0353a | 171 | case RCC_USART3CLKSOURCE_PCLK1: \ |
tushki7 | 0:60d829a0353a | 172 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \ |
tushki7 | 0:60d829a0353a | 173 | break; \ |
tushki7 | 0:60d829a0353a | 174 | case RCC_USART3CLKSOURCE_HSI: \ |
tushki7 | 0:60d829a0353a | 175 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \ |
tushki7 | 0:60d829a0353a | 176 | break; \ |
tushki7 | 0:60d829a0353a | 177 | case RCC_USART3CLKSOURCE_SYSCLK: \ |
tushki7 | 0:60d829a0353a | 178 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \ |
tushki7 | 0:60d829a0353a | 179 | break; \ |
tushki7 | 0:60d829a0353a | 180 | case RCC_USART3CLKSOURCE_LSE: \ |
tushki7 | 0:60d829a0353a | 181 | (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \ |
tushki7 | 0:60d829a0353a | 182 | break; \ |
tushki7 | 0:60d829a0353a | 183 | } \ |
tushki7 | 0:60d829a0353a | 184 | } \ |
tushki7 | 0:60d829a0353a | 185 | } while(0) |
tushki7 | 0:60d829a0353a | 186 | #endif |
tushki7 | 0:60d829a0353a | 187 | |
tushki7 | 0:60d829a0353a | 188 | /** |
tushki7 | 0:60d829a0353a | 189 | * @} |
tushki7 | 0:60d829a0353a | 190 | */ |
tushki7 | 0:60d829a0353a | 191 | |
tushki7 | 0:60d829a0353a | 192 | |
tushki7 | 0:60d829a0353a | 193 | /* Exported functions --------------------------------------------------------*/ |
tushki7 | 0:60d829a0353a | 194 | /** @addtogroup SMARTCARDEx_Exported_Functions SMARTCARD Extended Exported Functions |
tushki7 | 0:60d829a0353a | 195 | * @{ |
tushki7 | 0:60d829a0353a | 196 | */ |
tushki7 | 0:60d829a0353a | 197 | |
tushki7 | 0:60d829a0353a | 198 | /* Initialization and de-initialization functions ****************************/ |
tushki7 | 0:60d829a0353a | 199 | /* IO operation functions *****************************************************/ |
tushki7 | 0:60d829a0353a | 200 | /* Peripheral Control functions ***********************************************/ |
tushki7 | 0:60d829a0353a | 201 | /** @addtogroup SMARTCARDEx_Exported_Functions_Group1 Extended Peripheral Control functions |
tushki7 | 0:60d829a0353a | 202 | * @{ |
tushki7 | 0:60d829a0353a | 203 | */ |
tushki7 | 0:60d829a0353a | 204 | void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint8_t BlockLength); |
tushki7 | 0:60d829a0353a | 205 | void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsmartcard, uint32_t TimeOutValue); |
tushki7 | 0:60d829a0353a | 206 | HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard); |
tushki7 | 0:60d829a0353a | 207 | HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsmartcard); |
tushki7 | 0:60d829a0353a | 208 | |
tushki7 | 0:60d829a0353a | 209 | /* Peripheral State and Error functions ***************************************/ |
tushki7 | 0:60d829a0353a | 210 | |
tushki7 | 0:60d829a0353a | 211 | /** |
tushki7 | 0:60d829a0353a | 212 | * @} |
tushki7 | 0:60d829a0353a | 213 | */ |
tushki7 | 0:60d829a0353a | 214 | |
tushki7 | 0:60d829a0353a | 215 | /** |
tushki7 | 0:60d829a0353a | 216 | * @} |
tushki7 | 0:60d829a0353a | 217 | */ |
tushki7 | 0:60d829a0353a | 218 | |
tushki7 | 0:60d829a0353a | 219 | /** |
tushki7 | 0:60d829a0353a | 220 | * @} |
tushki7 | 0:60d829a0353a | 221 | */ |
tushki7 | 0:60d829a0353a | 222 | |
tushki7 | 0:60d829a0353a | 223 | /** |
tushki7 | 0:60d829a0353a | 224 | * @} |
tushki7 | 0:60d829a0353a | 225 | */ |
tushki7 | 0:60d829a0353a | 226 | |
tushki7 | 0:60d829a0353a | 227 | #ifdef __cplusplus |
tushki7 | 0:60d829a0353a | 228 | } |
tushki7 | 0:60d829a0353a | 229 | #endif |
tushki7 | 0:60d829a0353a | 230 | |
tushki7 | 0:60d829a0353a | 231 | #endif /* __STM32F3xx_HAL_SMARTCARD_EX_H */ |
tushki7 | 0:60d829a0353a | 232 | |
tushki7 | 0:60d829a0353a | 233 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |