SmartSnippets DA1459x SDK
qspi_automode_v2.h
Go to the documentation of this file.
1 
42 #ifndef QSPI_AUTOMODE_V2_H_
43 #define QSPI_AUTOMODE_V2_H_
44 
45 #if dg_configQSPI_AUTOMODE_ENABLE
46 
47 #include <stdio.h>
48 #include <stdint.h>
49 #include <string.h>
50 #include <sdk_defs.h>
51 #include "hw_qspi.h"
52 #include "hw_clk.h"
53 #include "qspi_common.h"
54 
55 /*
56  * Defines (generic)
57  */
58 #define QSPI_FLASH_PAGE_SIZE (0x100)
59 #define QSPI_FLASH_SECTOR_SIZE (FLASH_SECTOR_SIZE)
60 
69 typedef enum {
70  QSPI_AUTOMODE_MEMORY_STATUS_ABSENT = 0,
71  QSPI_AUTOMODE_MEMORY_STATUS_PRESENT_UNIDENTIFIED = 1,
75  QSPI_AUTOMODE_MEMORY_STATUS_PRESENT_IDENTIFIED = 2,
77 } QSPI_AUTOMODE_MEMORY_STATUS;
78 
106 __RETAINED_CODE uint32_t qspi_automode_write_flash_page(uint32_t addr, const uint8_t *buf, uint32_t size);
107 
124 __RETAINED_CODE bool qspi_automode_erase_flash_sector(uint32_t addr);
125 
133 void qspi_automode_erase_chip(uint32_t virtual_base_addr);
134 
148 uint32_t qspi_automode_read(uint32_t addr, uint8_t *buf, uint32_t len);
149 
164 const void *qspi_automode_get_physical_addr(uint32_t virtual_addr);
165 
169 __RETAINED_CODE void qspi_automode_flash_power_up(void);
170 
174 __RETAINED_CODE void qspi_automode_flash_power_down(void);
175 
181 __RETAINED_CODE bool qspi_automode_init(void);
182 
192 __RETAINED_CODE void qspi_automode_sys_clock_cfg(sys_clk_t sys_clk);
193 
208 __RETAINED_CODE bool qspi_automode_is_valid_virtual_address_range(uint32_t addr, uint32_t len);
209 
218 __RETAINED_CODE bool qspi_automode_is_valid_virtual_addr(uint32_t addr);
219 
227 uint32_t qspi_automode_get_memory_size(uint32_t addr);
228 
272 __RETAINED_CODE QSPI_AUTOMODE_MEMORY_STATUS qspi_automode_read_jedec_id(uint32_t addr, jedec_id_t *jedec);
273 
282 __RETAINED_CODE bool qspi_automode_is_ram(uint32_t addr);
283 
284 
285 #endif /* dg_configQSPI_AUTOMODE_ENABLE */
286 
287 #endif /* QSPI_AUTOMODE_V2_H_ */
288 
sdk_defs.h
Central include header file with platform definitions.
sys_clk_t
enum sysclk_type sys_clk_t
The system clock type.
hw_qspi.h
Low Level Driver of QSPI controllers.
hw_clk.h
Clock Driver header file.
jedec_id_t
JEDEC ID struct.
Definition: qspi_common_v2.h:119
qspi_common.h
QSPI flash driver common definitions.