mbed library sources modified for open wear

Dependents:   openwear-lifelogger-example

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Dec 02 11:30:05 2013 +0000
Revision:
52:a51c77007319
Child:
70:c1fbde68b492
Synchronized with git revision 49df530ae72ce97ccc773d1f2c13b38e868e6abd

Full URL: https://github.com/mbedmicro/mbed/commit/49df530ae72ce97ccc773d1f2c13b38e868e6abd/

Add STMicroelectronics NUCLEO_F103RB target

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 52:a51c77007319 5 * @version V3.5.0
mbed_official 52:a51c77007319 6 * @date 11-March-2011
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 52:a51c77007319 9 ******************************************************************************
mbed_official 52:a51c77007319 10 * @attention
mbed_official 52:a51c77007319 11 *
mbed_official 52:a51c77007319 12 * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
mbed_official 52:a51c77007319 13 * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
mbed_official 52:a51c77007319 14 * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
mbed_official 52:a51c77007319 15 * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
mbed_official 52:a51c77007319 16 * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
mbed_official 52:a51c77007319 17 * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
mbed_official 52:a51c77007319 18 *
mbed_official 52:a51c77007319 19 * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
mbed_official 52:a51c77007319 20 ******************************************************************************
mbed_official 52:a51c77007319 21 */
mbed_official 52:a51c77007319 22
mbed_official 52:a51c77007319 23 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 52:a51c77007319 24 #ifndef __STM32F10x_CEC_H
mbed_official 52:a51c77007319 25 #define __STM32F10x_CEC_H
mbed_official 52:a51c77007319 26
mbed_official 52:a51c77007319 27 #ifdef __cplusplus
mbed_official 52:a51c77007319 28 extern "C" {
mbed_official 52:a51c77007319 29 #endif
mbed_official 52:a51c77007319 30
mbed_official 52:a51c77007319 31 /* Includes ------------------------------------------------------------------*/
mbed_official 52:a51c77007319 32 #include "stm32f10x.h"
mbed_official 52:a51c77007319 33
mbed_official 52:a51c77007319 34 /** @addtogroup STM32F10x_StdPeriph_Driver
mbed_official 52:a51c77007319 35 * @{
mbed_official 52:a51c77007319 36 */
mbed_official 52:a51c77007319 37
mbed_official 52:a51c77007319 38 /** @addtogroup CEC
mbed_official 52:a51c77007319 39 * @{
mbed_official 52:a51c77007319 40 */
mbed_official 52:a51c77007319 41
mbed_official 52:a51c77007319 42
mbed_official 52:a51c77007319 43 /** @defgroup CEC_Exported_Types
mbed_official 52:a51c77007319 44 * @{
mbed_official 52:a51c77007319 45 */
mbed_official 52:a51c77007319 46
mbed_official 52:a51c77007319 47 /**
mbed_official 52:a51c77007319 48 * @brief CEC Init structure definition
mbed_official 52:a51c77007319 49 */
mbed_official 52:a51c77007319 50 typedef struct
mbed_official 52:a51c77007319 51 {
mbed_official 52:a51c77007319 52 uint16_t CEC_BitTimingMode; /*!< Configures the CEC Bit Timing Error Mode.
mbed_official 52:a51c77007319 53 This parameter can be a value of @ref CEC_BitTiming_Mode */
mbed_official 52:a51c77007319 54 uint16_t CEC_BitPeriodMode; /*!< Configures the CEC Bit Period Error Mode.
mbed_official 52:a51c77007319 55 This parameter can be a value of @ref CEC_BitPeriod_Mode */
mbed_official 52:a51c77007319 56 }CEC_InitTypeDef;
mbed_official 52:a51c77007319 57
mbed_official 52:a51c77007319 58 /**
mbed_official 52:a51c77007319 59 * @}
mbed_official 52:a51c77007319 60 */
mbed_official 52:a51c77007319 61
mbed_official 52:a51c77007319 62 /** @defgroup CEC_Exported_Constants
mbed_official 52:a51c77007319 63 * @{
mbed_official 52:a51c77007319 64 */
mbed_official 52:a51c77007319 65
mbed_official 52:a51c77007319 66 /** @defgroup CEC_BitTiming_Mode
mbed_official 52:a51c77007319 67 * @{
mbed_official 52:a51c77007319 68 */
mbed_official 52:a51c77007319 69 #define CEC_BitTimingStdMode ((uint16_t)0x00) /*!< Bit timing error Standard Mode */
mbed_official 52:a51c77007319 70 #define CEC_BitTimingErrFreeMode CEC_CFGR_BTEM /*!< Bit timing error Free Mode */
mbed_official 52:a51c77007319 71
mbed_official 52:a51c77007319 72 #define IS_CEC_BIT_TIMING_ERROR_MODE(MODE) (((MODE) == CEC_BitTimingStdMode) || \
mbed_official 52:a51c77007319 73 ((MODE) == CEC_BitTimingErrFreeMode))
mbed_official 52:a51c77007319 74 /**
mbed_official 52:a51c77007319 75 * @}
mbed_official 52:a51c77007319 76 */
mbed_official 52:a51c77007319 77
mbed_official 52:a51c77007319 78 /** @defgroup CEC_BitPeriod_Mode
mbed_official 52:a51c77007319 79 * @{
mbed_official 52:a51c77007319 80 */
mbed_official 52:a51c77007319 81 #define CEC_BitPeriodStdMode ((uint16_t)0x00) /*!< Bit period error Standard Mode */
mbed_official 52:a51c77007319 82 #define CEC_BitPeriodFlexibleMode CEC_CFGR_BPEM /*!< Bit period error Flexible Mode */
mbed_official 52:a51c77007319 83
mbed_official 52:a51c77007319 84 #define IS_CEC_BIT_PERIOD_ERROR_MODE(MODE) (((MODE) == CEC_BitPeriodStdMode) || \
mbed_official 52:a51c77007319 85 ((MODE) == CEC_BitPeriodFlexibleMode))
mbed_official 52:a51c77007319 86 /**
mbed_official 52:a51c77007319 87 * @}
mbed_official 52:a51c77007319 88 */
mbed_official 52:a51c77007319 89
mbed_official 52:a51c77007319 90
mbed_official 52:a51c77007319 91 /** @defgroup CEC_interrupts_definition
mbed_official 52:a51c77007319 92 * @{
mbed_official 52:a51c77007319 93 */
mbed_official 52:a51c77007319 94 #define CEC_IT_TERR CEC_CSR_TERR
mbed_official 52:a51c77007319 95 #define CEC_IT_TBTRF CEC_CSR_TBTRF
mbed_official 52:a51c77007319 96 #define CEC_IT_RERR CEC_CSR_RERR
mbed_official 52:a51c77007319 97 #define CEC_IT_RBTF CEC_CSR_RBTF
mbed_official 52:a51c77007319 98 #define IS_CEC_GET_IT(IT) (((IT) == CEC_IT_TERR) || ((IT) == CEC_IT_TBTRF) || \
mbed_official 52:a51c77007319 99 ((IT) == CEC_IT_RERR) || ((IT) == CEC_IT_RBTF))
mbed_official 52:a51c77007319 100 /**
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 /** @defgroup CEC_Own_Address
mbed_official 52:a51c77007319 106 * @{
mbed_official 52:a51c77007319 107 */
mbed_official 52:a51c77007319 108 #define IS_CEC_ADDRESS(ADDRESS) ((ADDRESS) < 0x10)
mbed_official 52:a51c77007319 109 /**
mbed_official 52:a51c77007319 110 * @}
mbed_official 52:a51c77007319 111 */
mbed_official 52:a51c77007319 112
mbed_official 52:a51c77007319 113 /** @defgroup CEC_Prescaler
mbed_official 52:a51c77007319 114 * @{
mbed_official 52:a51c77007319 115 */
mbed_official 52:a51c77007319 116 #define IS_CEC_PRESCALER(PRESCALER) ((PRESCALER) <= 0x3FFF)
mbed_official 52:a51c77007319 117
mbed_official 52:a51c77007319 118 /**
mbed_official 52:a51c77007319 119 * @}
mbed_official 52:a51c77007319 120 */
mbed_official 52:a51c77007319 121
mbed_official 52:a51c77007319 122 /** @defgroup CEC_flags_definition
mbed_official 52:a51c77007319 123 * @{
mbed_official 52:a51c77007319 124 */
mbed_official 52:a51c77007319 125
mbed_official 52:a51c77007319 126 /**
mbed_official 52:a51c77007319 127 * @brief ESR register flags
mbed_official 52:a51c77007319 128 */
mbed_official 52:a51c77007319 129 #define CEC_FLAG_BTE ((uint32_t)0x10010000)
mbed_official 52:a51c77007319 130 #define CEC_FLAG_BPE ((uint32_t)0x10020000)
mbed_official 52:a51c77007319 131 #define CEC_FLAG_RBTFE ((uint32_t)0x10040000)
mbed_official 52:a51c77007319 132 #define CEC_FLAG_SBE ((uint32_t)0x10080000)
mbed_official 52:a51c77007319 133 #define CEC_FLAG_ACKE ((uint32_t)0x10100000)
mbed_official 52:a51c77007319 134 #define CEC_FLAG_LINE ((uint32_t)0x10200000)
mbed_official 52:a51c77007319 135 #define CEC_FLAG_TBTFE ((uint32_t)0x10400000)
mbed_official 52:a51c77007319 136
mbed_official 52:a51c77007319 137 /**
mbed_official 52:a51c77007319 138 * @brief CSR register flags
mbed_official 52:a51c77007319 139 */
mbed_official 52:a51c77007319 140 #define CEC_FLAG_TEOM ((uint32_t)0x00000002)
mbed_official 52:a51c77007319 141 #define CEC_FLAG_TERR ((uint32_t)0x00000004)
mbed_official 52:a51c77007319 142 #define CEC_FLAG_TBTRF ((uint32_t)0x00000008)
mbed_official 52:a51c77007319 143 #define CEC_FLAG_RSOM ((uint32_t)0x00000010)
mbed_official 52:a51c77007319 144 #define CEC_FLAG_REOM ((uint32_t)0x00000020)
mbed_official 52:a51c77007319 145 #define CEC_FLAG_RERR ((uint32_t)0x00000040)
mbed_official 52:a51c77007319 146 #define CEC_FLAG_RBTF ((uint32_t)0x00000080)
mbed_official 52:a51c77007319 147
mbed_official 52:a51c77007319 148 #define IS_CEC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFF03) == 0x00) && ((FLAG) != 0x00))
mbed_official 52:a51c77007319 149
mbed_official 52:a51c77007319 150 #define IS_CEC_GET_FLAG(FLAG) (((FLAG) == CEC_FLAG_BTE) || ((FLAG) == CEC_FLAG_BPE) || \
mbed_official 52:a51c77007319 151 ((FLAG) == CEC_FLAG_RBTFE) || ((FLAG)== CEC_FLAG_SBE) || \
mbed_official 52:a51c77007319 152 ((FLAG) == CEC_FLAG_ACKE) || ((FLAG) == CEC_FLAG_LINE) || \
mbed_official 52:a51c77007319 153 ((FLAG) == CEC_FLAG_TBTFE) || ((FLAG) == CEC_FLAG_TEOM) || \
mbed_official 52:a51c77007319 154 ((FLAG) == CEC_FLAG_TERR) || ((FLAG) == CEC_FLAG_TBTRF) || \
mbed_official 52:a51c77007319 155 ((FLAG) == CEC_FLAG_RSOM) || ((FLAG) == CEC_FLAG_REOM) || \
mbed_official 52:a51c77007319 156 ((FLAG) == CEC_FLAG_RERR) || ((FLAG) == CEC_FLAG_RBTF))
mbed_official 52:a51c77007319 157
mbed_official 52:a51c77007319 158 /**
mbed_official 52:a51c77007319 159 * @}
mbed_official 52:a51c77007319 160 */
mbed_official 52:a51c77007319 161
mbed_official 52:a51c77007319 162 /**
mbed_official 52:a51c77007319 163 * @}
mbed_official 52:a51c77007319 164 */
mbed_official 52:a51c77007319 165
mbed_official 52:a51c77007319 166 /** @defgroup CEC_Exported_Macros
mbed_official 52:a51c77007319 167 * @{
mbed_official 52:a51c77007319 168 */
mbed_official 52:a51c77007319 169
mbed_official 52:a51c77007319 170 /**
mbed_official 52:a51c77007319 171 * @}
mbed_official 52:a51c77007319 172 */
mbed_official 52:a51c77007319 173
mbed_official 52:a51c77007319 174 /** @defgroup CEC_Exported_Functions
mbed_official 52:a51c77007319 175 * @{
mbed_official 52:a51c77007319 176 */
mbed_official 52:a51c77007319 177 void CEC_DeInit(void);
mbed_official 52:a51c77007319 178 void CEC_Init(CEC_InitTypeDef* CEC_InitStruct);
mbed_official 52:a51c77007319 179 void CEC_Cmd(FunctionalState NewState);
mbed_official 52:a51c77007319 180 void CEC_ITConfig(FunctionalState NewState);
mbed_official 52:a51c77007319 181 void CEC_OwnAddressConfig(uint8_t CEC_OwnAddress);
mbed_official 52:a51c77007319 182 void CEC_SetPrescaler(uint16_t CEC_Prescaler);
mbed_official 52:a51c77007319 183 void CEC_SendDataByte(uint8_t Data);
mbed_official 52:a51c77007319 184 uint8_t CEC_ReceiveDataByte(void);
mbed_official 52:a51c77007319 185 void CEC_StartOfMessage(void);
mbed_official 52:a51c77007319 186 void CEC_EndOfMessageCmd(FunctionalState NewState);
mbed_official 52:a51c77007319 187 FlagStatus CEC_GetFlagStatus(uint32_t CEC_FLAG);
mbed_official 52:a51c77007319 188 void CEC_ClearFlag(uint32_t CEC_FLAG);
mbed_official 52:a51c77007319 189 ITStatus CEC_GetITStatus(uint8_t CEC_IT);
mbed_official 52:a51c77007319 190 void CEC_ClearITPendingBit(uint16_t CEC_IT);
mbed_official 52:a51c77007319 191
mbed_official 52:a51c77007319 192 #ifdef __cplusplus
mbed_official 52:a51c77007319 193 }
mbed_official 52:a51c77007319 194 #endif
mbed_official 52:a51c77007319 195
mbed_official 52:a51c77007319 196 #endif /* __STM32F10x_CEC_H */
mbed_official 52:a51c77007319 197
mbed_official 52:a51c77007319 198 /**
mbed_official 52:a51c77007319 199 * @}
mbed_official 52:a51c77007319 200 */
mbed_official 52:a51c77007319 201
mbed_official 52:a51c77007319 202 /**
mbed_official 52:a51c77007319 203 * @}
mbed_official 52:a51c77007319 204 */
mbed_official 52:a51c77007319 205
mbed_official 52:a51c77007319 206 /**
mbed_official 52:a51c77007319 207 * @}
mbed_official 52:a51c77007319 208 */
mbed_official 52:a51c77007319 209
mbed_official 52:a51c77007319 210 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/