mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Feb 03 09:30:05 2014 +0000
Revision:
84:f54042cbc282
Parent:
70:c1fbde68b492
Synchronized with git revision bbbd8699601c42149ccf0c37bc42bb6856ccc4c6

Full URL: https://github.com/mbedmicro/mbed/commit/bbbd8699601c42149ccf0c37bc42bb6856ccc4c6/

[NUCLEO_L152RE/F030_R8] SPI, I2C, Ticker, PWM updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 52:a51c77007319 1 /**
mbed_official 52:a51c77007319 2 ******************************************************************************
mbed_official 52:a51c77007319 3 * @file stm32f10x_cec.h
mbed_official 52:a51c77007319 4 * @author MCD Application Team
mbed_official 84:f54042cbc282 5 * @version V3.6.1
mbed_official 84:f54042cbc282 6 * @date 05-March-2012
mbed_official 52:a51c77007319 7 * @brief This file contains all the functions prototypes for the CEC firmware
mbed_official 52:a51c77007319 8 * library.
mbed_official 70:c1fbde68b492 9 *******************************************************************************
mbed_official 70:c1fbde68b492 10 * Copyright (c) 2014, STMicroelectronics
mbed_official 70:c1fbde68b492 11 * All rights reserved.
mbed_official 70:c1fbde68b492 12 *
mbed_official 70:c1fbde68b492 13 * Redistribution and use in source and binary forms, with or without
mbed_official 70:c1fbde68b492 14 * modification, are permitted provided that the following conditions are met:
mbed_official 70:c1fbde68b492 15 *
mbed_official 70:c1fbde68b492 16 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 70:c1fbde68b492 17 * this list of conditions and the following disclaimer.
mbed_official 70:c1fbde68b492 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 70:c1fbde68b492 19 * this list of conditions and the following disclaimer in the documentation
mbed_official 70:c1fbde68b492 20 * and/or other materials provided with the distribution.
mbed_official 70:c1fbde68b492 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 70:c1fbde68b492 22 * may be used to endorse or promote products derived from this software
mbed_official 70:c1fbde68b492 23 * without specific prior written permission.
mbed_official 70:c1fbde68b492 24 *
mbed_official 70:c1fbde68b492 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 70:c1fbde68b492 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 70:c1fbde68b492 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 70:c1fbde68b492 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 70:c1fbde68b492 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 70:c1fbde68b492 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 70:c1fbde68b492 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 70:c1fbde68b492 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 70:c1fbde68b492 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 70:c1fbde68b492 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 70:c1fbde68b492 35 *******************************************************************************
mbed_official 70:c1fbde68b492 36 */
mbed_official 52:a51c77007319 37
mbed_official 52:a51c77007319 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 52:a51c77007319 39 #ifndef __STM32F10x_CEC_H
mbed_official 52:a51c77007319 40 #define __STM32F10x_CEC_H
mbed_official 52:a51c77007319 41
mbed_official 52:a51c77007319 42 #ifdef __cplusplus
mbed_official 52:a51c77007319 43 extern "C" {
mbed_official 52:a51c77007319 44 #endif
mbed_official 52:a51c77007319 45
mbed_official 52:a51c77007319 46 /* Includes ------------------------------------------------------------------*/
mbed_official 52:a51c77007319 47 #include "stm32f10x.h"
mbed_official 52:a51c77007319 48
mbed_official 52:a51c77007319 49 /** @addtogroup STM32F10x_StdPeriph_Driver
mbed_official 52:a51c77007319 50 * @{
mbed_official 52:a51c77007319 51 */
mbed_official 52:a51c77007319 52
mbed_official 52:a51c77007319 53 /** @addtogroup CEC
mbed_official 52:a51c77007319 54 * @{
mbed_official 52:a51c77007319 55 */
mbed_official 52:a51c77007319 56
mbed_official 52:a51c77007319 57
mbed_official 52:a51c77007319 58 /** @defgroup CEC_Exported_Types
mbed_official 52:a51c77007319 59 * @{
mbed_official 52:a51c77007319 60 */
mbed_official 52:a51c77007319 61
mbed_official 52:a51c77007319 62 /**
mbed_official 52:a51c77007319 63 * @brief CEC Init structure definition
mbed_official 52:a51c77007319 64 */
mbed_official 52:a51c77007319 65 typedef struct
mbed_official 52:a51c77007319 66 {
mbed_official 52:a51c77007319 67 uint16_t CEC_BitTimingMode; /*!< Configures the CEC Bit Timing Error Mode.
mbed_official 52:a51c77007319 68 This parameter can be a value of @ref CEC_BitTiming_Mode */
mbed_official 52:a51c77007319 69 uint16_t CEC_BitPeriodMode; /*!< Configures the CEC Bit Period Error Mode.
mbed_official 52:a51c77007319 70 This parameter can be a value of @ref CEC_BitPeriod_Mode */
mbed_official 52:a51c77007319 71 }CEC_InitTypeDef;
mbed_official 52:a51c77007319 72
mbed_official 52:a51c77007319 73 /**
mbed_official 52:a51c77007319 74 * @}
mbed_official 52:a51c77007319 75 */
mbed_official 52:a51c77007319 76
mbed_official 52:a51c77007319 77 /** @defgroup CEC_Exported_Constants
mbed_official 52:a51c77007319 78 * @{
mbed_official 52:a51c77007319 79 */
mbed_official 52:a51c77007319 80
mbed_official 52:a51c77007319 81 /** @defgroup CEC_BitTiming_Mode
mbed_official 52:a51c77007319 82 * @{
mbed_official 52:a51c77007319 83 */
mbed_official 52:a51c77007319 84 #define CEC_BitTimingStdMode ((uint16_t)0x00) /*!< Bit timing error Standard Mode */
mbed_official 52:a51c77007319 85 #define CEC_BitTimingErrFreeMode CEC_CFGR_BTEM /*!< Bit timing error Free Mode */
mbed_official 52:a51c77007319 86
mbed_official 52:a51c77007319 87 #define IS_CEC_BIT_TIMING_ERROR_MODE(MODE) (((MODE) == CEC_BitTimingStdMode) || \
mbed_official 52:a51c77007319 88 ((MODE) == CEC_BitTimingErrFreeMode))
mbed_official 52:a51c77007319 89 /**
mbed_official 52:a51c77007319 90 * @}
mbed_official 52:a51c77007319 91 */
mbed_official 52:a51c77007319 92
mbed_official 52:a51c77007319 93 /** @defgroup CEC_BitPeriod_Mode
mbed_official 52:a51c77007319 94 * @{
mbed_official 52:a51c77007319 95 */
mbed_official 52:a51c77007319 96 #define CEC_BitPeriodStdMode ((uint16_t)0x00) /*!< Bit period error Standard Mode */
mbed_official 52:a51c77007319 97 #define CEC_BitPeriodFlexibleMode CEC_CFGR_BPEM /*!< Bit period error Flexible Mode */
mbed_official 52:a51c77007319 98
mbed_official 52:a51c77007319 99 #define IS_CEC_BIT_PERIOD_ERROR_MODE(MODE) (((MODE) == CEC_BitPeriodStdMode) || \
mbed_official 52:a51c77007319 100 ((MODE) == CEC_BitPeriodFlexibleMode))
mbed_official 52:a51c77007319 101 /**
mbed_official 52:a51c77007319 102 * @}
mbed_official 52:a51c77007319 103 */
mbed_official 52:a51c77007319 104
mbed_official 52:a51c77007319 105
mbed_official 52:a51c77007319 106 /** @defgroup CEC_interrupts_definition
mbed_official 52:a51c77007319 107 * @{
mbed_official 52:a51c77007319 108 */
mbed_official 52:a51c77007319 109 #define CEC_IT_TERR CEC_CSR_TERR
mbed_official 52:a51c77007319 110 #define CEC_IT_TBTRF CEC_CSR_TBTRF
mbed_official 52:a51c77007319 111 #define CEC_IT_RERR CEC_CSR_RERR
mbed_official 52:a51c77007319 112 #define CEC_IT_RBTF CEC_CSR_RBTF
mbed_official 52:a51c77007319 113 #define IS_CEC_GET_IT(IT) (((IT) == CEC_IT_TERR) || ((IT) == CEC_IT_TBTRF) || \
mbed_official 52:a51c77007319 114 ((IT) == CEC_IT_RERR) || ((IT) == CEC_IT_RBTF))
mbed_official 52:a51c77007319 115 /**
mbed_official 52:a51c77007319 116 * @}
mbed_official 52:a51c77007319 117 */
mbed_official 52:a51c77007319 118
mbed_official 52:a51c77007319 119
mbed_official 52:a51c77007319 120 /** @defgroup CEC_Own_Address
mbed_official 52:a51c77007319 121 * @{
mbed_official 52:a51c77007319 122 */
mbed_official 52:a51c77007319 123 #define IS_CEC_ADDRESS(ADDRESS) ((ADDRESS) < 0x10)
mbed_official 52:a51c77007319 124 /**
mbed_official 52:a51c77007319 125 * @}
mbed_official 52:a51c77007319 126 */
mbed_official 52:a51c77007319 127
mbed_official 52:a51c77007319 128 /** @defgroup CEC_Prescaler
mbed_official 52:a51c77007319 129 * @{
mbed_official 52:a51c77007319 130 */
mbed_official 52:a51c77007319 131 #define IS_CEC_PRESCALER(PRESCALER) ((PRESCALER) <= 0x3FFF)
mbed_official 52:a51c77007319 132
mbed_official 52:a51c77007319 133 /**
mbed_official 52:a51c77007319 134 * @}
mbed_official 52:a51c77007319 135 */
mbed_official 52:a51c77007319 136
mbed_official 52:a51c77007319 137 /** @defgroup CEC_flags_definition
mbed_official 52:a51c77007319 138 * @{
mbed_official 52:a51c77007319 139 */
mbed_official 52:a51c77007319 140
mbed_official 52:a51c77007319 141 /**
mbed_official 52:a51c77007319 142 * @brief ESR register flags
mbed_official 52:a51c77007319 143 */
mbed_official 52:a51c77007319 144 #define CEC_FLAG_BTE ((uint32_t)0x10010000)
mbed_official 52:a51c77007319 145 #define CEC_FLAG_BPE ((uint32_t)0x10020000)
mbed_official 52:a51c77007319 146 #define CEC_FLAG_RBTFE ((uint32_t)0x10040000)
mbed_official 52:a51c77007319 147 #define CEC_FLAG_SBE ((uint32_t)0x10080000)
mbed_official 52:a51c77007319 148 #define CEC_FLAG_ACKE ((uint32_t)0x10100000)
mbed_official 52:a51c77007319 149 #define CEC_FLAG_LINE ((uint32_t)0x10200000)
mbed_official 52:a51c77007319 150 #define CEC_FLAG_TBTFE ((uint32_t)0x10400000)
mbed_official 52:a51c77007319 151
mbed_official 52:a51c77007319 152 /**
mbed_official 52:a51c77007319 153 * @brief CSR register flags
mbed_official 52:a51c77007319 154 */
mbed_official 52:a51c77007319 155 #define CEC_FLAG_TEOM ((uint32_t)0x00000002)
mbed_official 52:a51c77007319 156 #define CEC_FLAG_TERR ((uint32_t)0x00000004)
mbed_official 52:a51c77007319 157 #define CEC_FLAG_TBTRF ((uint32_t)0x00000008)
mbed_official 52:a51c77007319 158 #define CEC_FLAG_RSOM ((uint32_t)0x00000010)
mbed_official 52:a51c77007319 159 #define CEC_FLAG_REOM ((uint32_t)0x00000020)
mbed_official 52:a51c77007319 160 #define CEC_FLAG_RERR ((uint32_t)0x00000040)
mbed_official 52:a51c77007319 161 #define CEC_FLAG_RBTF ((uint32_t)0x00000080)
mbed_official 52:a51c77007319 162
mbed_official 52:a51c77007319 163 #define IS_CEC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFF03) == 0x00) && ((FLAG) != 0x00))
mbed_official 52:a51c77007319 164
mbed_official 52:a51c77007319 165 #define IS_CEC_GET_FLAG(FLAG) (((FLAG) == CEC_FLAG_BTE) || ((FLAG) == CEC_FLAG_BPE) || \
mbed_official 52:a51c77007319 166 ((FLAG) == CEC_FLAG_RBTFE) || ((FLAG)== CEC_FLAG_SBE) || \
mbed_official 52:a51c77007319 167 ((FLAG) == CEC_FLAG_ACKE) || ((FLAG) == CEC_FLAG_LINE) || \
mbed_official 52:a51c77007319 168 ((FLAG) == CEC_FLAG_TBTFE) || ((FLAG) == CEC_FLAG_TEOM) || \
mbed_official 52:a51c77007319 169 ((FLAG) == CEC_FLAG_TERR) || ((FLAG) == CEC_FLAG_TBTRF) || \
mbed_official 52:a51c77007319 170 ((FLAG) == CEC_FLAG_RSOM) || ((FLAG) == CEC_FLAG_REOM) || \
mbed_official 52:a51c77007319 171 ((FLAG) == CEC_FLAG_RERR) || ((FLAG) == CEC_FLAG_RBTF))
mbed_official 52:a51c77007319 172
mbed_official 52:a51c77007319 173 /**
mbed_official 52:a51c77007319 174 * @}
mbed_official 52:a51c77007319 175 */
mbed_official 52:a51c77007319 176
mbed_official 52:a51c77007319 177 /**
mbed_official 52:a51c77007319 178 * @}
mbed_official 52:a51c77007319 179 */
mbed_official 52:a51c77007319 180
mbed_official 52:a51c77007319 181 /** @defgroup CEC_Exported_Macros
mbed_official 52:a51c77007319 182 * @{
mbed_official 52:a51c77007319 183 */
mbed_official 52:a51c77007319 184
mbed_official 52:a51c77007319 185 /**
mbed_official 52:a51c77007319 186 * @}
mbed_official 52:a51c77007319 187 */
mbed_official 52:a51c77007319 188
mbed_official 52:a51c77007319 189 /** @defgroup CEC_Exported_Functions
mbed_official 52:a51c77007319 190 * @{
mbed_official 52:a51c77007319 191 */
mbed_official 52:a51c77007319 192 void CEC_DeInit(void);
mbed_official 52:a51c77007319 193 void CEC_Init(CEC_InitTypeDef* CEC_InitStruct);
mbed_official 52:a51c77007319 194 void CEC_Cmd(FunctionalState NewState);
mbed_official 52:a51c77007319 195 void CEC_ITConfig(FunctionalState NewState);
mbed_official 52:a51c77007319 196 void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress);
mbed_official 52:a51c77007319 197 void CEC_SetPrescaler(uint16_t CEC_Prescaler);
mbed_official 52:a51c77007319 198 void CEC_SendDataByte(uint8_t Data);
mbed_official 52:a51c77007319 199 uint8_t CEC_ReceiveDataByte(void);
mbed_official 52:a51c77007319 200 void CEC_StartOfMessage(void);
mbed_official 52:a51c77007319 201 void CEC_EndOfMessageCmd(FunctionalState NewState);
mbed_official 52:a51c77007319 202 FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG);
mbed_official 52:a51c77007319 203 void CEC_ClearFlag(uint32_t CEC_FLAG);
mbed_official 52:a51c77007319 204 ITStatus CEC_GetITStatus(uint8_t CEC_IT);
mbed_official 52:a51c77007319 205 void CEC_ClearITPendingBit(uint16_t CEC_IT);
mbed_official 52:a51c77007319 206
mbed_official 52:a51c77007319 207 #ifdef __cplusplus
mbed_official 52:a51c77007319 208 }
mbed_official 52:a51c77007319 209 #endif
mbed_official 52:a51c77007319 210
mbed_official 52:a51c77007319 211 #endif /* __STM32F10x_CEC_H */
mbed_official 52:a51c77007319 212
mbed_official 52:a51c77007319 213 /**
mbed_official 52:a51c77007319 214 * @}
mbed_official 52:a51c77007319 215 */
mbed_official 52:a51c77007319 216
mbed_official 52:a51c77007319 217 /**
mbed_official 52:a51c77007319 218 * @}
mbed_official 52:a51c77007319 219 */
mbed_official 52:a51c77007319 220
mbed_official 52:a51c77007319 221 /**
mbed_official 52:a51c77007319 222 * @}
mbed_official 52:a51c77007319 223 */
mbed_official 52:a51c77007319 224
mbed_official 84:f54042cbc282 225 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/