stm32100e_eval_fsmc_onenand.h

Go to the documentation of this file.
00001 /**
00002   ******************************************************************************
00003   * @file    stm32100e_eval_fsmc_onenand.h
00004   * @author  MCD Application Team
00005   * @version V4.3.0
00006   * @date    10/15/2010
00007   * @brief   This file contains all the functions prototypes for the 
00008   *          stm32100e_eval_fsmc_onenand firmware driver.
00009   ******************************************************************************
00010   * @copy
00011   *
00012   * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
00013   * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
00014   * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
00015   * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
00016   * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
00017   * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
00018   *
00019   * <h2><center>&copy; COPYRIGHT 2010 STMicroelectronics</center></h2>
00020   */
00021    
00022 /* Define to prevent recursive inclusion -------------------------------------*/
00023 #ifndef __STM32100E_EVAL_FSMC_ONENAND_H
00024 #define __STM32100E_EVAL_FSMC_ONENAND_H
00025 
00026 #ifdef __cplusplus
00027  extern "C" {
00028 #endif
00029 
00030 /* Includes ------------------------------------------------------------------*/
00031 #include "stm32f10x.h"
00032 
00033 /** @addtogroup Utilities
00034   * @{
00035   */
00036   
00037 /** @addtogroup STM32_EVAL
00038   * @{
00039   */ 
00040 
00041 /** @addtogroup STM32100E_EVAL
00042   * @{
00043   */
00044   
00045 /** @addtogroup STM32100E_EVAL_FSMC_ONENAND
00046   * @{
00047   */  
00048 
00049 /** @defgroup STM32100E_EVAL_FSMC_ONENAND_Exported_Types
00050   * @{
00051   */
00052   typedef struct
00053 {
00054   uint16_t Manufacturer_ID;
00055   uint16_t Device_ID;
00056 }OneNAND_IDTypeDef;
00057 
00058 /* OneNand Status */
00059 typedef enum
00060 {
00061   OneNAND_SUCCESS = 0,
00062   OneNAND_ONGOING,
00063   OneNAND_ERROR,
00064   OneNAND_TIMEOUT
00065 }OneNAND_Status;
00066  
00067 /**
00068   * @}
00069   */
00070   
00071 /** @defgroup STM32100E_EVAL_FSMC_ONENAND_Exported_Constants
00072   * @{
00073   */
00074 /** 
00075   * @brief  OneNAND memory command  
00076   */  
00077 #define OneNAND_CMD_ERASE                            0x0094
00078 #define OneNAND_CMD_MULTIPLE_ERASE                   0x0095
00079 #define OneNAND_CMD_ERASE_MULTI_BLOCK_VERIFY_READ    0x0071
00080 #define OneNAND_CMD_PROGRAM                          0x001A
00081 #define OneNAND_CMD_RESET                            0x00F0
00082 #define OneNAND_CMD_READ_ID                          0x0090
00083 
00084 /** 
00085   * @brief OneNand Register description  
00086   */  
00087 #define OneNAND_REG_MANUFACTERID             ((uint32_t)0x1E000) /* Manufacturer identification */
00088 #define OneNAND_REG_DEVICEID                 ((uint32_t)0x1E002) /* Device identification */
00089 #define OneNAND_REG_DATABUFFERSIZE           ((uint32_t)0x1E006) /* Data Buffer size */
00090 #define OneNAND_REG_BOOTBUFFERSIZE           ((uint32_t)0x1E008) /* Boot Buffer size */
00091 #define OneNAND_REG_AMOUNTOFBUFFERS          ((uint32_t)0x1E00A) /* Amount of data/boot buffers */
00092 #define OneNAND_REG_TECHNOLOGY               ((uint32_t)0x1E00C) /* Info about technology */
00093 #define OneNAND_REG_STARTADDRESS1            ((uint32_t)0x1E200) /* Nand Flash Block Address */
00094 #define OneNAND_REG_STARTADDRESS3            ((uint32_t)0x1E204) /* Destination Block address for copy back program */
00095 #define OneNAND_REG_STARTADDRESS4            ((uint32_t)0x1E206) /* Destination Page & sector address for copy back program */
00096 #define OneNAND_REG_STARTADDRESINT8_T        ((uint32_t)0x1E20E) /* Nand Flash Page & sector address */
00097 #define OneNAND_REG_STARTBUFFER              ((uint32_t)0x1E400) /* The meaning is with which buffer to start and how many
00098                                                                      buffers to use for the data transfer */
00099 #define OneNAND_REG_COMMAND                  ((uint32_t)0x1E440) /* Host control and memory operation commands*/
00100 #define OneNAND_REG_SYSTEMCONFIGURATION      ((uint32_t)0x1E442) /* Memory and host interface configuration */
00101 #define OneNAND_REG_CONTROLSTATUS            ((uint32_t)0x1E480) /* Control status and result of memory operation */
00102 #define OneNAND_REG_INTERRUPT                ((uint32_t)0x1E482) /* Memory Command Completion Interrupt Status */
00103 #define OneNAND_REG_STARTBLOCKADDRESS        ((uint32_t)0x1E498) /* Start memory block address in Write Protection mode */
00104 #define OneNAND_REG_WRITEPROTECTIONSTATUS    ((uint32_t)0x1E49C) /* Current memory Write Protection status */
00105 #define OneNAND_REG_ECCSTATUS                ((uint32_t)0x1FE00) /* ECC status of sector */
00106 #define OneNAND_REG_ECCMAINAREA1             ((uint32_t)0x1FE02) /* ECC error position of Main area data  error 
00107                                                                      for first selected sector */
00108 #define OneNAND_REG_ECCSPAREAREA1            ((uint32_t)0x1FE04) /* ECC error position of Spare area data error 
00109                                                                      for first selected Sector */
00110 #define OneNAND_REG_ECCMAINAREA2             ((uint32_t)0x1FE06) /* ECC error position of Main area data  error 
00111                                                                      for second selected sector */
00112 #define OneNAND_REG_ECCSPAREAREA2            ((uint32_t)0x1FE08) /* ECC error position of Spare area data error 
00113                                                                      for second selected Sector */
00114 #define OneNAND_REG_ECCMAINAREA3             ((uint32_t)0x1FE0A) /* ECC error position of Main area data  error 
00115                                                                      for third selected sector */
00116 #define OneNAND_REG_ECCSPAREAREA3            ((uint32_t)0x1FE0C) /* ECC error position of Spare area data error 
00117                                                                      for third selected Sector */
00118 #define OneNAND_REG_ECCMAINAREA4             ((uint32_t)0x1FE0E) /* ECC error position of Main area data  error 
00119                                                                      for fourth selected sector */
00120 #define OneNAND_REG_ECCSPAREAREA4            ((uint32_t)0x1FE10) /* ECC error position of Spare area data error 
00121                                                                      for fourth selected Sector */
00122 
00123 /**
00124   * @}
00125   */ 
00126   
00127 /** @defgroup STM32100E_EVAL_FSMC_ONENAND_Exported_Macros
00128   * @{
00129   */ 
00130 /**
00131   * @}
00132   */ 
00133 
00134 /** @defgroup STM32100E_EVAL_FSMC_ONENAND_Exported_Functions
00135   * @{
00136   */ 
00137 void OneNAND_Init(void);
00138 void OneNAND_ReadID(OneNAND_IDTypeDef* OneNAND_ID);
00139 uint16_t OneNAND_ReadStatus(void);
00140 uint16_t OneNAND_ReadControllerStatus(void);
00141 uint16_t OneNAND_EraseBlock(uint32_t BlockAddr);
00142 void OneNAND_Reset(void);
00143 uint16_t OneNAND_Unlock(void);
00144 uint16_t OneNAND_WriteBuffer(uint16_t* pBuffer, uint32_t WriteAddr, uint32_t NumHalfwordToWrite);
00145 void OneNAND_AsynchronousRead(uint16_t* pBuffer, uint32_t ReadAddr, uint32_t NumHalfwordToRead);
00146 void OneNAND_SynchronousRead(uint16_t* pBuffer, uint32_t ReadAddr, uint32_t NumHalfwordToRead);
00147 
00148 #ifdef __cplusplus
00149 }
00150 #endif
00151 
00152 #endif /* __STM32100E_EVAL_FSMC_ONENAND_H */
00153 /**
00154   * @}
00155   */
00156 
00157 /**
00158   * @}
00159   */
00160 
00161 /**
00162   * @}
00163   */
00164 
00165 /**
00166   * @}
00167   */ 
00168 
00169 /**
00170   * @}
00171   */ 
00172 
00173 /******************* (C) COPYRIGHT 2010 STMicroelectronics *****END OF FILE****/
STM32F10x Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM32(CORTEX M3) 32-bit Microcontrollers platform visit  www.st.com/STM32