mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Mon Nov 03 10:30:07 2014 +0000
Revision:
381:5460fc57b6e4
Synchronized with git revision 02478cd1f27fc7b9643486472635eb515b2bca81

Full URL: https://github.com/mbedmicro/mbed/commit/02478cd1f27fc7b9643486472635eb515b2bca81/

Target: LPC1549 - Fix serial interrupt issues (issue report #616)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 381:5460fc57b6e4 1 /**
mbed_official 381:5460fc57b6e4 2 ******************************************************************************
mbed_official 381:5460fc57b6e4 3 * @file stm32f3xx_hal_pcd_ex.h
mbed_official 381:5460fc57b6e4 4 * @author MCD Application Team
mbed_official 381:5460fc57b6e4 5 * @version V1.1.0
mbed_official 381:5460fc57b6e4 6 * @date 12-Sept-2014
mbed_official 381:5460fc57b6e4 7 * @brief Header file of PCD HAL Extended module.
mbed_official 381:5460fc57b6e4 8 ******************************************************************************
mbed_official 381:5460fc57b6e4 9 * @attention
mbed_official 381:5460fc57b6e4 10 *
mbed_official 381:5460fc57b6e4 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 381:5460fc57b6e4 12 *
mbed_official 381:5460fc57b6e4 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 381:5460fc57b6e4 14 * are permitted provided that the following conditions are met:
mbed_official 381:5460fc57b6e4 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 381:5460fc57b6e4 16 * this list of conditions and the following disclaimer.
mbed_official 381:5460fc57b6e4 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 381:5460fc57b6e4 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 381:5460fc57b6e4 19 * and/or other materials provided with the distribution.
mbed_official 381:5460fc57b6e4 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 381:5460fc57b6e4 21 * may be used to endorse or promote products derived from this software
mbed_official 381:5460fc57b6e4 22 * without specific prior written permission.
mbed_official 381:5460fc57b6e4 23 *
mbed_official 381:5460fc57b6e4 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 381:5460fc57b6e4 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 381:5460fc57b6e4 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 381:5460fc57b6e4 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 381:5460fc57b6e4 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 381:5460fc57b6e4 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 381:5460fc57b6e4 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 381:5460fc57b6e4 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 381:5460fc57b6e4 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 381:5460fc57b6e4 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 381:5460fc57b6e4 34 *
mbed_official 381:5460fc57b6e4 35 ******************************************************************************
mbed_official 381:5460fc57b6e4 36 */
mbed_official 381:5460fc57b6e4 37
mbed_official 381:5460fc57b6e4 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 381:5460fc57b6e4 39 #ifndef __STM32F3xx_HAL_PCD_EX_H
mbed_official 381:5460fc57b6e4 40 #define __STM32F3xx_HAL_PCD_EX_H
mbed_official 381:5460fc57b6e4 41
mbed_official 381:5460fc57b6e4 42 #ifdef __cplusplus
mbed_official 381:5460fc57b6e4 43 extern "C" {
mbed_official 381:5460fc57b6e4 44 #endif
mbed_official 381:5460fc57b6e4 45
mbed_official 381:5460fc57b6e4 46 #if defined(STM32F302xE) || defined(STM32F303xE) || \
mbed_official 381:5460fc57b6e4 47 defined(STM32F302xC) || defined(STM32F303xC) || \
mbed_official 381:5460fc57b6e4 48 defined(STM32F302x8) || \
mbed_official 381:5460fc57b6e4 49 defined(STM32F373xC)
mbed_official 381:5460fc57b6e4 50
mbed_official 381:5460fc57b6e4 51 /* Includes ------------------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 52 #include "stm32f3xx_hal_def.h"
mbed_official 381:5460fc57b6e4 53
mbed_official 381:5460fc57b6e4 54 /** @addtogroup STM32F3xx_HAL_Driver
mbed_official 381:5460fc57b6e4 55 * @{
mbed_official 381:5460fc57b6e4 56 */
mbed_official 381:5460fc57b6e4 57
mbed_official 381:5460fc57b6e4 58 /** @addtogroup PCDEx
mbed_official 381:5460fc57b6e4 59 * @{
mbed_official 381:5460fc57b6e4 60 */
mbed_official 381:5460fc57b6e4 61
mbed_official 381:5460fc57b6e4 62 /* Exported types ------------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 63 /* Exported constants --------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 64 /* Exported macros -----------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 65 /** @defgroup PCDEx_Exported_Macros PCD Extended Exported Macros
mbed_official 381:5460fc57b6e4 66 * @{
mbed_official 381:5460fc57b6e4 67 */
mbed_official 381:5460fc57b6e4 68 /**
mbed_official 381:5460fc57b6e4 69 * @brief Gets address in an endpoint register.
mbed_official 381:5460fc57b6e4 70 * @param USBx: USB peripheral instance register address.
mbed_official 381:5460fc57b6e4 71 * @param bEpNum: Endpoint Number.
mbed_official 381:5460fc57b6e4 72 * @retval None
mbed_official 381:5460fc57b6e4 73 */
mbed_official 381:5460fc57b6e4 74
mbed_official 381:5460fc57b6e4 75 #if defined(STM32F302xC) || defined(STM32F303xC) || \
mbed_official 381:5460fc57b6e4 76 defined(STM32F373xC)
mbed_official 381:5460fc57b6e4 77
mbed_official 381:5460fc57b6e4 78 #define PCD_EP_TX_ADDRESS(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8)*2+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 79 #define PCD_EP_TX_CNT(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8+2)*2+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 80 #define PCD_EP_RX_ADDRESS(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8+4)*2+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 81 #define PCD_EP_RX_CNT(USBx, bEpNum) ((uint32_t *)((USBx->BTABLE+bEpNum*8+6)*2+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 82
mbed_official 381:5460fc57b6e4 83 #define PCD_SET_EP_RX_CNT(USBx, bEpNum,wCount) {\
mbed_official 381:5460fc57b6e4 84 uint32_t *pdwReg = PCD_EP_RX_CNT(USBx, bEpNum); \
mbed_official 381:5460fc57b6e4 85 PCD_SET_EP_CNT_RX_REG(pdwReg, wCount);\
mbed_official 381:5460fc57b6e4 86 }
mbed_official 381:5460fc57b6e4 87
mbed_official 381:5460fc57b6e4 88 #endif /* STM32F302xC || STM32F303xC || */
mbed_official 381:5460fc57b6e4 89 /* STM32F373xC */
mbed_official 381:5460fc57b6e4 90
mbed_official 381:5460fc57b6e4 91
mbed_official 381:5460fc57b6e4 92 #if defined(STM32F302xE) || defined(STM32F303xE) || \
mbed_official 381:5460fc57b6e4 93 defined(STM32F302x8)
mbed_official 381:5460fc57b6e4 94
mbed_official 381:5460fc57b6e4 95 #define PCD_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8)+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 96 #define PCD_EP_TX_CNT(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8+2)+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 97 #define PCD_EP_RX_ADDRESS(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8+4)+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 98 #define PCD_EP_RX_CNT(USBx, bEpNum) ((uint16_t *)((USBx->BTABLE+bEpNum*8+6)+ ((uint32_t)USBx + 0x400)))
mbed_official 381:5460fc57b6e4 99
mbed_official 381:5460fc57b6e4 100 #define PCD_SET_EP_RX_CNT(USBx, bEpNum,wCount) {\
mbed_official 381:5460fc57b6e4 101 uint16_t *pdwReg = PCD_EP_RX_CNT(USBx, bEpNum); \
mbed_official 381:5460fc57b6e4 102 PCD_SET_EP_CNT_RX_REG(pdwReg, wCount);\
mbed_official 381:5460fc57b6e4 103 }
mbed_official 381:5460fc57b6e4 104
mbed_official 381:5460fc57b6e4 105 #endif /* STM32F302xE || STM32F303xE || */
mbed_official 381:5460fc57b6e4 106 /* STM32F302x8 */
mbed_official 381:5460fc57b6e4 107 /**
mbed_official 381:5460fc57b6e4 108 * @}
mbed_official 381:5460fc57b6e4 109 */
mbed_official 381:5460fc57b6e4 110
mbed_official 381:5460fc57b6e4 111 /* Exported functions --------------------------------------------------------*/
mbed_official 381:5460fc57b6e4 112 /** @addtogroup PCDEx_Exported_Functions PCD Extended Exported Functions
mbed_official 381:5460fc57b6e4 113 * @{
mbed_official 381:5460fc57b6e4 114 */
mbed_official 381:5460fc57b6e4 115 /** @addtogroup PCDEx_Exported_Functions_Group1 Extended Initialization and de-initialization functions
mbed_official 381:5460fc57b6e4 116 * @brief Initialization and Configuration functions
mbed_official 381:5460fc57b6e4 117 * @{
mbed_official 381:5460fc57b6e4 118 */
mbed_official 381:5460fc57b6e4 119 HAL_StatusTypeDef HAL_PCDEx_PMAConfig(PCD_HandleTypeDef *hpcd,
mbed_official 381:5460fc57b6e4 120 uint16_t ep_addr,
mbed_official 381:5460fc57b6e4 121 uint16_t ep_kind,
mbed_official 381:5460fc57b6e4 122 uint32_t pmaadress);
mbed_official 381:5460fc57b6e4 123
mbed_official 381:5460fc57b6e4 124 __weak void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state);
mbed_official 381:5460fc57b6e4 125
mbed_official 381:5460fc57b6e4 126 /**
mbed_official 381:5460fc57b6e4 127 * @}
mbed_official 381:5460fc57b6e4 128 */
mbed_official 381:5460fc57b6e4 129
mbed_official 381:5460fc57b6e4 130 /**
mbed_official 381:5460fc57b6e4 131 * @}
mbed_official 381:5460fc57b6e4 132 */
mbed_official 381:5460fc57b6e4 133
mbed_official 381:5460fc57b6e4 134 /**
mbed_official 381:5460fc57b6e4 135 * @}
mbed_official 381:5460fc57b6e4 136 */
mbed_official 381:5460fc57b6e4 137
mbed_official 381:5460fc57b6e4 138 /**
mbed_official 381:5460fc57b6e4 139 * @}
mbed_official 381:5460fc57b6e4 140 */
mbed_official 381:5460fc57b6e4 141
mbed_official 381:5460fc57b6e4 142 #endif /* STM32F302xE || STM32F303xE || */
mbed_official 381:5460fc57b6e4 143 /* STM32F302xC || STM32F303xC || */
mbed_official 381:5460fc57b6e4 144 /* STM32F302x8 || */
mbed_official 381:5460fc57b6e4 145 /* STM32F373xC */
mbed_official 381:5460fc57b6e4 146
mbed_official 381:5460fc57b6e4 147 #ifdef __cplusplus
mbed_official 381:5460fc57b6e4 148 }
mbed_official 381:5460fc57b6e4 149 #endif
mbed_official 381:5460fc57b6e4 150
mbed_official 381:5460fc57b6e4 151
mbed_official 381:5460fc57b6e4 152 #endif /* __STM32F3xx_HAL_PCD_EX_H */
mbed_official 381:5460fc57b6e4 153
mbed_official 381:5460fc57b6e4 154 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/