mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
targets/cmsis/TARGET_STM/TARGET_NUCLEO_F401RE/stm32f4xx_hal_pccard.h@226:b062af740e40, 2014-06-11 (annotated)
- Committer:
- mbed_official
- Date:
- Wed Jun 11 09:45:09 2014 +0100
- Revision:
- 226:b062af740e40
- Parent:
- 106:ced8cbb51063
Synchronized with git revision 42deb9ac55f9bdf9835e9c41dc757117d344ffda
Full URL: https://github.com/mbedmicro/mbed/commit/42deb9ac55f9bdf9835e9c41dc757117d344ffda/
[NUCLEO_F401RE] Remove call to Systick + bug fixes
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 87:085cde657901 | 1 | /** |
mbed_official | 87:085cde657901 | 2 | ****************************************************************************** |
mbed_official | 87:085cde657901 | 3 | * @file stm32f4xx_hal_pccard.h |
mbed_official | 87:085cde657901 | 4 | * @author MCD Application Team |
mbed_official | 226:b062af740e40 | 5 | * @version V1.1.0RC2 |
mbed_official | 226:b062af740e40 | 6 | * @date 14-May-2014 |
mbed_official | 87:085cde657901 | 7 | * @brief Header file of PCCARD HAL module. |
mbed_official | 87:085cde657901 | 8 | ****************************************************************************** |
mbed_official | 87:085cde657901 | 9 | * @attention |
mbed_official | 87:085cde657901 | 10 | * |
mbed_official | 87:085cde657901 | 11 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
mbed_official | 87:085cde657901 | 12 | * |
mbed_official | 87:085cde657901 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
mbed_official | 87:085cde657901 | 14 | * are permitted provided that the following conditions are met: |
mbed_official | 87:085cde657901 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
mbed_official | 87:085cde657901 | 16 | * this list of conditions and the following disclaimer. |
mbed_official | 87:085cde657901 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
mbed_official | 87:085cde657901 | 18 | * this list of conditions and the following disclaimer in the documentation |
mbed_official | 87:085cde657901 | 19 | * and/or other materials provided with the distribution. |
mbed_official | 87:085cde657901 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
mbed_official | 87:085cde657901 | 21 | * may be used to endorse or promote products derived from this software |
mbed_official | 87:085cde657901 | 22 | * without specific prior written permission. |
mbed_official | 87:085cde657901 | 23 | * |
mbed_official | 87:085cde657901 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 87:085cde657901 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 87:085cde657901 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
mbed_official | 87:085cde657901 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
mbed_official | 87:085cde657901 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
mbed_official | 87:085cde657901 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
mbed_official | 87:085cde657901 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
mbed_official | 87:085cde657901 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
mbed_official | 87:085cde657901 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
mbed_official | 87:085cde657901 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 87:085cde657901 | 34 | * |
mbed_official | 87:085cde657901 | 35 | ****************************************************************************** |
mbed_official | 87:085cde657901 | 36 | */ |
mbed_official | 87:085cde657901 | 37 | |
mbed_official | 87:085cde657901 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
mbed_official | 87:085cde657901 | 39 | #ifndef __STM32F4xx_HAL_PCCARD_H |
mbed_official | 87:085cde657901 | 40 | #define __STM32F4xx_HAL_PCCARD_H |
mbed_official | 87:085cde657901 | 41 | |
mbed_official | 87:085cde657901 | 42 | #ifdef __cplusplus |
mbed_official | 87:085cde657901 | 43 | extern "C" { |
mbed_official | 87:085cde657901 | 44 | #endif |
mbed_official | 87:085cde657901 | 45 | |
mbed_official | 87:085cde657901 | 46 | /* Includes ------------------------------------------------------------------*/ |
mbed_official | 87:085cde657901 | 47 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx)|| defined(STM32F417xx) |
mbed_official | 87:085cde657901 | 48 | #include "stm32f4xx_ll_fsmc.h" |
mbed_official | 87:085cde657901 | 49 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx */ |
mbed_official | 87:085cde657901 | 50 | |
mbed_official | 87:085cde657901 | 51 | #if defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx)|| defined(STM32F439xx) |
mbed_official | 87:085cde657901 | 52 | #include "stm32f4xx_ll_fmc.h" |
mbed_official | 87:085cde657901 | 53 | #endif /* STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ |
mbed_official | 87:085cde657901 | 54 | |
mbed_official | 87:085cde657901 | 55 | /** @addtogroup STM32F4xx_HAL_Driver |
mbed_official | 87:085cde657901 | 56 | * @{ |
mbed_official | 87:085cde657901 | 57 | */ |
mbed_official | 87:085cde657901 | 58 | |
mbed_official | 87:085cde657901 | 59 | /** @addtogroup PCCARD |
mbed_official | 87:085cde657901 | 60 | * @{ |
mbed_official | 87:085cde657901 | 61 | */ |
mbed_official | 87:085cde657901 | 62 | |
mbed_official | 87:085cde657901 | 63 | #if defined(STM32F405xx) || defined(STM32F415xx) || defined(STM32F407xx) || defined(STM32F417xx) || defined(STM32F427xx) || defined(STM32F437xx) || defined(STM32F429xx) || defined(STM32F439xx) |
mbed_official | 87:085cde657901 | 64 | |
mbed_official | 87:085cde657901 | 65 | /* Exported typedef ----------------------------------------------------------*/ |
mbed_official | 87:085cde657901 | 66 | |
mbed_official | 87:085cde657901 | 67 | /** |
mbed_official | 87:085cde657901 | 68 | * @brief HAL SRAM State structures definition |
mbed_official | 87:085cde657901 | 69 | */ |
mbed_official | 87:085cde657901 | 70 | typedef enum |
mbed_official | 87:085cde657901 | 71 | { |
mbed_official | 87:085cde657901 | 72 | HAL_PCCARD_STATE_RESET = 0x00, /*!< PCCARD peripheral not yet initialized or disabled */ |
mbed_official | 87:085cde657901 | 73 | HAL_PCCARD_STATE_READY = 0x01, /*!< PCCARD peripheral ready */ |
mbed_official | 87:085cde657901 | 74 | HAL_PCCARD_STATE_BUSY = 0x02, /*!< PCCARD peripheral busy */ |
mbed_official | 87:085cde657901 | 75 | HAL_PCCARD_STATE_ERROR = 0x04 /*!< PCCARD peripheral error */ |
mbed_official | 87:085cde657901 | 76 | }HAL_PCCARD_StateTypeDef; |
mbed_official | 87:085cde657901 | 77 | |
mbed_official | 87:085cde657901 | 78 | typedef enum |
mbed_official | 87:085cde657901 | 79 | { |
mbed_official | 87:085cde657901 | 80 | CF_SUCCESS = 0, |
mbed_official | 87:085cde657901 | 81 | CF_ONGOING, |
mbed_official | 87:085cde657901 | 82 | CF_ERROR, |
mbed_official | 87:085cde657901 | 83 | CF_TIMEOUT |
mbed_official | 87:085cde657901 | 84 | }CF_StatusTypedef; |
mbed_official | 87:085cde657901 | 85 | |
mbed_official | 87:085cde657901 | 86 | /** |
mbed_official | 87:085cde657901 | 87 | * @brief FMC_PCCARD handle Structure definition |
mbed_official | 87:085cde657901 | 88 | */ |
mbed_official | 87:085cde657901 | 89 | typedef struct |
mbed_official | 87:085cde657901 | 90 | { |
mbed_official | 87:085cde657901 | 91 | FMC_PCCARD_TypeDef *Instance; /*!< Register base address for PCCARD device */ |
mbed_official | 87:085cde657901 | 92 | |
mbed_official | 87:085cde657901 | 93 | FMC_PCCARD_InitTypeDef Init; /*!< PCCARD device control configuration parameters */ |
mbed_official | 87:085cde657901 | 94 | |
mbed_official | 87:085cde657901 | 95 | __IO HAL_PCCARD_StateTypeDef State; /*!< PCCARD device access state */ |
mbed_official | 87:085cde657901 | 96 | |
mbed_official | 87:085cde657901 | 97 | HAL_LockTypeDef Lock; /*!< PCCARD Lock */ |
mbed_official | 87:085cde657901 | 98 | |
mbed_official | 87:085cde657901 | 99 | }PCCARD_HandleTypeDef; |
mbed_official | 87:085cde657901 | 100 | |
mbed_official | 87:085cde657901 | 101 | |
mbed_official | 87:085cde657901 | 102 | /* Exported constants --------------------------------------------------------*/ |
mbed_official | 87:085cde657901 | 103 | /** @defgroup PCCARD_Exported_Constants |
mbed_official | 87:085cde657901 | 104 | * @{ |
mbed_official | 87:085cde657901 | 105 | */ |
mbed_official | 87:085cde657901 | 106 | |
mbed_official | 87:085cde657901 | 107 | #define CF_DEVICE_ADDRESS ((uint32_t)0x90000000) |
mbed_official | 87:085cde657901 | 108 | #define CF_ATTRIBUTE_SPACE_ADDRESS ((uint32_t)0x98000000) /* Attribute space size to @0x9BFF FFFF */ |
mbed_official | 87:085cde657901 | 109 | #define CF_COMMON_SPACE_ADDRESS CF_DEVICE_ADDRESS /* Common space size to @0x93FF FFFF */ |
mbed_official | 87:085cde657901 | 110 | #define CF_IO_SPACE_ADDRESS ((uint32_t)0x9C000000) /* IO space size to @0x9FFF FFFF */ |
mbed_official | 87:085cde657901 | 111 | #define CF_IO_SPACE_PRIMARY_ADDR ((uint32_t)0x9C0001F0) /* IO space size to @0x9FFF FFFF */ |
mbed_official | 87:085cde657901 | 112 | |
mbed_official | 87:085cde657901 | 113 | /* Compact Flash-ATA registers description */ |
mbed_official | 87:085cde657901 | 114 | #define CF_DATA ((uint8_t)0x00) /* Data register */ |
mbed_official | 87:085cde657901 | 115 | #define CF_SECTOR_COUNT ((uint8_t)0x02) /* Sector Count register */ |
mbed_official | 87:085cde657901 | 116 | #define CF_SECTOR_NUMBER ((uint8_t)0x03) /* Sector Number register */ |
mbed_official | 87:085cde657901 | 117 | #define CF_CYLINDER_LOW ((uint8_t)0x04) /* Cylinder low register */ |
mbed_official | 87:085cde657901 | 118 | #define CF_CYLINDER_HIGH ((uint8_t)0x05) /* Cylinder high register */ |
mbed_official | 87:085cde657901 | 119 | #define CF_CARD_HEAD ((uint8_t)0x06) /* Card/Head register */ |
mbed_official | 87:085cde657901 | 120 | #define CF_STATUS_CMD ((uint8_t)0x07) /* Status(read)/Command(write) register */ |
mbed_official | 87:085cde657901 | 121 | #define CF_STATUS_CMD_ALTERNATE ((uint8_t)0x0E) /* Alternate Status(read)/Command(write) register */ |
mbed_official | 87:085cde657901 | 122 | #define CF_COMMON_DATA_AREA ((uint16_t)0x0400) /* Start of data area (for Common access only!) */ |
mbed_official | 87:085cde657901 | 123 | |
mbed_official | 87:085cde657901 | 124 | /* Compact Flash-ATA commands */ |
mbed_official | 87:085cde657901 | 125 | #define CF_READ_SECTOR_CMD ((uint8_t)0x20) |
mbed_official | 87:085cde657901 | 126 | #define CF_WRITE_SECTOR_CMD ((uint8_t)0x30) |
mbed_official | 87:085cde657901 | 127 | #define CF_ERASE_SECTOR_CMD ((uint8_t)0xC0) |
mbed_official | 87:085cde657901 | 128 | #define CF_IDENTIFY_CMD ((uint8_t)0xEC) |
mbed_official | 87:085cde657901 | 129 | |
mbed_official | 87:085cde657901 | 130 | /* Compact Flash status */ |
mbed_official | 87:085cde657901 | 131 | #define CF_TIMEOUT_ERROR ((uint8_t)0x60) |
mbed_official | 87:085cde657901 | 132 | #define CF_BUSY ((uint8_t)0x80) |
mbed_official | 87:085cde657901 | 133 | #define CF_PROGR ((uint8_t)0x01) |
mbed_official | 87:085cde657901 | 134 | #define CF_READY ((uint8_t)0x40) |
mbed_official | 87:085cde657901 | 135 | |
mbed_official | 87:085cde657901 | 136 | #define CF_SECTOR_SIZE ((uint32_t)255) /* In half words */ |
mbed_official | 87:085cde657901 | 137 | |
mbed_official | 87:085cde657901 | 138 | /** |
mbed_official | 87:085cde657901 | 139 | * @} |
mbed_official | 87:085cde657901 | 140 | */ |
mbed_official | 226:b062af740e40 | 141 | /* Exported macro ------------------------------------------------------------*/ |
mbed_official | 226:b062af740e40 | 142 | |
mbed_official | 226:b062af740e40 | 143 | /** @brief Reset PCCARD handle state |
mbed_official | 226:b062af740e40 | 144 | * @param __HANDLE__: specifies the PCCARD handle. |
mbed_official | 226:b062af740e40 | 145 | * @retval None |
mbed_official | 226:b062af740e40 | 146 | */ |
mbed_official | 226:b062af740e40 | 147 | #define __HAL_PCCARD_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_PCCARD_STATE_RESET) |
mbed_official | 87:085cde657901 | 148 | |
mbed_official | 87:085cde657901 | 149 | /* Exported functions --------------------------------------------------------*/ |
mbed_official | 87:085cde657901 | 150 | /* Initialization/de-initialization functions **********************************/ |
mbed_official | 87:085cde657901 | 151 | HAL_StatusTypeDef HAL_PCCARD_Init(PCCARD_HandleTypeDef *hpccard, FMC_NAND_PCC_TimingTypeDef *ComSpaceTiming, FMC_NAND_PCC_TimingTypeDef *AttSpaceTiming, FMC_NAND_PCC_TimingTypeDef *IOSpaceTiming); |
mbed_official | 87:085cde657901 | 152 | HAL_StatusTypeDef HAL_PCCARD_DeInit(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 106:ced8cbb51063 | 153 | void HAL_PCCARD_MspInit(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 106:ced8cbb51063 | 154 | void HAL_PCCARD_MspDeInit(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 87:085cde657901 | 155 | |
mbed_official | 87:085cde657901 | 156 | /* IO operation functions *****************************************************/ |
mbed_official | 87:085cde657901 | 157 | HAL_StatusTypeDef HAL_CF_Read_ID(PCCARD_HandleTypeDef *hpccard, uint8_t CompactFlash_ID[], uint8_t *pStatus); |
mbed_official | 87:085cde657901 | 158 | HAL_StatusTypeDef HAL_CF_Write_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus); |
mbed_official | 87:085cde657901 | 159 | HAL_StatusTypeDef HAL_CF_Read_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t *pBuffer, uint16_t SectorAddress, uint8_t *pStatus); |
mbed_official | 87:085cde657901 | 160 | HAL_StatusTypeDef HAL_CF_Erase_Sector(PCCARD_HandleTypeDef *hpccard, uint16_t SectorAddress, uint8_t *pStatus); |
mbed_official | 87:085cde657901 | 161 | HAL_StatusTypeDef HAL_CF_Reset(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 87:085cde657901 | 162 | void HAL_PCCARD_IRQHandler(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 106:ced8cbb51063 | 163 | void HAL_PCCARD_ITCallback(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 87:085cde657901 | 164 | |
mbed_official | 87:085cde657901 | 165 | /* PCCARD State functions *******************************************************/ |
mbed_official | 87:085cde657901 | 166 | HAL_PCCARD_StateTypeDef HAL_PCCARD_GetState(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 87:085cde657901 | 167 | CF_StatusTypedef HAL_CF_GetStatus(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 87:085cde657901 | 168 | CF_StatusTypedef HAL_CF_ReadStatus(PCCARD_HandleTypeDef *hpccard); |
mbed_official | 87:085cde657901 | 169 | |
mbed_official | 87:085cde657901 | 170 | #endif /* STM32F405xx || STM32F415xx || STM32F407xx || STM32F417xx || STM32F427xx || STM32F437xx || STM32F429xx || STM32F439xx */ |
mbed_official | 87:085cde657901 | 171 | /** |
mbed_official | 87:085cde657901 | 172 | * @} |
mbed_official | 87:085cde657901 | 173 | */ |
mbed_official | 87:085cde657901 | 174 | |
mbed_official | 87:085cde657901 | 175 | /** |
mbed_official | 87:085cde657901 | 176 | * @} |
mbed_official | 87:085cde657901 | 177 | */ |
mbed_official | 87:085cde657901 | 178 | |
mbed_official | 87:085cde657901 | 179 | #ifdef __cplusplus |
mbed_official | 87:085cde657901 | 180 | } |
mbed_official | 87:085cde657901 | 181 | #endif |
mbed_official | 87:085cde657901 | 182 | |
mbed_official | 87:085cde657901 | 183 | #endif /* __STM32F4xx_HAL_PCCARD_H */ |
mbed_official | 87:085cde657901 | 184 | |
mbed_official | 87:085cde657901 | 185 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |