1 /*
2 * Copyright (c) 2016 - 2019, Texas Instruments Incorporated
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the
15 * distribution.
16 *
17 * Neither the name of Texas Instruments Incorporated nor the names of
18 * its contributors may be used to endorse or promote products derived
19 * from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 */
35 /**
36 *
37 * \file n25q128a13esf40f.h
38 *
39 * \brief This file contains N25Q128A13ESF40F NOR device definitions
40 *
41 *****************************************************************************/
42 #ifndef N25Q128_H_
43 #define N25Q128_H_
45 #include <ti/drv/spi/SPI.h>
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
51 /**************************************************************************
52 ** Macro Definitions
53 **************************************************************************/
55 /*!
56 * @brief FLASH device specific items (note: sizes are in bytes)
57 */
58 #define NOR_BLOCK_SIZE (65536U)
59 #define NOR_SECTOR_SIZE (4096U)
60 #define NOR_SIZE (256U * 65536U)
61 #define NOR_NUM_BLOCKS (NOR_SIZE / NOR_BLOCK_SIZE)
62 #define NOR_NUM_SECTORS (NOR_SIZE / NOR_SECTOR_SIZE)
63 #define NOR_PAGE_SIZE (256U)
64 #define NOR_NUM_PAGES_PER_SECTOR (NOR_SECTOR_SIZE / NOR_PAGE_SIZE)
65 #define NOR_NUM_PAGES_PER_BLOCK (NOR_BLOCK_SIZE / NOR_PAGE_SIZE)
67 /*!
68 * @brief Flash device commands
69 */
70 #define NOR_BE_SECTOR_NUM (-1U)
71 #define NOR_CMD_BULK_ERASE (0xC7U)
72 #define NOR_CMD_BLOCK_ERASE (0xD8U)
73 #define NOR_CMD_SECTOR_ERASE (0x20U)
74 #define NOR_CMD_WREN (0x06U)
75 #define NOR_CMD_RDSR (0x05U)
76 #define NOR_CMD_RDID (0x9FU)
77 #define NOR_CMD_READ (0x03U)
78 #define NOR_CMD_PAGE_PROG (0x02U)
80 /*!
81 * @brief Read ID command definitions
82 */
83 #define NOR_RDID_NUM_BYTES (0x3U)
84 #define NOR_MANF_ID (0x20U) /* Manufacturer ID */
85 #define NOR_DEVICE_ID (0xBA18) /* Device ID */
87 /** Status Register, Write-in-Progress bit */
88 #define NOR_SR_WIP (1U << 0U)
90 /** In Micro seconds */
91 /*!
92 * @brief Timeout values in micro seconds
93 */
94 #define NOR_PAGE_PROG_TIMEOUT (400U)
95 #define NOR_SECTOR_ERASE_TIMEOUT (600U * 1000U)
96 #define NOR_BULK_ERASE_TIMEOUT (110U * 1000U * 1000U)
98 #ifdef __cplusplus
99 }
100 #endif
102 #endif /* N25Q128_H_ */