Callisto4Bootloader: include/c4_qspi.h Source File

Callisto4Bootloader

c4_qspi.h
Go to the documentation of this file.
1
11 #ifndef C4_QSPI_H_
12 #define C4_QSPI_H_
13
14 #include "c4_error_codes.h"
15 #include "flexspi_nor_flash.h"
16 #include <stdint.h> // for C99 types.
17
25 #ifndef max
26 #define max(a,b) \
27 ({ \
28 __typeof__ (a) _a = (a); \
29 __typeof__ (b) _b = (b); \
30 _a > _b ? _a : _b; \
31 })
32 #endif
33
40 #ifndef min
41 #define min(a,b) \
42 ({ \
43 __typeof__ (a) _a = (a); \
44 __typeof__ (b) _b = (b); \
45 _a < _b ? _a : _b; \
46 })
47 #endif
48
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52
57 exit_code_t C4_QSPI_init(void);
58
65 exit_code_t C4_QSPI_getConfig(flexspi_nor_config_t *pConfig);
66
80 exit_code_t C4_QSPI_erase(uintptr_t addr, size_t len);
81
95 exit_code_t C4_QSPI_read(uintptr_t addr, size_t len, uint8_t *pData);
96
97
112 exit_code_t C4_QSPI_write(uintptr_t addr, size_t len, const uint8_t *pData);
113
114 #ifdef __cplusplus
115 }
116 #endif
117
118
119 #endif /* C4_QSPI_H_ */
C4_QSPI_read
exit_code_t C4_QSPI_read(uintptr_t addr, size_t len, uint8_t *pData)
Read data from QSPI flash memory.
Definition: c4_qspi.c:184
c4_error_codes.h
Enumeration of Error Codes.
C4_QSPI_write
exit_code_t C4_QSPI_write(uintptr_t addr, size_t len, const uint8_t *pData)
Write data to QSPI flash memory.
Definition: c4_qspi.c:230
exit_code_t
exit_code_t
Enumeration of error codes.
Definition: c4_error_codes.h:96
C4_QSPI_erase
exit_code_t C4_QSPI_erase(uintptr_t addr, size_t len)
Erase region in QSPI flash memory.
Definition: c4_qspi.c:123
flexspi_nor_flash.h
C4_QSPI_init
exit_code_t C4_QSPI_init(void)
Initialise the flexSPI interface to QSPI.
Definition: c4_qspi.c:74
C4_QSPI_getConfig
exit_code_t C4_QSPI_getConfig(flexspi_nor_config_t *pConfig)
Get the current config of the QSPI flash.
Definition: c4_qspi.c:97
_flexspi_nor_config
Definition: flexspi_nor_flash.h:184