my fork

Dependents:   Nucleo_blueNRG

Fork of mbed by mbed official

Committer:
filartrix
Date:
Wed Apr 08 14:12:53 2015 +0000
Revision:
97:4298809c7c9e
Parent:
96:487b796308b0
First reale BlueNRG module for nucleo 401 board

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 84:0b3ab51c8877 1 /**
bogdanm 84:0b3ab51c8877 2 ******************************************************************************
bogdanm 84:0b3ab51c8877 3 * @file stm32l0xx_hal_smartcard_ex.h
bogdanm 84:0b3ab51c8877 4 * @author MCD Application Team
Kojto 96:487b796308b0 5 * @version V1.2.0
Kojto 96:487b796308b0 6 * @date 06-February-2015
bogdanm 84:0b3ab51c8877 7 * @brief Header file of SMARTCARD HAL module.
bogdanm 84:0b3ab51c8877 8 ******************************************************************************
bogdanm 84:0b3ab51c8877 9 * @attention
bogdanm 84:0b3ab51c8877 10 *
Kojto 96:487b796308b0 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
bogdanm 84:0b3ab51c8877 12 *
bogdanm 84:0b3ab51c8877 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 84:0b3ab51c8877 14 * are permitted provided that the following conditions are met:
bogdanm 84:0b3ab51c8877 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 84:0b3ab51c8877 16 * this list of conditions and the following disclaimer.
bogdanm 84:0b3ab51c8877 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 84:0b3ab51c8877 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 84:0b3ab51c8877 19 * and/or other materials provided with the distribution.
bogdanm 84:0b3ab51c8877 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 84:0b3ab51c8877 21 * may be used to endorse or promote products derived from this software
bogdanm 84:0b3ab51c8877 22 * without specific prior written permission.
bogdanm 84:0b3ab51c8877 23 *
bogdanm 84:0b3ab51c8877 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 84:0b3ab51c8877 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 84:0b3ab51c8877 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 84:0b3ab51c8877 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 84:0b3ab51c8877 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 84:0b3ab51c8877 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 84:0b3ab51c8877 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 84:0b3ab51c8877 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 84:0b3ab51c8877 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 84:0b3ab51c8877 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 84:0b3ab51c8877 34 *
bogdanm 84:0b3ab51c8877 35 ******************************************************************************
bogdanm 84:0b3ab51c8877 36 */
bogdanm 84:0b3ab51c8877 37
bogdanm 84:0b3ab51c8877 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 84:0b3ab51c8877 39 #ifndef __STM32L0xx_HAL_SMARTCARD_EX_H
bogdanm 84:0b3ab51c8877 40 #define __STM32L0xx_HAL_SMARTCARD_EX_H
bogdanm 84:0b3ab51c8877 41
bogdanm 84:0b3ab51c8877 42 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 43 extern "C" {
bogdanm 84:0b3ab51c8877 44 #endif
bogdanm 84:0b3ab51c8877 45
bogdanm 84:0b3ab51c8877 46 /* Includes ------------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 47 #include "stm32l0xx_hal_def.h"
bogdanm 84:0b3ab51c8877 48
bogdanm 84:0b3ab51c8877 49 /** @addtogroup STM32L0xx_HAL_Driver
bogdanm 84:0b3ab51c8877 50 * @{
bogdanm 84:0b3ab51c8877 51 */
bogdanm 84:0b3ab51c8877 52
Kojto 96:487b796308b0 53 /** @defgroup SMARTCARDEx SMARTCARDEx
bogdanm 84:0b3ab51c8877 54 * @{
bogdanm 84:0b3ab51c8877 55 */
bogdanm 84:0b3ab51c8877 56
bogdanm 84:0b3ab51c8877 57 /* Exported types ------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 58 /* Exported constants --------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 59 /* Exported macro ------------------------------------------------------------*/
bogdanm 84:0b3ab51c8877 60
bogdanm 84:0b3ab51c8877 61 /** @brief Reports the SMARTCARD clock source.
bogdanm 84:0b3ab51c8877 62 * @param __HANDLE__: specifies the USART Handle
bogdanm 84:0b3ab51c8877 63 * @param __CLOCKSOURCE__ : output variable
bogdanm 84:0b3ab51c8877 64 * @retval the USART clocking source, written in __CLOCKSOURCE__.
bogdanm 84:0b3ab51c8877 65 */
Kojto 96:487b796308b0 66 #if defined (STM32L031xx) || defined (STM32L041xx)
Kojto 96:487b796308b0 67 #define SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
Kojto 96:487b796308b0 68 do { \
Kojto 96:487b796308b0 69 if((__HANDLE__)->Instance == USART2) \
Kojto 96:487b796308b0 70 { \
Kojto 96:487b796308b0 71 switch(__HAL_RCC_GET_USART2_SOURCE()) \
Kojto 96:487b796308b0 72 { \
Kojto 96:487b796308b0 73 case RCC_USART2CLKSOURCE_PCLK1: \
Kojto 96:487b796308b0 74 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
Kojto 96:487b796308b0 75 break; \
Kojto 96:487b796308b0 76 case RCC_USART2CLKSOURCE_HSI: \
Kojto 96:487b796308b0 77 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
Kojto 96:487b796308b0 78 break; \
Kojto 96:487b796308b0 79 case RCC_USART2CLKSOURCE_SYSCLK: \
Kojto 96:487b796308b0 80 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
Kojto 96:487b796308b0 81 break; \
Kojto 96:487b796308b0 82 case RCC_USART2CLKSOURCE_LSE: \
Kojto 96:487b796308b0 83 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
Kojto 96:487b796308b0 84 break; \
Kojto 96:487b796308b0 85 default: \
Kojto 96:487b796308b0 86 break; \
Kojto 96:487b796308b0 87 } \
Kojto 96:487b796308b0 88 } \
Kojto 96:487b796308b0 89 } while(0)
Kojto 96:487b796308b0 90
Kojto 96:487b796308b0 91 #else /* (STM32L031xx) || defined (STM32L041xx) */
Kojto 96:487b796308b0 92
Kojto 96:487b796308b0 93 #define SMARTCARD_GETCLOCKSOURCE(__HANDLE__,__CLOCKSOURCE__) \
bogdanm 84:0b3ab51c8877 94 do { \
bogdanm 84:0b3ab51c8877 95 if((__HANDLE__)->Instance == USART1) \
bogdanm 84:0b3ab51c8877 96 { \
bogdanm 84:0b3ab51c8877 97 switch(__HAL_RCC_GET_USART1_SOURCE()) \
bogdanm 84:0b3ab51c8877 98 { \
bogdanm 84:0b3ab51c8877 99 case RCC_USART1CLKSOURCE_PCLK2: \
bogdanm 84:0b3ab51c8877 100 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK2; \
bogdanm 84:0b3ab51c8877 101 break; \
bogdanm 84:0b3ab51c8877 102 case RCC_USART1CLKSOURCE_HSI: \
bogdanm 84:0b3ab51c8877 103 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
bogdanm 84:0b3ab51c8877 104 break; \
bogdanm 84:0b3ab51c8877 105 case RCC_USART1CLKSOURCE_SYSCLK: \
bogdanm 84:0b3ab51c8877 106 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
bogdanm 84:0b3ab51c8877 107 break; \
bogdanm 84:0b3ab51c8877 108 case RCC_USART1CLKSOURCE_LSE: \
bogdanm 84:0b3ab51c8877 109 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
bogdanm 84:0b3ab51c8877 110 break; \
bogdanm 84:0b3ab51c8877 111 default: \
bogdanm 84:0b3ab51c8877 112 break; \
bogdanm 84:0b3ab51c8877 113 } \
bogdanm 84:0b3ab51c8877 114 } \
bogdanm 84:0b3ab51c8877 115 else if((__HANDLE__)->Instance == USART2) \
bogdanm 84:0b3ab51c8877 116 { \
bogdanm 84:0b3ab51c8877 117 switch(__HAL_RCC_GET_USART2_SOURCE()) \
bogdanm 84:0b3ab51c8877 118 { \
bogdanm 84:0b3ab51c8877 119 case RCC_USART2CLKSOURCE_PCLK1: \
bogdanm 84:0b3ab51c8877 120 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_PCLK1; \
bogdanm 84:0b3ab51c8877 121 break; \
bogdanm 84:0b3ab51c8877 122 case RCC_USART2CLKSOURCE_HSI: \
bogdanm 84:0b3ab51c8877 123 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_HSI; \
bogdanm 84:0b3ab51c8877 124 break; \
bogdanm 84:0b3ab51c8877 125 case RCC_USART2CLKSOURCE_SYSCLK: \
bogdanm 84:0b3ab51c8877 126 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_SYSCLK; \
bogdanm 84:0b3ab51c8877 127 break; \
bogdanm 84:0b3ab51c8877 128 case RCC_USART2CLKSOURCE_LSE: \
bogdanm 84:0b3ab51c8877 129 (__CLOCKSOURCE__) = SMARTCARD_CLOCKSOURCE_LSE; \
bogdanm 84:0b3ab51c8877 130 break; \
bogdanm 84:0b3ab51c8877 131 default: \
bogdanm 84:0b3ab51c8877 132 break; \
bogdanm 84:0b3ab51c8877 133 } \
bogdanm 84:0b3ab51c8877 134 } \
bogdanm 84:0b3ab51c8877 135 } while(0)
Kojto 96:487b796308b0 136 #endif /* (STM32L031xx) || (STM32L041xx) */
bogdanm 84:0b3ab51c8877 137
bogdanm 84:0b3ab51c8877 138 /* Exported functions --------------------------------------------------------*/
Kojto 96:487b796308b0 139 /** @defgroup SMARTCARDEx_Exported_Functions SMARTCARD Extended Exported functions
Kojto 96:487b796308b0 140 * @{
Kojto 96:487b796308b0 141 */
Kojto 96:487b796308b0 142 /* Initialization/de-initialization functions ********************************/
Kojto 96:487b796308b0 143 /** @defgroup SMARTCARDEx_Exported_Functions_Group1 Extended Peripheral Control functions
Kojto 96:487b796308b0 144 * @{
Kojto 96:487b796308b0 145 */
Kojto 96:487b796308b0 146
bogdanm 84:0b3ab51c8877 147 /* Initialization and de-initialization functions ****************************/
bogdanm 84:0b3ab51c8877 148 /* IO operation functions *****************************************************/
bogdanm 84:0b3ab51c8877 149 /* Peripheral Control functions ***********************************************/
bogdanm 84:0b3ab51c8877 150 void HAL_SMARTCARDEx_BlockLength_Config(SMARTCARD_HandleTypeDef *hsc, uint8_t BlockLength);
bogdanm 84:0b3ab51c8877 151 void HAL_SMARTCARDEx_TimeOut_Config(SMARTCARD_HandleTypeDef *hsc, uint32_t TimeOutValue);
bogdanm 84:0b3ab51c8877 152 HAL_StatusTypeDef HAL_SMARTCARDEx_EnableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc);
bogdanm 84:0b3ab51c8877 153 HAL_StatusTypeDef HAL_SMARTCARDEx_DisableReceiverTimeOut(SMARTCARD_HandleTypeDef *hsc);
bogdanm 84:0b3ab51c8877 154
bogdanm 84:0b3ab51c8877 155 /* Peripheral State and Error functions ***************************************/
bogdanm 84:0b3ab51c8877 156
bogdanm 84:0b3ab51c8877 157 /**
bogdanm 84:0b3ab51c8877 158 * @}
bogdanm 84:0b3ab51c8877 159 */
bogdanm 84:0b3ab51c8877 160
bogdanm 84:0b3ab51c8877 161 /**
bogdanm 84:0b3ab51c8877 162 * @}
bogdanm 84:0b3ab51c8877 163 */
Kojto 96:487b796308b0 164
Kojto 96:487b796308b0 165 /**
Kojto 96:487b796308b0 166 * @}
Kojto 96:487b796308b0 167 */
Kojto 96:487b796308b0 168
Kojto 96:487b796308b0 169 /**
Kojto 96:487b796308b0 170 * @}
Kojto 96:487b796308b0 171 */
bogdanm 84:0b3ab51c8877 172 #ifdef __cplusplus
bogdanm 84:0b3ab51c8877 173 }
bogdanm 84:0b3ab51c8877 174 #endif
bogdanm 84:0b3ab51c8877 175
bogdanm 84:0b3ab51c8877 176 #endif /* __STM32L0xx_HAL_SMARTCARD_EX_H */
bogdanm 84:0b3ab51c8877 177
bogdanm 84:0b3ab51c8877 178 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
Kojto 96:487b796308b0 179