mbed(SerialHalfDuplex入り)

Fork of mbed by mbed official

Committer:
yusuke_kyo
Date:
Wed Apr 08 08:04:18 2015 +0000
Revision:
98:01a414ca7d6d
Parent:
92:4fc01daae5a5
remove SerialHalfDuplex.h

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bogdanm 92:4fc01daae5a5 1 /**
bogdanm 92:4fc01daae5a5 2 ******************************************************************************
bogdanm 92:4fc01daae5a5 3 * @file stm32f4xx_hal_tim_ex.h
bogdanm 92:4fc01daae5a5 4 * @author MCD Application Team
bogdanm 92:4fc01daae5a5 5 * @version V1.1.0
bogdanm 92:4fc01daae5a5 6 * @date 19-June-2014
bogdanm 92:4fc01daae5a5 7 * @brief Header file of TIM HAL Extension module.
bogdanm 92:4fc01daae5a5 8 ******************************************************************************
bogdanm 92:4fc01daae5a5 9 * @attention
bogdanm 92:4fc01daae5a5 10 *
bogdanm 92:4fc01daae5a5 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
bogdanm 92:4fc01daae5a5 12 *
bogdanm 92:4fc01daae5a5 13 * Redistribution and use in source and binary forms, with or without modification,
bogdanm 92:4fc01daae5a5 14 * are permitted provided that the following conditions are met:
bogdanm 92:4fc01daae5a5 15 * 1. Redistributions of source code must retain the above copyright notice,
bogdanm 92:4fc01daae5a5 16 * this list of conditions and the following disclaimer.
bogdanm 92:4fc01daae5a5 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
bogdanm 92:4fc01daae5a5 18 * this list of conditions and the following disclaimer in the documentation
bogdanm 92:4fc01daae5a5 19 * and/or other materials provided with the distribution.
bogdanm 92:4fc01daae5a5 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
bogdanm 92:4fc01daae5a5 21 * may be used to endorse or promote products derived from this software
bogdanm 92:4fc01daae5a5 22 * without specific prior written permission.
bogdanm 92:4fc01daae5a5 23 *
bogdanm 92:4fc01daae5a5 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
bogdanm 92:4fc01daae5a5 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
bogdanm 92:4fc01daae5a5 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
bogdanm 92:4fc01daae5a5 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
bogdanm 92:4fc01daae5a5 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
bogdanm 92:4fc01daae5a5 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
bogdanm 92:4fc01daae5a5 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
bogdanm 92:4fc01daae5a5 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
bogdanm 92:4fc01daae5a5 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
bogdanm 92:4fc01daae5a5 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
bogdanm 92:4fc01daae5a5 34 *
bogdanm 92:4fc01daae5a5 35 ******************************************************************************
bogdanm 92:4fc01daae5a5 36 */
bogdanm 92:4fc01daae5a5 37
bogdanm 92:4fc01daae5a5 38 /* Define to prevent recursive inclusion -------------------------------------*/
bogdanm 92:4fc01daae5a5 39 #ifndef __STM32F4xx_HAL_TIM_EX_H
bogdanm 92:4fc01daae5a5 40 #define __STM32F4xx_HAL_TIM_EX_H
bogdanm 92:4fc01daae5a5 41
bogdanm 92:4fc01daae5a5 42 #ifdef __cplusplus
bogdanm 92:4fc01daae5a5 43 extern "C" {
bogdanm 92:4fc01daae5a5 44 #endif
bogdanm 92:4fc01daae5a5 45
bogdanm 92:4fc01daae5a5 46 /* Includes ------------------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 47 #include "stm32f4xx_hal_def.h"
bogdanm 92:4fc01daae5a5 48
bogdanm 92:4fc01daae5a5 49 /** @addtogroup STM32F4xx_HAL
bogdanm 92:4fc01daae5a5 50 * @{
bogdanm 92:4fc01daae5a5 51 */
bogdanm 92:4fc01daae5a5 52
bogdanm 92:4fc01daae5a5 53 /** @addtogroup TIMEx
bogdanm 92:4fc01daae5a5 54 * @{
bogdanm 92:4fc01daae5a5 55 */
bogdanm 92:4fc01daae5a5 56
bogdanm 92:4fc01daae5a5 57 /* Exported types ------------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 58
bogdanm 92:4fc01daae5a5 59 /**
bogdanm 92:4fc01daae5a5 60 * @brief TIM Hall sensor Configuration Structure definition
bogdanm 92:4fc01daae5a5 61 */
bogdanm 92:4fc01daae5a5 62
bogdanm 92:4fc01daae5a5 63 typedef struct
bogdanm 92:4fc01daae5a5 64 {
bogdanm 92:4fc01daae5a5 65
bogdanm 92:4fc01daae5a5 66 uint32_t IC1Polarity; /*!< Specifies the active edge of the input signal.
bogdanm 92:4fc01daae5a5 67 This parameter can be a value of @ref TIM_Input_Capture_Polarity */
bogdanm 92:4fc01daae5a5 68
bogdanm 92:4fc01daae5a5 69 uint32_t IC1Prescaler; /*!< Specifies the Input Capture Prescaler.
bogdanm 92:4fc01daae5a5 70 This parameter can be a value of @ref TIM_Input_Capture_Prescaler */
bogdanm 92:4fc01daae5a5 71
bogdanm 92:4fc01daae5a5 72 uint32_t IC1Filter; /*!< Specifies the input capture filter.
bogdanm 92:4fc01daae5a5 73 This parameter can be a number between Min_Data = 0x0 and Max_Data = 0xF */
bogdanm 92:4fc01daae5a5 74 uint32_t Commutation_Delay; /*!< Specifies the pulse value to be loaded into the Capture Compare Register.
bogdanm 92:4fc01daae5a5 75 This parameter can be a number between Min_Data = 0x0000 and Max_Data = 0xFFFF */
bogdanm 92:4fc01daae5a5 76 } TIM_HallSensor_InitTypeDef;
bogdanm 92:4fc01daae5a5 77
bogdanm 92:4fc01daae5a5 78 /**
bogdanm 92:4fc01daae5a5 79 * @brief TIM Master configuration Structure definition
bogdanm 92:4fc01daae5a5 80 */
bogdanm 92:4fc01daae5a5 81 typedef struct {
bogdanm 92:4fc01daae5a5 82 uint32_t MasterOutputTrigger; /*!< Trigger output (TRGO) selection.
bogdanm 92:4fc01daae5a5 83 This parameter can be a value of @ref TIM_Master_Mode_Selection */
bogdanm 92:4fc01daae5a5 84 uint32_t MasterSlaveMode; /*!< Master/slave mode selection.
bogdanm 92:4fc01daae5a5 85 This parameter can be a value of @ref TIM_Master_Slave_Mode */
bogdanm 92:4fc01daae5a5 86 }TIM_MasterConfigTypeDef;
bogdanm 92:4fc01daae5a5 87
bogdanm 92:4fc01daae5a5 88 /**
bogdanm 92:4fc01daae5a5 89 * @brief TIM Break and Dead time configuration Structure definition
bogdanm 92:4fc01daae5a5 90 */
bogdanm 92:4fc01daae5a5 91 typedef struct
bogdanm 92:4fc01daae5a5 92 {
bogdanm 92:4fc01daae5a5 93 uint32_t OffStateRunMode; /*!< TIM off state in run mode.
bogdanm 92:4fc01daae5a5 94 This parameter can be a value of @ref TIM_OSSR_Off_State_Selection_for_Run_mode_state */
bogdanm 92:4fc01daae5a5 95 uint32_t OffStateIDLEMode; /*!< TIM off state in IDLE mode.
bogdanm 92:4fc01daae5a5 96 This parameter can be a value of @ref TIM_OSSI_Off_State_Selection_for_Idle_mode_state */
bogdanm 92:4fc01daae5a5 97 uint32_t LockLevel; /*!< TIM Lock level.
bogdanm 92:4fc01daae5a5 98 This parameter can be a value of @ref TIM_Lock_level */
bogdanm 92:4fc01daae5a5 99 uint32_t DeadTime; /*!< TIM dead Time.
bogdanm 92:4fc01daae5a5 100 This parameter can be a number between Min_Data = 0x00 and Max_Data = 0xFF */
bogdanm 92:4fc01daae5a5 101 uint32_t BreakState; /*!< TIM Break State.
bogdanm 92:4fc01daae5a5 102 This parameter can be a value of @ref TIM_Break_Input_enable_disable */
bogdanm 92:4fc01daae5a5 103 uint32_t BreakPolarity; /*!< TIM Break input polarity.
bogdanm 92:4fc01daae5a5 104 This parameter can be a value of @ref TIM_Break_Polarity */
bogdanm 92:4fc01daae5a5 105 uint32_t AutomaticOutput; /*!< TIM Automatic Output Enable state.
bogdanm 92:4fc01daae5a5 106 This parameter can be a value of @ref TIM_AOE_Bit_Set_Reset */
bogdanm 92:4fc01daae5a5 107 }TIM_BreakDeadTimeConfigTypeDef;
bogdanm 92:4fc01daae5a5 108
bogdanm 92:4fc01daae5a5 109 /* Exported constants --------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 110 /** @defgroup TIMEx_Exported_Constants
bogdanm 92:4fc01daae5a5 111 * @{
bogdanm 92:4fc01daae5a5 112 */
bogdanm 92:4fc01daae5a5 113
bogdanm 92:4fc01daae5a5 114 /** @defgroup TIMEx_Remap
bogdanm 92:4fc01daae5a5 115 * @{
bogdanm 92:4fc01daae5a5 116 */
bogdanm 92:4fc01daae5a5 117
bogdanm 92:4fc01daae5a5 118 #define TIM_TIM2_TIM8_TRGO (0x00000000)
bogdanm 92:4fc01daae5a5 119 #define TIM_TIM2_ETH_PTP (0x00000400)
bogdanm 92:4fc01daae5a5 120 #define TIM_TIM2_USBFS_SOF (0x00000800)
bogdanm 92:4fc01daae5a5 121 #define TIM_TIM2_USBHS_SOF (0x00000C00)
bogdanm 92:4fc01daae5a5 122 #define TIM_TIM5_GPIO (0x00000000)
bogdanm 92:4fc01daae5a5 123 #define TIM_TIM5_LSI (0x00000040)
bogdanm 92:4fc01daae5a5 124 #define TIM_TIM5_LSE (0x00000080)
bogdanm 92:4fc01daae5a5 125 #define TIM_TIM5_RTC (0x000000C0)
bogdanm 92:4fc01daae5a5 126 #define TIM_TIM11_GPIO (0x00000000)
bogdanm 92:4fc01daae5a5 127 #define TIM_TIM11_HSE (0x00000002)
bogdanm 92:4fc01daae5a5 128
bogdanm 92:4fc01daae5a5 129 #define IS_TIM_REMAP(TIM_REMAP) (((TIM_REMAP) == TIM_TIM2_TIM8_TRGO)||\
bogdanm 92:4fc01daae5a5 130 ((TIM_REMAP) == TIM_TIM2_ETH_PTP)||\
bogdanm 92:4fc01daae5a5 131 ((TIM_REMAP) == TIM_TIM2_USBFS_SOF)||\
bogdanm 92:4fc01daae5a5 132 ((TIM_REMAP) == TIM_TIM2_USBHS_SOF)||\
bogdanm 92:4fc01daae5a5 133 ((TIM_REMAP) == TIM_TIM5_GPIO)||\
bogdanm 92:4fc01daae5a5 134 ((TIM_REMAP) == TIM_TIM5_LSI)||\
bogdanm 92:4fc01daae5a5 135 ((TIM_REMAP) == TIM_TIM5_LSE)||\
bogdanm 92:4fc01daae5a5 136 ((TIM_REMAP) == TIM_TIM5_RTC)||\
bogdanm 92:4fc01daae5a5 137 ((TIM_REMAP) == TIM_TIM11_GPIO)||\
bogdanm 92:4fc01daae5a5 138 ((TIM_REMAP) == TIM_TIM11_HSE))
bogdanm 92:4fc01daae5a5 139
bogdanm 92:4fc01daae5a5 140 /**
bogdanm 92:4fc01daae5a5 141 * @}
bogdanm 92:4fc01daae5a5 142 */
bogdanm 92:4fc01daae5a5 143
bogdanm 92:4fc01daae5a5 144 /**
bogdanm 92:4fc01daae5a5 145 * @}
bogdanm 92:4fc01daae5a5 146 */
bogdanm 92:4fc01daae5a5 147
bogdanm 92:4fc01daae5a5 148 /* Exported macro ------------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 149
bogdanm 92:4fc01daae5a5 150 /* Exported functions --------------------------------------------------------*/
bogdanm 92:4fc01daae5a5 151
bogdanm 92:4fc01daae5a5 152 /* Timer Hall Sensor functions **********************************************/
bogdanm 92:4fc01daae5a5 153 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Init(TIM_HandleTypeDef* htim, TIM_HallSensor_InitTypeDef* sConfig);
bogdanm 92:4fc01daae5a5 154 HAL_StatusTypeDef HAL_TIMEx_HallSensor_DeInit(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 155
bogdanm 92:4fc01daae5a5 156 void HAL_TIMEx_HallSensor_MspInit(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 157 void HAL_TIMEx_HallSensor_MspDeInit(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 158
bogdanm 92:4fc01daae5a5 159 /* Blocking mode: Polling */
bogdanm 92:4fc01daae5a5 160 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 161 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 162 /* Non-Blocking mode: Interrupt */
bogdanm 92:4fc01daae5a5 163 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_IT(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 164 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_IT(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 165 /* Non-Blocking mode: DMA */
bogdanm 92:4fc01daae5a5 166 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Start_DMA(TIM_HandleTypeDef* htim, uint32_t *pData, uint16_t Length);
bogdanm 92:4fc01daae5a5 167 HAL_StatusTypeDef HAL_TIMEx_HallSensor_Stop_DMA(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 168
bogdanm 92:4fc01daae5a5 169 /* Timer Complementary Output Compare functions *****************************/
bogdanm 92:4fc01daae5a5 170 /* Blocking mode: Polling */
bogdanm 92:4fc01daae5a5 171 HAL_StatusTypeDef HAL_TIMEx_OCN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 172 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 173
bogdanm 92:4fc01daae5a5 174 /* Non-Blocking mode: Interrupt */
bogdanm 92:4fc01daae5a5 175 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 176 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 177
bogdanm 92:4fc01daae5a5 178 /* Non-Blocking mode: DMA */
bogdanm 92:4fc01daae5a5 179 HAL_StatusTypeDef HAL_TIMEx_OCN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
bogdanm 92:4fc01daae5a5 180 HAL_StatusTypeDef HAL_TIMEx_OCN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 181
bogdanm 92:4fc01daae5a5 182 /* Timer Complementary PWM functions ****************************************/
bogdanm 92:4fc01daae5a5 183 /* Blocking mode: Polling */
bogdanm 92:4fc01daae5a5 184 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 185 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 186
bogdanm 92:4fc01daae5a5 187 /* Non-Blocking mode: Interrupt */
bogdanm 92:4fc01daae5a5 188 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 189 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 190 /* Non-Blocking mode: DMA */
bogdanm 92:4fc01daae5a5 191 HAL_StatusTypeDef HAL_TIMEx_PWMN_Start_DMA(TIM_HandleTypeDef* htim, uint32_t Channel, uint32_t *pData, uint16_t Length);
bogdanm 92:4fc01daae5a5 192 HAL_StatusTypeDef HAL_TIMEx_PWMN_Stop_DMA(TIM_HandleTypeDef* htim, uint32_t Channel);
bogdanm 92:4fc01daae5a5 193
bogdanm 92:4fc01daae5a5 194 /* Timer Complementary One Pulse functions **********************************/
bogdanm 92:4fc01daae5a5 195 /* Blocking mode: Polling */
bogdanm 92:4fc01daae5a5 196 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 92:4fc01daae5a5 197 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 92:4fc01daae5a5 198
bogdanm 92:4fc01daae5a5 199 /* Non-Blocking mode: Interrupt */
bogdanm 92:4fc01daae5a5 200 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Start_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 92:4fc01daae5a5 201 HAL_StatusTypeDef HAL_TIMEx_OnePulseN_Stop_IT(TIM_HandleTypeDef* htim, uint32_t OutputChannel);
bogdanm 92:4fc01daae5a5 202
bogdanm 92:4fc01daae5a5 203 /* Extnsion Control functions ************************************************/
bogdanm 92:4fc01daae5a5 204 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
bogdanm 92:4fc01daae5a5 205 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_IT(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
bogdanm 92:4fc01daae5a5 206 HAL_StatusTypeDef HAL_TIMEx_ConfigCommutationEvent_DMA(TIM_HandleTypeDef* htim, uint32_t InputTrigger, uint32_t CommutationSource);
bogdanm 92:4fc01daae5a5 207 HAL_StatusTypeDef HAL_TIMEx_MasterConfigSynchronization(TIM_HandleTypeDef* htim, TIM_MasterConfigTypeDef * sMasterConfig);
bogdanm 92:4fc01daae5a5 208 HAL_StatusTypeDef HAL_TIMEx_ConfigBreakDeadTime(TIM_HandleTypeDef* htim, TIM_BreakDeadTimeConfigTypeDef *sBreakDeadTimeConfig);
bogdanm 92:4fc01daae5a5 209 HAL_StatusTypeDef HAL_TIMEx_RemapConfig(TIM_HandleTypeDef* htim, uint32_t Remap);
bogdanm 92:4fc01daae5a5 210
bogdanm 92:4fc01daae5a5 211 /* Extension Callback *********************************************************/
bogdanm 92:4fc01daae5a5 212 void HAL_TIMEx_CommutationCallback(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 213 void HAL_TIMEx_BreakCallback(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 214 void HAL_TIMEx_DMACommutationCplt(DMA_HandleTypeDef *hdma);
bogdanm 92:4fc01daae5a5 215
bogdanm 92:4fc01daae5a5 216 /* Extension Peripheral State functions **************************************/
bogdanm 92:4fc01daae5a5 217 HAL_TIM_StateTypeDef HAL_TIMEx_HallSensor_GetState(TIM_HandleTypeDef* htim);
bogdanm 92:4fc01daae5a5 218
bogdanm 92:4fc01daae5a5 219 /**
bogdanm 92:4fc01daae5a5 220 * @}
bogdanm 92:4fc01daae5a5 221 */
bogdanm 92:4fc01daae5a5 222
bogdanm 92:4fc01daae5a5 223 /**
bogdanm 92:4fc01daae5a5 224 * @}
bogdanm 92:4fc01daae5a5 225 */
bogdanm 92:4fc01daae5a5 226
bogdanm 92:4fc01daae5a5 227 #ifdef __cplusplus
bogdanm 92:4fc01daae5a5 228 }
bogdanm 92:4fc01daae5a5 229 #endif
bogdanm 92:4fc01daae5a5 230
bogdanm 92:4fc01daae5a5 231 #endif /* __STM32F4xx_HAL_TIM_EX_H */
bogdanm 92:4fc01daae5a5 232
bogdanm 92:4fc01daae5a5 233 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/