lib
inertial-sense-sdk
hw-libs
misc
flash_api.h
Go to the documentation of this file.
1
45
#ifndef _FLASH_API_H_
46
#define _FLASH_API_H_
47
48
#include <avr32/io.h>
49
#include "
compiler.h
"
50
51
52
#if defined(AVR32_FLASHC)
53
55
#define FLASH_API_BASE_ADDRESS AVR32_FLASH
56
57
#define FLASH_API_SIZE AVR32_FLASH_SIZE
58
60
#define FLASH_API_FLASH_SIZE AVR32_FLASHC_FLASH_SIZE
61
63
#define FLASH_API_PAGE_SIZE AVR32_FLASHC_PAGE_SIZE
64
66
#define FLASH_API_REGIONS AVR32_FLASHC_REGIONS
67
69
#define FLASH_API_USER_PAGE_SIZE AVR32_FLASHC_USER_PAGE_SIZE
70
72
#define FLASH_API_USER_PAGE AVR32_FLASHC_USER_PAGE
73
75
#define FLASH_API_USER_PAGE_ADDRESS AVR32_FLASHC_USER_PAGE_ADDRESS
76
78
#define FLASH_API_GPF_NUM AVR32_FLASHC_GPF_NUM
79
82
// Note: all commands supported by the flashc driver should be abstracted here.
84
#define FLASH_API_FCMD_CMD_EP AVR32_FLASHC_FCMD_CMD_EP
85
#define FLASH_API_FCMD_CMD_EUP AVR32_FLASHC_FCMD_CMD_EUP
86
88
89
#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
90
91
#include "flashc.h"
92
95
101
#define flash_api_get_flash_size flashc_get_flash_size
102
107
#define flash_api_get_page_count flashc_get_page_count
108
113
#define flash_api_get_page_count_per_region flashc_get_page_count_per_region
114
124
#define flash_api_get_page_region flashc_get_page_region
125
132
#define flash_api_get_region_first_page_number flashc_get_region_first_page_number
133
135
136
139
145
#define flash_api_get_wait_state flashc_get_wait_state
146
152
#define flash_api_set_wait_state flashc_set_wait_state
153
158
#define flash_api_is_ready_int_enabled flashc_is_ready_int_enabled
159
165
#define flash_api_enable_ready_int flashc_enable_ready_int
166
171
#define flash_api_is_lock_error_int_enabled flashc_is_lock_error_int_enabled
172
178
#define flash_api_enable_lock_error_int flashc_enable_lock_error_int
179
184
#define flash_api_is_prog_error_int_enabled flashc_is_prog_error_int_enabled
185
191
#define flash_api_enable_prog_error_int flashc_enable_prog_error_int
192
194
195
198
204
#define flash_api_is_ready flashc_is_ready
205
210
#define flash_api_default_wait_until_ready flashc_default_wait_until_ready
211
216
#define flash_api_wait_until_ready flashc_wait_until_ready
217
224
#define flash_api_is_lock_error flashc_is_lock_error
225
232
#define flash_api_is_programming_error flashc_is_programming_error
233
235
236
239
245
#define flash_api_get_command flashc_get_command
246
251
#define flash_api_get_page_number flashc_get_page_number
252
272
#define flash_api_issue_command flashc_issue_command
273
275
276
279
286
#define flash_api_no_operation flashc_no_operation
287
304
#define flash_api_erase_all flashc_erase_all
305
307
308
311
317
#define flash_api_is_security_bit_active flashc_is_security_bit_active
318
324
#define flash_api_activate_security_bit flashc_activate_security_bit
325
330
#define flash_api_get_bootloader_protected_size flashc_get_bootloader_protected_size
331
346
#define flash_api_set_bootloader_protected_size flashc_set_bootloader_protected_size
347
352
#define flash_api_is_external_privileged_fetch_locked flashc_is_external_privileged_fetch_locked
353
363
#define flash_api_lock_external_privileged_fetch flashc_lock_external_privileged_fetch
364
374
#define flash_api_is_page_region_locked flashc_is_page_region_locked
375
382
#define flash_api_is_region_locked flashc_is_region_locked
383
396
#define flash_api_lock_page_region flashc_lock_page_region
397
406
#define flash_api_lock_region flashc_lock_region
407
415
#define flash_api_lock_all_regions flashc_lock_all_regions
416
418
419
422
434
#define flash_api_read_gp_fuse_bit flashc_read_gp_fuse_bit
435
449
#define flash_api_read_gp_fuse_bitfield flashc_read_gp_fuse_bitfield
450
461
#define flash_api_read_gp_fuse_byte flashc_read_gp_fuse_byte
462
471
#define flash_api_read_all_gp_fuses flashc_read_all_gp_fuses
472
493
#define flash_api_erase_gp_fuse_bit flashc_erase_gp_fuse_bit
494
518
#define flash_api_erase_gp_fuse_bitfield flashc_erase_gp_fuse_bitfield
519
539
#define flash_api_erase_gp_fuse_byte flashc_erase_gp_fuse_byte
540
559
#define flash_api_erase_all_gp_fuses flashc_erase_all_gp_fuses
560
578
#define flash_api_write_gp_fuse_bit flashc_write_gp_fuse_bit
579
600
#define flash_api_write_gp_fuse_bitfield flashc_write_gp_fuse_bitfield
601
618
#define flash_api_write_gp_fuse_byte flashc_write_gp_fuse_byte
619
635
#define flash_api_write_all_gp_fuses flashc_write_all_gp_fuses
636
653
#define flash_api_set_gp_fuse_bit flashc_set_gp_fuse_bit
654
674
#define flash_api_set_gp_fuse_bitfield flashc_set_gp_fuse_bitfield
675
691
#define flash_api_set_gp_fuse_byte flashc_set_gp_fuse_byte
692
707
#define flash_api_set_all_gp_fuses flashc_set_all_gp_fuses
708
710
711
714
726
#define flash_api_clear_page_buffer flashc_clear_page_buffer
727
734
#define flash_api_is_page_erased flashc_is_page_erased
735
748
#define flash_api_quick_page_read flashc_quick_page_read
749
769
#define flash_api_erase_page flashc_erase_page
770
786
#define flash_api_erase_all_pages flashc_erase_all_pages
787
805
#define flash_api_write_page flashc_write_page
806
814
#define flash_api_quick_user_page_read flashc_quick_user_page_read
815
828
#define flash_api_erase_user_page flashc_erase_user_page
829
839
#define flash_api_write_user_page flashc_write_user_page
840
868
#define flash_api_memset8 flashc_memset8
869
897
#define flash_api_memset16 flashc_memset16
898
926
#define flash_api_memset32 flashc_memset32
927
955
#define flash_api_memset64 flashc_memset64
956
985
#define flash_api_memset flashc_memset
986
1017
#define flash_api_memcpy flashc_memcpy
1018
1020
#endif // __AVR32_ABI_COMPILER__
1021
1022
#elif defined(AVR32_FLASHCDW)
1023
1025
#define FLASH_API_BASE_ADDRESS AVR32_FLASHCDW_BASE_ADDRESS
1026
1027
#define FLASH_API_SIZE AVR32_FLASHCDW_FLASH_SIZE
1028
1030
#define FLASH_API_FLASH_SIZE AVR32_FLASHCDW_FLASH_SIZE
1031
1033
#define FLASH_API_PAGE_SIZE AVR32_FLASHCDW_PAGE_SIZE
1034
1036
#define FLASH_API_REGIONS AVR32_FLASHCDW_REGIONS
1037
1039
#define FLASH_API_USER_PAGE_SIZE AVR32_FLASHCDW_USER_PAGE_SIZE
1040
1042
#define FLASH_API_USER_PAGE AVR32_FLASHCDW_USER_PAGE
1043
1045
#define FLASH_API_USER_PAGE_ADDRESS AVR32_FLASHCDW_USER_PAGE_ADDRESS
1046
1048
#define FLASH_API_GPF_NUM AVR32_FLASHC_GPF_NUM
1049
1052
// Note: all commands supported by the flashcdw driver should be abstracted here.
1054
#define FLASH_API_FCMD_CMD_EP AVR32_FLASHCDW_FCMD_CMD_EP
1055
#define FLASH_API_FCMD_CMD_EUP AVR32_FLASHCDW_FCMD_CMD_EUP
1056
1058
1059
#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
1060
1061
#include "flashcdw.h"
1062
1065
1071
#define flash_api_get_flash_size flashcdw_get_flash_size
1072
1077
#define flash_api_get_page_count flashcdw_get_page_count
1078
1083
#define flash_api_get_page_count_per_region flashcdw_get_page_count_per_region
1084
1094
#define flash_api_get_page_region flashcdw_get_page_region
1095
1102
#define flash_api_get_region_first_page_number flashcdw_get_region_first_page_number
1103
1105
1106
1109
1115
#define flash_api_get_wait_state flashcdw_get_wait_state
1116
1122
#define flash_api_set_wait_state flashcdw_set_wait_state
1123
1128
#define flash_api_is_ready_int_enabled flashcdw_is_ready_int_enabled
1129
1135
#define flash_api_enable_ready_int flashcdw_enable_ready_int
1136
1141
#define flash_api_is_lock_error_int_enabled flashcdw_is_lock_error_int_enabled
1142
1148
#define flash_api_enable_lock_error_int flashcdw_enable_lock_error_int
1149
1154
#define flash_api_is_prog_error_int_enabled flashcdw_is_prog_error_int_enabled
1155
1161
#define flash_api_enable_prog_error_int flashcdw_enable_prog_error_int
1162
1164
1165
1168
1174
#define flash_api_is_ready flashcdw_is_ready
1175
1180
#define flash_api_default_wait_until_ready flashcdw_default_wait_until_ready
1181
1186
#define flash_api_wait_until_ready flashcdw_wait_until_ready
1187
1194
#define flash_api_is_lock_error flashcdw_is_lock_error
1195
1202
#define flash_api_is_programming_error flashcdw_is_programming_error
1203
1205
1206
1209
1215
#define flash_api_get_command flashcdw_get_command
1216
1221
#define flash_api_get_page_number flashcdw_get_page_number
1222
1242
#define flash_api_issue_command flashcdw_issue_command
1243
1245
1246
1249
1256
#define flash_api_no_operation flashcdw_no_operation
1257
1274
#define flash_api_erase_all flashcdw_erase_all
1275
1277
1278
1281
1287
#define flash_api_is_security_bit_active flashcdw_is_security_bit_active
1288
1294
#define flash_api_activate_security_bit flashcdw_activate_security_bit
1295
1300
#define flash_api_get_bootloader_protected_size flashcdw_get_bootloader_protected_size
1301
1316
#define flash_api_set_bootloader_protected_size flashcdw_set_bootloader_protected_size
1317
1322
#define flash_api_is_external_privileged_fetch_locked flashcdw_is_external_privileged_fetch_locked
1323
1333
#define flash_api_lock_external_privileged_fetch flashcdw_lock_external_privileged_fetch
1334
1344
#define flash_api_is_page_region_locked flashcdw_is_page_region_locked
1345
1352
#define flash_api_is_region_locked flashcdw_is_region_locked
1353
1366
#define flash_api_lock_page_region flashcdw_lock_page_region
1367
1376
#define flash_api_lock_region flashcdw_lock_region
1377
1385
#define flash_api_lock_all_regions flashcdw_lock_all_regions
1386
1388
1389
1392
1404
#define flash_api_read_gp_fuse_bit flashcdw_read_gp_fuse_bit
1405
1419
#define flash_api_read_gp_fuse_bitfield flashcdw_read_gp_fuse_bitfield
1420
1431
#define flash_api_read_gp_fuse_byte flashcdw_read_gp_fuse_byte
1432
1441
#define flash_api_read_all_gp_fuses flashcdw_read_all_gp_fuses
1442
1463
#define flash_api_erase_gp_fuse_bit flashcdw_erase_gp_fuse_bit
1464
1488
#define flash_api_erase_gp_fuse_bitfield flashcdw_erase_gp_fuse_bitfield
1489
1509
#define flash_api_erase_gp_fuse_byte flashcdw_erase_gp_fuse_byte
1510
1529
#define flash_api_erase_all_gp_fuses flashcdw_erase_all_gp_fuses
1530
1548
#define flash_api_write_gp_fuse_bit flashcdw_write_gp_fuse_bit
1549
1570
#define flash_api_write_gp_fuse_bitfield flashcdw_write_gp_fuse_bitfield
1571
1588
#define flash_api_write_gp_fuse_byte flashcdw_write_gp_fuse_byte
1589
1605
#define flash_api_write_all_gp_fuses flashcdw_write_all_gp_fuses
1606
1623
#define flash_api_set_gp_fuse_bit flashcdw_set_gp_fuse_bit
1624
1644
#define flash_api_set_gp_fuse_bitfield flashcdw_set_gp_fuse_bitfield
1645
1661
#define flash_api_set_gp_fuse_byte flashcdw_set_gp_fuse_byte
1662
1677
#define flash_api_set_all_gp_fuses flashcdw_set_all_gp_fuses
1678
1680
1681
1684
1696
#define flash_api_clear_page_buffer flashcdw_clear_page_buffer
1697
1704
#define flash_api_is_page_erased flashcdw_is_page_erased
1705
1718
#define flash_api_quick_page_read flashcdw_quick_page_read
1719
1739
#define flash_api_erase_page flashcdw_erase_page
1740
1756
#define flash_api_erase_all_pages flashcdw_erase_all_pages
1757
1775
#define flash_api_write_page flashcdw_write_page
1776
1784
#define flash_api_quick_user_page_read flashcdw_quick_user_page_read
1785
1798
#define flash_api_erase_user_page flashcdw_erase_user_page
1799
1809
#define flash_api_write_user_page flashcdw_write_user_page
1810
1838
#define flash_api_memset8 flashcdw_memset8
1839
1867
#define flash_api_memset16 flashcdw_memset16
1868
1896
#define flash_api_memset32 flashcdw_memset32
1897
1925
#define flash_api_memset64 flashcdw_memset64
1926
1955
#define flash_api_memset flashcdw_memset
1956
1987
#define flash_api_memcpy flashcdw_memcpy
1988
1990
#endif // __AVR32_ABI_COMPILER__
1991
1992
#else
1993
#error "Unsupported flash controller"
1994
#endif
1995
1996
#endif // _FLASH_API_H_
compiler.h
Commonly used includes, types and macros.
inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:17:57