Wirepas SDK
external_flash_gd25lb256e.h
Go to the documentation of this file.
1/* Copyright 2022 Wirepas Ltd. All Rights Reserved.
2 *
3 * See file LICENSE.txt for full license details.
4 *
5 */
6#ifndef EXTERNAL_FLASH_GD25LB256E_H_
7#define EXTERNAL_FLASH_GD25LB256E_H_
8
9//GD25LB256E rev 1.9
10
11
12// GD25LB256E chip identificatio (page 19)
13#define GD25LB256E_ID_1 0xC8 //M7-M0
14#define GD25LB256E_ID_2 0x67 //ID23-ID16
15#define GD25LB256E_ID_3 0x19 //ID15-ID8
16#define GD25LB256E_ID_4 0xff //ID7-ID0
17// GD25LB256E Status register.
18typedef enum
19{
20 GD25LB256E_STATUS_WIP = 0x01, // Write In Progress = Busy
21 GD25LB256E_STATUS_WEL = 0x02, // Write Enable Latch
23
24// GD25LB256E Flag Status register.
25typedef enum
26{
27 GD25LB256E_FLAGSTATUS_ADS = 0x01, // Current Address Mode
28 GD25LB256E_FLAGSTATUS_PTE = 0x02, // Protection Error bit
29 GD25LB256E_FLAGSTATUS_SUS2 = 0x04, // Program Suspend
30 GD25LB256E_FLAGSTATUS_PE = 0x10, // Program Error bit
31 GD25LB256E_FLAGSTATUS_EE = 0x20, // Erase Error bit
32 GD25LB256E_FLAGSTATUS_SUS1 = 0x40, // Erase Suspend
35
36// GD25LB256E Maximum transfer size.
37// Limited by Nordic SPI master to 255 bytes per SPI DMA transaction.
38#define GD25LB256E_MAX_TRANSFER_SIZE 0xff
39
40// SPI commands
41enum {
53
54#endif // EXTERNAL_FLASH_GD25LB256E_H_
enum @5 ext_flash_cmd_t
@ GD25LB256E_STATUS_WIP
@ GD25LB256E_STATUS_WEL
@ GD25LB256E_CMD_WRITE_ENABLE
@ GD25LB256E_CMD_WRITE_STATUS
@ GD25LB256E_CMD_READ_IDENTIFICATION
@ GD25LB256E_CMD_READ_ARRAY
@ GD25LB256E_CMD_BLOCK_ERASE_32K
@ GD25LB256E_CMD_PROGRAM_PAGE
@ GD25LB256E_CMD_SECTOR_ERASE
@ GD25LB256E_CMD_READ_STATUS
@ GD25LB256E_CMD_WRITE_DISABLE
@ GD25LB256E_CMD_READ_FLAG_STATUS
@ GD25LB256E_FLAGSTATUS_SUS1
@ GD25LB256E_FLAGSTATUS_SUS2
@ GD25LB256E_FLAGSTATUS_EE
@ GD25LB256E_FLAGSTATUS_BY
@ GD25LB256E_FLAGSTATUS_PE
@ GD25LB256E_FLAGSTATUS_ADS
@ GD25LB256E_FLAGSTATUS_PTE