mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Thu Jul 02 16:30:08 2015 +0100
Revision:
581:39197bcd20f2
Parent:
489:119543c9f674
Synchronized with git revision ae2d3cdffe70184eb8736d94f76c45c93f4b7724

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

Make it possible to build the core mbed library with yotta

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 489:119543c9f674 1 /**
mbed_official 489:119543c9f674 2 ******************************************************************************
mbed_official 489:119543c9f674 3 * @file stm32f1xx_hal_pccard.h
mbed_official 489:119543c9f674 4 * @author MCD Application Team
mbed_official 489:119543c9f674 5 * @version V1.0.0
mbed_official 489:119543c9f674 6 * @date 15-December-2014
mbed_official 489:119543c9f674 7 * @brief Header file of PCCARD HAL module.
mbed_official 489:119543c9f674 8 ******************************************************************************
mbed_official 489:119543c9f674 9 * @attention
mbed_official 489:119543c9f674 10 *
mbed_official 489:119543c9f674 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
mbed_official 489:119543c9f674 12 *
mbed_official 489:119543c9f674 13 * Redistribution and use in source and binary forms, with or without modification,
mbed_official 489:119543c9f674 14 * are permitted provided that the following conditions are met:
mbed_official 489:119543c9f674 15 * 1. Redistributions of source code must retain the above copyright notice,
mbed_official 489:119543c9f674 16 * this list of conditions and the following disclaimer.
mbed_official 489:119543c9f674 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
mbed_official 489:119543c9f674 18 * this list of conditions and the following disclaimer in the documentation
mbed_official 489:119543c9f674 19 * and/or other materials provided with the distribution.
mbed_official 489:119543c9f674 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
mbed_official 489:119543c9f674 21 * may be used to endorse or promote products derived from this software
mbed_official 489:119543c9f674 22 * without specific prior written permission.
mbed_official 489:119543c9f674 23 *
mbed_official 489:119543c9f674 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 489:119543c9f674 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 489:119543c9f674 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 489:119543c9f674 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
mbed_official 489:119543c9f674 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
mbed_official 489:119543c9f674 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
mbed_official 489:119543c9f674 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
mbed_official 489:119543c9f674 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
mbed_official 489:119543c9f674 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
mbed_official 489:119543c9f674 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 489:119543c9f674 34 *
mbed_official 489:119543c9f674 35 ******************************************************************************
mbed_official 489:119543c9f674 36 */
mbed_official 489:119543c9f674 37
mbed_official 489:119543c9f674 38 /* Define to prevent recursive inclusion -------------------------------------*/
mbed_official 489:119543c9f674 39 #ifndef __STM32F1xx_HAL_PCCARD_H
mbed_official 489:119543c9f674 40 #define __STM32F1xx_HAL_PCCARD_H
mbed_official 489:119543c9f674 41
mbed_official 489:119543c9f674 42 #ifdef __cplusplus
mbed_official 489:119543c9f674 43 extern "C" {
mbed_official 489:119543c9f674 44 #endif
mbed_official 489:119543c9f674 45
mbed_official 489:119543c9f674 46 /* Includes ------------------------------------------------------------------*/
mbed_official 489:119543c9f674 47 #include "stm32f1xx_ll_fsmc.h"
mbed_official 489:119543c9f674 48
mbed_official 489:119543c9f674 49 /** @addtogroup STM32F1xx_HAL_Driver
mbed_official 489:119543c9f674 50 * @{
mbed_official 489:119543c9f674 51 */
mbed_official 489:119543c9f674 52
mbed_official 489:119543c9f674 53 #if defined (STM32F101xE) || defined(STM32F103xE) || defined(STM32F101xG) || defined(STM32F103xG)
mbed_official 489:119543c9f674 54 /** @addtogroup PCCARD
mbed_official 489:119543c9f674 55 * @{
mbed_official 489:119543c9f674 56 */
mbed_official 489:119543c9f674 57
mbed_official 489:119543c9f674 58 /** @addtogroup PCCARD_Private_Constants
mbed_official 489:119543c9f674 59 * @{
mbed_official 489:119543c9f674 60 */
mbed_official 489:119543c9f674 61
mbed_official 489:119543c9f674 62 #define PCCARD_DEVICE_ADDRESS FSMC_BANK4
mbed_official 489:119543c9f674 63 #define PCCARD_ATTRIBUTE_SPACE_ADDRESS ((uint32_t)(FSMC_BANK4 + 0x08000000)) /* Attribute space size to @0x9BFF FFFF */
mbed_official 489:119543c9f674 64 #define PCCARD_COMMON_SPACE_ADDRESS PCCARD_DEVICE_ADDRESS /* Common space size to @0x93FF FFFF */
mbed_official 489:119543c9f674 65 #define PCCARD_IO_SPACE_ADDRESS ((uint32_t)(FSMC_BANK4 + 0x0C000000)) /* IO space size to @0x9FFF FFFF */
mbed_official 489:119543c9f674 66 #define PCCARD_IO_SPACE_PRIMARY_ADDR ((uint32_t)(FSMC_BANK4 + 0x0C0001F0)) /* IO space size to @0x9FFF FFFF */
mbed_official 489:119543c9f674 67
mbed_official 489:119543c9f674 68 /* Compact Flash-ATA registers description */
mbed_official 489:119543c9f674 69 #define ATA_DATA ((uint8_t)0x00) /* Data register */
mbed_official 489:119543c9f674 70 #define ATA_SECTOR_COUNT ((uint8_t)0x02) /* Sector Count register */
mbed_official 489:119543c9f674 71 #define ATA_SECTOR_NUMBER ((uint8_t)0x03) /* Sector Number register */
mbed_official 489:119543c9f674 72 #define ATA_CYLINDER_LOW ((uint8_t)0x04) /* Cylinder low register */
mbed_official 489:119543c9f674 73 #define ATA_CYLINDER_HIGH ((uint8_t)0x05) /* Cylinder high register */
mbed_official 489:119543c9f674 74 #define ATA_CARD_HEAD ((uint8_t)0x06) /* Card/Head register */
mbed_official 489:119543c9f674 75 #define ATA_STATUS_CMD ((uint8_t)0x07) /* Status(read)/Command(write) register */
mbed_official 489:119543c9f674 76 #define ATA_STATUS_CMD_ALTERNATE ((uint8_t)0x0E) /* Alternate Status(read)/Command(write) register */
mbed_official 489:119543c9f674 77 #define ATA_COMMON_DATA_AREA ((uint16_t)0x0400) /* Start of data area (for Common access only!) */
mbed_official 489:119543c9f674 78 #define ATA_CARD_CONFIGURATION ((uint16_t)0x0202) /* Card Configuration and Status Register */
mbed_official 489:119543c9f674 79
mbed_official 489:119543c9f674 80 /* Compact Flash-ATA commands */
mbed_official 489:119543c9f674 81 #define ATA_READ_SECTOR_CMD ((uint8_t)0x20)
mbed_official 489:119543c9f674 82 #define ATA_WRITE_SECTOR_CMD ((uint8_t)0x30)
mbed_official 489:119543c9f674 83 #define ATA_ERASE_SECTOR_CMD ((uint8_t)0xC0)
mbed_official 489:119543c9f674 84 #define ATA_IDENTIFY_CMD ((uint8_t)0xEC)
mbed_official 489:119543c9f674 85
mbed_official 489:119543c9f674 86 /* Compact Flash status */
mbed_official 489:119543c9f674 87 #define PCCARD_TIMEOUT_ERROR ((uint8_t)0x60)
mbed_official 489:119543c9f674 88 #define PCCARD_BUSY ((uint8_t)0x80)
mbed_official 489:119543c9f674 89 #define PCCARD_PROGR ((uint8_t)0x01)
mbed_official 489:119543c9f674 90 #define PCCARD_READY ((uint8_t)0x40)
mbed_official 489:119543c9f674 91
mbed_official 489:119543c9f674 92 #define PCCARD_SECTOR_SIZE ((uint32_t)255) /* In half words */
mbed_official 489:119543c9f674 93
mbed_official 489:119543c9f674 94
mbed_official 489:119543c9f674 95 /* Compact Flash redefinition */
mbed_official 489:119543c9f674 96 #define HAL_CF_Read_ID HAL_PCCARD_Read_ID
mbed_official 489:119543c9f674 97 #define HAL_CF_Write_Sector HAL_PCCARD_Write_Sector
mbed_official 489:119543c9f674 98 #define HAL_CF_Read_Sector HAL_PCCARD_Read_Sector
mbed_official 489:119543c9f674 99 #define HAL_CF_Erase_Sector HAL_PCCARD_Erase_Sector
mbed_official 489:119543c9f674 100 #define HAL_CF_Reset HAL_PCCARD_Reset
mbed_official 489:119543c9f674 101
mbed_official 489:119543c9f674 102 #define HAL_CF_GetStatus HAL_PCCARD_GetStatus
mbed_official 489:119543c9f674 103 #define HAL_CF_ReadStatus HAL_PCCARD_ReadStatus
mbed_official 489:119543c9f674 104
mbed_official 489:119543c9f674 105 #define CF_SUCCESS HAL_PCCARD_STATUS_SUCCESS
mbed_official 489:119543c9f674 106 #define CF_ONGOING HAL_PCCARD_STATUS_ONGOING
mbed_official 489:119543c9f674 107 #define CF_ERROR HAL_PCCARD_STATUS_ERROR
mbed_official 489:119543c9f674 108 #define CF_TIMEOUT HAL_PCCARD_STATUS_TIMEOUT
mbed_official 489:119543c9f674 109 #define CF_StatusTypedef HAL_PCCARD_StatusTypeDef
mbed_official 489:119543c9f674 110
mbed_official 489:119543c9f674 111
mbed_official 489:119543c9f674 112 #define CF_DEVICE_ADDRESS PCCARD_DEVICE_ADDRESS
mbed_official 489:119543c9f674 113 #define CF_ATTRIBUTE_SPACE_ADDRESS PCCARD_ATTRIBUTE_SPACE_ADDRESS
mbed_official 489:119543c9f674 114 #define CF_COMMON_SPACE_ADDRESS PCCARD_COMMON_SPACE_ADDRESS
mbed_official 489:119543c9f674 115 #define CF_IO_SPACE_ADDRESS PCCARD_IO_SPACE_ADDRESS
mbed_official 489:119543c9f674 116 #define CF_IO_SPACE_PRIMARY_ADDR PCCARD_IO_SPACE_PRIMARY_ADDR
mbed_official 489:119543c9f674 117
mbed_official 489:119543c9f674 118 #define CF_TIMEOUT_ERROR PCCARD_TIMEOUT_ERROR
mbed_official 489:119543c9f674 119 #define CF_BUSY PCCARD_BUSY
mbed_official 489:119543c9f674 120 #define CF_PROGR PCCARD_PROGR
mbed_official 489:119543c9f674 121 #define CF_READY PCCARD_READY
mbed_official 489:119543c9f674 122
mbed_official 489:119543c9f674 123 #define CF_SECTOR_SIZE PCCARD_SECTOR_SIZE
mbed_official 489:119543c9f674 124
mbed_official 489:119543c9f674 125 /**
mbed_official 489:119543c9f674 126 * @}
mbed_official 489:119543c9f674 127 */
mbed_official 489:119543c9f674 128
mbed_official 489:119543c9f674 129 /* Exported typedef ----------------------------------------------------------*/
mbed_official 489:119543c9f674 130 /** @defgroup PCCARD_Exported_Types PCCARD Exported Types
mbed_official 489:119543c9f674 131 * @{
mbed_official 489:119543c9f674 132 */
mbed_official 489:119543c9f674 133
mbed_official 489:119543c9f674 134 /**
mbed_official 489:119543c9f674 135 * @brief HAL PCCARD State structures definition
mbed_official 489:119543c9f674 136 */
mbed_official 489:119543c9f674 137 typedef enum
mbed_official 489:119543c9f674 138 {
mbed_official 489:119543c9f674 139 HAL_PCCARD_STATE_RESET = 0x00, /*!< PCCARD peripheral not yet initialized or disabled */
mbed_official 489:119543c9f674 140 HAL_PCCARD_STATE_READY = 0x01, /*!< PCCARD peripheral ready */
mbed_official 489:119543c9f674 141 HAL_PCCARD_STATE_BUSY = 0x02, /*!< PCCARD peripheral busy */
mbed_official 489:119543c9f674 142 HAL_PCCARD_STATE_ERROR = 0x04 /*!< PCCARD peripheral error */
mbed_official 489:119543c9f674 143 }HAL_PCCARD_StateTypeDef;
mbed_official 489:119543c9f674 144
mbed_official 489:119543c9f674 145 typedef enum
mbed_official 489:119543c9f674 146 {
mbed_official 489:119543c9f674 147 HAL_PCCARD_STATUS_SUCCESS = 0,
mbed_official 489:119543c9f674 148 HAL_PCCARD_STATUS_ONGOING,
mbed_official 489:119543c9f674 149 HAL_PCCARD_STATUS_ERROR,
mbed_official 489:119543c9f674 150 HAL_PCCARD_STATUS_TIMEOUT
mbed_official 489:119543c9f674 151 }HAL_PCCARD_StatusTypeDef;
mbed_official 489:119543c9f674 152
mbed_official 489:119543c9f674 153 /**
mbed_official 489:119543c9f674 154 * @brief FSMC_PCCARD handle Structure definition
mbed_official 489:119543c9f674 155 */
mbed_official 489:119543c9f674 156 typedef struct
mbed_official 489:119543c9f674 157 {
mbed_official 489:119543c9f674 158 FSMC_PCCARD_TypeDef *Instance; /*!< Register base address for PCCARD device */
mbed_official 489:119543c9f674 159
mbed_official 489:119543c9f674 160 FSMC_PCCARD_InitTypeDef Init; /*!< PCCARD device control configuration parameters */
mbed_official 489:119543c9f674 161
mbed_official 489:119543c9f674 162 __IO HAL_PCCARD_StateTypeDef State; /*!< PCCARD device access state */
mbed_official 489:119543c9f674 163
mbed_official 489:119543c9f674 164 HAL_LockTypeDef Lock; /*!< PCCARD Lock */
mbed_official 489:119543c9f674 165
mbed_official 489:119543c9f674 166 }PCCARD_HandleTypeDef;
mbed_official 489:119543c9f674 167 /**
mbed_official 489:119543c9f674 168 * @}
mbed_official 489:119543c9f674 169 */
mbed_official 489:119543c9f674 170
mbed_official 489:119543c9f674 171 /* Exported constants --------------------------------------------------------*/
mbed_official 489:119543c9f674 172 /* Exported macro ------------------------------------------------------------*/
mbed_official 489:119543c9f674 173 /** @defgroup PCCARD_Exported_Macros PCCARD Exported Macros
mbed_official 489:119543c9f674 174 * @{
mbed_official 489:119543c9f674 175 */
mbed_official 489:119543c9f674 176
mbed_official 489:119543c9f674 177 /** @brief Reset PCCARD handle state
mbed_official 489:119543c9f674 178 * @param __HANDLE__: specifies the PCCARD handle.
mbed_official 489:119543c9f674 179 * @retval None
mbed_official 489:119543c9f674 180 */
mbed_official 489:119543c9f674 181 #define __HAL_PCCARD_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_PCCARD_STATE_RESET)
mbed_official 489:119543c9f674 182 /**
mbed_official 489:119543c9f674 183 * @}
mbed_official 489:119543c9f674 184 */
mbed_official 489:119543c9f674 185
mbed_official 489:119543c9f674 186 /* Exported functions --------------------------------------------------------*/
mbed_official 489:119543c9f674 187 /** @addtogroup PCCARD_Exported_Functions PCCARD Exported Functions
mbed_official 489:119543c9f674 188 * @{
mbed_official 489:119543c9f674 189 */
mbed_official 489:119543c9f674 190
mbed_official 489:119543c9f674 191 /** @addtogroup PCCARD_Exported_Functions_Group1 Initialization and de-initialization functions
mbed_official 489:119543c9f674 192 * @{
mbed_official 489:119543c9f674 193 */
mbed_official 489:119543c9f674 194 /* Initialization/de-initialization functions **********************************/
mbed_official 489:119543c9f674 195 HAL_StatusTypeDef HAL_PCCARD_Init(PCCARD_HandleTypeDef *hpccard, FSMC_NAND_PCC_TimingTypeDef *ComSpaceTiming, FSMC_NAND_PCC_TimingTypeDef *AttSpaceTiming, FSMC_NAND_PCC_TimingTypeDef *IOSpaceTiming);
mbed_official 489:119543c9f674 196 HAL_StatusTypeDef HAL_PCCARD_DeInit(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 197 void HAL_PCCARD_MspInit(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 198 void HAL_PCCARD_MspDeInit(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 199 /**
mbed_official 489:119543c9f674 200 * @}
mbed_official 489:119543c9f674 201 */
mbed_official 489:119543c9f674 202
mbed_official 489:119543c9f674 203 /** @addtogroup PCCARD_Exported_Functions_Group2 Input Output and memory functions
mbed_official 489:119543c9f674 204 * @{
mbed_official 489:119543c9f674 205 */
mbed_official 489:119543c9f674 206 /* IO operation functions *****************************************************/
mbed_official 489:119543c9f674 207 HAL_StatusTypeDef HAL_PCCARD_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactFlash_ID[], uint8_t *pStatus);
mbed_official 489:119543c9f674 208 HAL_StatusTypeDef HAL_PCCARD_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus);
mbed_official 489:119543c9f674 209 HAL_StatusTypeDef HAL_PCCARD_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus);
mbed_official 489:119543c9f674 210 HAL_StatusTypeDef HAL_PCCARD_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t SectorAddress, uint8_t *pStatus);
mbed_official 489:119543c9f674 211 HAL_StatusTypeDef HAL_PCCARD_Reset(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 212 void HAL_PCCARD_IRQHandler(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 213 void HAL_PCCARD_ITCallback(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 214
mbed_official 489:119543c9f674 215 /**
mbed_official 489:119543c9f674 216 * @}
mbed_official 489:119543c9f674 217 */
mbed_official 489:119543c9f674 218
mbed_official 489:119543c9f674 219 /** @defgroup PCCARD_Exported_Functions_Group3 Peripheral State functions
mbed_official 489:119543c9f674 220 * @{
mbed_official 489:119543c9f674 221 */
mbed_official 489:119543c9f674 222 /* PCCARD State functions *******************************************************/
mbed_official 489:119543c9f674 223 HAL_PCCARD_StateTypeDef HAL_PCCARD_GetState(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 224 HAL_PCCARD_StatusTypeDef HAL_PCCARD_GetStatus(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 225 HAL_PCCARD_StatusTypeDef HAL_PCCARD_ReadStatus(PCCARD_HandleTypeDef *hpccard);
mbed_official 489:119543c9f674 226 /**
mbed_official 489:119543c9f674 227 * @}
mbed_official 489:119543c9f674 228 */
mbed_official 489:119543c9f674 229
mbed_official 489:119543c9f674 230 /**
mbed_official 489:119543c9f674 231 * @}
mbed_official 489:119543c9f674 232 */
mbed_official 489:119543c9f674 233
mbed_official 489:119543c9f674 234 /**
mbed_official 489:119543c9f674 235 * @}
mbed_official 489:119543c9f674 236 */
mbed_official 489:119543c9f674 237
mbed_official 489:119543c9f674 238 #endif /* STM32F101xE || STM32F103xE || STM32F101xG || STM32F103xG */
mbed_official 489:119543c9f674 239 /**
mbed_official 489:119543c9f674 240 * @}
mbed_official 489:119543c9f674 241 */
mbed_official 489:119543c9f674 242
mbed_official 489:119543c9f674 243 #ifdef __cplusplus
mbed_official 489:119543c9f674 244 }
mbed_official 489:119543c9f674 245 #endif
mbed_official 489:119543c9f674 246
mbed_official 489:119543c9f674 247 #endif /* __STM32F1xx_HAL_PCCARD_H */
mbed_official 489:119543c9f674 248
mbed_official 489:119543c9f674 249 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/