FLASHC interfaces a flash block with the 32-bit internal HSB bus.
Macros | |
#define | AVR32_FLASHC_REGIONS |
Number of flash regions defined by the FLASHC. More... | |
FLASHC Status | |
static unsigned int | flashc_error_status = 0 |
Sticky error status of the FLASHC. More... | |
static unsigned int | flashc_get_error_status (void) |
Gets the error status of the FLASHC. More... | |
Flash Properties | |
unsigned int | flashc_get_flash_size (void) |
Gets the size of the whole flash array. More... | |
unsigned int | flashc_get_page_count (void) |
Gets the total number of pages in the flash array. More... | |
unsigned int | flashc_get_page_count_per_region (void) |
Gets the number of pages in each flash region. More... | |
unsigned int | flashc_get_page_region (int page_number) |
Gets the region number of a page. More... | |
unsigned int | flashc_get_region_first_page_number (unsigned int region) |
Gets the number of the first page of a region. More... | |
FLASHC Control | |
unsigned int | flashc_get_wait_state (void) |
Gets the number of wait states of flash read accesses. More... | |
void | flashc_set_wait_state (unsigned int wait_state) |
Sets the number of wait states of flash read accesses. More... | |
void | flashc_set_bus_freq (unsigned int cpu_f_hz) |
Depending on the CPU frequency, set the wait states of flash read accesses. More... | |
bool | flashc_is_ready_int_enabled (void) |
Tells whether the Flash Ready interrupt is enabled. More... | |
void | flashc_enable_ready_int (bool enable) |
Enables or disables the Flash Ready interrupt. More... | |
bool | flashc_is_lock_error_int_enabled (void) |
Tells whether the Lock Error interrupt is enabled. More... | |
void | flashc_enable_lock_error_int (bool enable) |
Enables or disables the Lock Error interrupt. More... | |
bool | flashc_is_prog_error_int_enabled (void) |
Tells whether the Programming Error interrupt is enabled. More... | |
void | flashc_enable_prog_error_int (bool enable) |
Enables or disables the Programming Error interrupt. More... | |
#define | flash_set_bus_freq(cpu_f_hz) flashc_set_bus_freq(cpu_f_hz) |
Alias on the flashc_set_bus_freq() function. More... | |
FLASHC Status | |
void(*volatile | flashc_wait_until_ready )(void) |
Pointer to the function used by the driver when it needs to wait until the FLASHC is ready to run a new command. More... | |
bool | flashc_is_ready (void) |
Tells whether the FLASHC is ready to run a new command. More... | |
void | flashc_default_wait_until_ready (void) |
Waits actively until the FLASHC is ready to run a new command. More... | |
bool | flashc_is_lock_error (void) |
Tells whether a Lock Error has occurred during the last function called that issued one or more FLASHC commands. More... | |
bool | flashc_is_programming_error (void) |
Tells whether a Programming Error has occurred during the last function called that issued one or more FLASHC commands. More... | |
FLASHC Command Control | |
unsigned int | flashc_get_command (void) |
Gets the last issued FLASHC command. More... | |
unsigned int | flashc_get_page_number (void) |
Gets the current FLASHC page number. More... | |
void | flashc_issue_command (unsigned int command, int page_number) |
Issues a FLASHC command. More... | |
FLASHC Global Commands | |
void | flashc_no_operation (void) |
Issues a No Operation command to the FLASHC. More... | |
void | flashc_erase_all (void) |
Issues an Erase All command to the FLASHC. More... | |
FLASHC Protection Mechanisms | |
bool | flashc_is_security_bit_active (void) |
Tells whether the Security bit is active. More... | |
void | flashc_activate_security_bit (void) |
Activates the Security bit. More... | |
unsigned int | flashc_get_bootloader_protected_size (void) |
Gets the bootloader protected size. More... | |
unsigned int | flashc_set_bootloader_protected_size (unsigned int bootprot_size) |
Sets the bootloader protected size. More... | |
bool | flashc_is_external_privileged_fetch_locked (void) |
Tells whether external privileged fetch is locked. More... | |
void | flashc_lock_external_privileged_fetch (bool lock) |
Locks or unlocks external privileged fetch. More... | |
bool | flashc_is_page_region_locked (int page_number) |
Tells whether the region of a page is locked. More... | |
bool | flashc_is_region_locked (unsigned int region) |
Tells whether a region is locked. More... | |
void | flashc_lock_page_region (int page_number, bool lock) |
Locks or unlocks the region of a page. More... | |
void | flashc_lock_region (unsigned int region, bool lock) |
Locks or unlocks a region. More... | |
void | flashc_lock_all_regions (bool lock) |
Locks or unlocks all regions. More... | |
Access to General-Purpose Fuses | |
bool | flashc_read_gp_fuse_bit (unsigned int gp_fuse_bit) |
Reads a general-purpose fuse bit. More... | |
uint64_t | flashc_read_gp_fuse_bitfield (unsigned int pos, unsigned int width) |
Reads a general-purpose fuse bit-field. More... | |
uint8_t | flashc_read_gp_fuse_byte (unsigned int gp_fuse_byte) |
Reads a general-purpose fuse byte. More... | |
uint64_t | flashc_read_all_gp_fuses (void) |
Reads all general-purpose fuses. More... | |
bool | flashc_erase_gp_fuse_bit (unsigned int gp_fuse_bit, bool check) |
Erases a general-purpose fuse bit. More... | |
bool | flashc_erase_gp_fuse_bitfield (unsigned int pos, unsigned int width, bool check) |
Erases a general-purpose fuse bit-field. More... | |
bool | flashc_erase_gp_fuse_byte (unsigned int gp_fuse_byte, bool check) |
Erases a general-purpose fuse byte. More... | |
bool | flashc_erase_all_gp_fuses (bool check) |
Erases all general-purpose fuses. More... | |
void | flashc_write_gp_fuse_bit (unsigned int gp_fuse_bit, bool value) |
Writes a general-purpose fuse bit. More... | |
void | flashc_write_gp_fuse_bitfield (unsigned int pos, unsigned int width, uint64_t value) |
Writes a general-purpose fuse bit-field. More... | |
void | flashc_write_gp_fuse_byte (unsigned int gp_fuse_byte, uint8_t value) |
Writes a general-purpose fuse byte. More... | |
void | flashc_write_all_gp_fuses (uint64_t value) |
Writes all general-purpose fuses. More... | |
void | flashc_set_gp_fuse_bit (unsigned int gp_fuse_bit, bool value) |
Sets a general-purpose fuse bit with the appropriate erase and write operations. More... | |
void | flashc_set_gp_fuse_bitfield (unsigned int pos, unsigned int width, uint64_t value) |
Sets a general-purpose fuse bit-field with the appropriate erase and write operations. More... | |
void | flashc_set_gp_fuse_byte (unsigned int gp_fuse_byte, uint8_t value) |
Sets a general-purpose fuse byte with the appropriate erase and write operations. More... | |
void | flashc_set_all_gp_fuses (uint64_t value) |
Sets all general-purpose fuses with the appropriate erase and write operations. More... | |
Access to Flash Pages | |
void | flashc_clear_page_buffer (void) |
Clears the page buffer. More... | |
bool | flashc_is_page_erased (void) |
Tells whether the page to which the last Quick Page Read or Quick Page Read User Page command was applied was erased. More... | |
bool | flashc_quick_page_read (int page_number) |
Applies the Quick Page Read command to a page. More... | |
bool | flashc_erase_page (int page_number, bool check) |
Erases a page. More... | |
bool | flashc_erase_all_pages (bool check) |
Erases all pages within the flash array. More... | |
void | flashc_write_page (int page_number) |
Writes a page from the page buffer. More... | |
bool | flashc_quick_user_page_read (void) |
Issues a Quick Page Read User Page command to the FLASHC. More... | |
bool | flashc_erase_user_page (bool check) |
Erases the User page. More... | |
void | flashc_write_user_page (void) |
Writes the User page from the page buffer. More... | |
volatile void * | flashc_memset8 (volatile void *dst, uint8_t src, size_t nbytes, bool erase) |
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src source byte. More... | |
volatile void * | flashc_memset16 (volatile void *dst, uint16_t src, size_t nbytes, bool erase) |
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source half-word. More... | |
volatile void * | flashc_memset32 (volatile void *dst, uint32_t src, size_t nbytes, bool erase) |
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source word. More... | |
volatile void * | flashc_memset64 (volatile void *dst, uint64_t src, size_t nbytes, bool erase) |
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source double-word. More... | |
volatile void * | flashc_memcpy (volatile void *dst, const void *src, size_t nbytes, bool erase) |
Copies nbytes bytes to the flash destination pointed to by dst from the source pointed to by src. More... | |
void | flashc_set_flash_waitstate_and_readmode (unsigned long cpu_f_hz) |
Depending to the CPU frequency, set the wait states of flash read accesses and enable or disable the High speed read mode. More... | |
#define | flashc_memset(dst, src, src_width, nbytes, erase) TPASTE2(flashc_memset, src_width)((dst), (src), (nbytes), (erase)) |
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source pattern. More... | |
#define AVR32_FLASHC_REGIONS |
Number of flash regions defined by the FLASHC.
Referenced by flashc_get_page_count_per_region(), flashc_is_region_locked(), and flashc_lock_all_regions().
#define flash_set_bus_freq | ( | cpu_f_hz | ) | flashc_set_bus_freq(cpu_f_hz) |
Alias on the flashc_set_bus_freq() function.
cpu_f_hz | The CPU frequency |
Referenced by sysclk_init().
#define flashc_memset | ( | dst, | |
src, | |||
src_width, | |||
nbytes, | |||
erase | |||
) | TPASTE2(flashc_memset, src_width)((dst), (src), (nbytes), (erase)) |
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source pattern.
All pointer and size alignments are supported.
dst | Pointer to flash destination. |
src | Source double-word. |
src_width | src width in bits: 8, 16, 32 or 64. |
nbytes | Number of bytes to set. |
erase | Whether to erase before writing: true or false . |
false
only if the destination consists only of erased words, i.e. this function can not be used to write only one bit of a previously written word. E.g., if 0x00000001
then 0xFFFFFFFE
are written to a word, the resulting value in flash may be different from 0x00000000
.Activates the Security bit.
References flashc_issue_command().
Clears the page buffer.
This command resets all bits in the page buffer to one. Write accesses to the page buffer can only change page buffer bits from one to zero.
References flashc_issue_command().
Referenced by flashc_memcpy(), and flashc_memset64().
Waits actively until the FLASHC is ready to run a new command.
This is the default function assigned to flashc_wait_until_ready.
References flashc_is_ready().
Enables or disables the Lock Error interrupt.
enable | Whether to enable the Lock Error interrupt: true or false . |
References u_avr32_flashc_fcr_t::fcr, and u_avr32_flashc_fcr_t::FCR.
Enables or disables the Programming Error interrupt.
enable | Whether to enable the Programming Error interrupt: true or false . |
References u_avr32_flashc_fcr_t::fcr, and u_avr32_flashc_fcr_t::FCR.
Enables or disables the Flash Ready interrupt.
enable | Whether to enable the Flash Ready interrupt: true or false . |
References u_avr32_flashc_fcr_t::fcr, and u_avr32_flashc_fcr_t::FCR.
Issues an Erase All command to the FLASHC.
This command erases all bits in the flash array, the general-purpose fuse bits and the Security bit. The User page is not erased.
This command also ensures that all volatile memories, such as register file and RAMs, are erased before the Security bit is erased, i.e. deactivated.
References flashc_issue_command().
Erases all general-purpose fuses.
check | Whether to check erase: true or false . |
true
if erase check was not requested.AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_issue_command(), and flashc_read_all_gp_fuses().
Referenced by flashc_erase_gp_fuse_byte(), and flashc_set_all_gp_fuses().
Erases all pages within the flash array.
check | Whether to check erase: true or false . |
true
if erase check was not requested.References flashc_erase_page(), flashc_error_status, and flashc_get_page_count().
Erases a general-purpose fuse bit.
gp_fuse_bit | The general-purpose fuse bit: 0 to 63 . |
check | Whether to check erase: true or false . |
true
if erase check was not requested.AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_issue_command(), and flashc_read_gp_fuse_bit().
Referenced by flashc_erase_gp_fuse_bitfield(), and flashc_set_gp_fuse_bit().
Erases a general-purpose fuse bit-field.
pos | The bit-position of the general-purpose fuse bit-field: 0 to 63 . |
width | The bit-width of the general-purpose fuse bit-field: 0 to 64 . |
check | Whether to check erase: true or false . |
true
if erase check was not requested.AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_erase_gp_fuse_bit(), flashc_error_status, flashc_read_gp_fuse_bitfield(), and min.
Erases a general-purpose fuse byte.
gp_fuse_byte | The general-purpose fuse byte: 0 to 7 . |
check | Whether to check erase: true or false . |
true
if erase check was not requested.AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_erase_all_gp_fuses(), flashc_error_status, flashc_read_all_gp_fuses(), flashc_read_gp_fuse_byte(), and flashc_write_gp_fuse_byte().
Referenced by flashc_set_gp_fuse_byte().
Erases a page.
page_number | The page number:
|
check | Whether to check erase: true or false . |
true
if erase check was not requested.References flashc_error_status, flashc_issue_command(), and flashc_quick_page_read().
Referenced by flashc_erase_all_pages(), flashc_memcpy(), and flashc_memset64().
Erases the User page.
check | Whether to check erase: true or false . |
true
if erase check was not requested.References flashc_issue_command(), and flashc_quick_user_page_read().
Referenced by flashc_memcpy(), and flashc_memset64().
unsigned int flashc_get_bootloader_protected_size | ( | void | ) |
Gets the bootloader protected size.
References flashc_read_gp_fuse_bitfield().
Referenced by flashc_set_bootloader_protected_size().
unsigned int flashc_get_command | ( | void | ) |
Gets the last issued FLASHC command.
|
static |
Gets the error status of the FLASHC.
AVR32_FLASHC_FSR_LOCKE_MASK
and AVR32_FLASHC_FSR_PROGE_MASK
.Referenced by flashc_issue_command().
unsigned int flashc_get_flash_size | ( | void | ) |
Gets the size of the whole flash array.
Referenced by flashc_get_page_count(), flashc_memcpy(), and flashc_memset64().
unsigned int flashc_get_page_count | ( | void | ) |
Gets the total number of pages in the flash array.
References flashc_get_flash_size().
Referenced by flashc_erase_all_pages(), and flashc_get_page_count_per_region().
unsigned int flashc_get_page_count_per_region | ( | void | ) |
Gets the number of pages in each flash region.
References AVR32_FLASHC_REGIONS, and flashc_get_page_count().
Referenced by flashc_get_page_region(), and flashc_get_region_first_page_number().
unsigned int flashc_get_page_number | ( | void | ) |
Gets the current FLASHC page number.
Referenced by flashc_get_page_region().
unsigned int flashc_get_page_region | ( | int | page_number | ) |
Gets the region number of a page.
page_number | The page number:
|
References flashc_get_page_count_per_region(), and flashc_get_page_number().
Referenced by flashc_is_page_region_locked().
unsigned int flashc_get_region_first_page_number | ( | unsigned int | region | ) |
Gets the number of the first page of a region.
region | The region number: 0 to (AVR32_FLASHC_REGIONS - 1) . |
References flashc_get_page_count_per_region().
Referenced by flashc_lock_region().
unsigned int flashc_get_wait_state | ( | void | ) |
Gets the number of wait states of flash read accesses.
Tells whether external privileged fetch is locked.
References flashc_read_gp_fuse_bit().
Tells whether a Lock Error has occurred during the last function called that issued one or more FLASHC commands.
References flashc_error_status.
Tells whether the Lock Error interrupt is enabled.
Tells whether the page to which the last Quick Page Read or Quick Page Read User Page command was applied was erased.
Referenced by flashc_quick_page_read(), and flashc_quick_user_page_read().
bool flashc_is_page_region_locked | ( | int | page_number | ) |
Tells whether the region of a page is locked.
page_number | The page number:
|
References flashc_get_page_region(), and flashc_is_region_locked().
Tells whether the Programming Error interrupt is enabled.
Tells whether a Programming Error has occurred during the last function called that issued one or more FLASHC commands.
References flashc_error_status.
Tells whether the FLASHC is ready to run a new command.
Referenced by flashc_default_wait_until_ready().
Tells whether the Flash Ready interrupt is enabled.
bool flashc_is_region_locked | ( | unsigned int | region | ) |
Tells whether a region is locked.
region | The region number: 0 to (AVR32_FLASHC_REGIONS - 1) . |
References AVR32_FLASHC_REGIONS.
Referenced by flashc_is_page_region_locked().
Tells whether the Security bit is active.
void flashc_issue_command | ( | unsigned int | command, |
int | page_number | ||
) |
Issues a FLASHC command.
command | The command: AVR32_FLASHC_FCMD_CMD_x . |
page_number | The page number to apply the command to:
|
References u_avr32_flashc_fcmd_t::fcmd, u_avr32_flashc_fcmd_t::FCMD, flashc_error_status, flashc_get_error_status(), and flashc_wait_until_ready.
Referenced by flashc_activate_security_bit(), flashc_clear_page_buffer(), flashc_erase_all(), flashc_erase_all_gp_fuses(), flashc_erase_gp_fuse_bit(), flashc_erase_page(), flashc_erase_user_page(), flashc_lock_page_region(), flashc_no_operation(), flashc_quick_page_read(), flashc_quick_user_page_read(), flashc_write_gp_fuse_bit(), flashc_write_gp_fuse_byte(), flashc_write_page(), flashc_write_user_page(), and pm_configure_clocks().
Locks or unlocks all regions.
lock | Whether to lock the regions: true or false . |
References AVR32_FLASHC_REGIONS, flashc_error_status, and flashc_lock_region().
Locks or unlocks external privileged fetch.
lock | Whether to lock external privileged fetch: true or false . |
References flashc_set_gp_fuse_bit().
Locks or unlocks the region of a page.
page_number | The page number:
|
lock | Whether to lock the region of the specified page: true or false . |
References flashc_issue_command().
Referenced by flashc_lock_region().
Locks or unlocks a region.
region | The region number: 0 to (AVR32_FLASHC_REGIONS - 1) . |
lock | Whether to lock the specified region: true or false . |
References flashc_get_region_first_page_number(), and flashc_lock_page_region().
Referenced by flashc_lock_all_regions().
Copies nbytes bytes to the flash destination pointed to by dst from the source pointed to by src.
The destination areas that are not within the flash array or the User page are caught by an Assert() operation.
All pointer and size alignments are supported.
dst | Pointer to flash destination. |
src | Pointer to source data. |
nbytes | Number of bytes to copy. |
erase | Whether to erase before writing: true or false . |
false
only if the destination consists only of erased words, i.e. this function can not be used to write only one bit of a previously written word. E.g., if 0x00000001
then 0xFFFFFFFE
are written to a word, the resulting value in flash may be different from 0x00000000
.References Assert, flashc_clear_page_buffer(), flashc_erase_page(), flashc_erase_user_page(), flashc_error_status, flashc_get_flash_size(), flashc_write_page(), flashc_write_user_page(), Union64::u64, and Union64::u8.
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source half-word.
All pointer and size alignments are supported.
dst | Pointer to flash destination. |
src | Source half-word. |
nbytes | Number of bytes to set. |
erase | Whether to erase before writing: true or false . |
false
only if the destination consists only of erased words, i.e. this function can not be used to write only one bit of a previously written word. E.g., if 0x00000001
then 0xFFFFFFFE
are written to a word, the resulting value in flash may be different from 0x00000000
.References flashc_memset32().
Referenced by flashc_memset8().
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source word.
All pointer and size alignments are supported.
dst | Pointer to flash destination. |
src | Source word. |
nbytes | Number of bytes to set. |
erase | Whether to erase before writing: true or false . |
false
only if the destination consists only of erased words, i.e. this function can not be used to write only one bit of a previously written word. E.g., if 0x00000001
then 0xFFFFFFFE
are written to a word, the resulting value in flash may be different from 0x00000000
.References flashc_memset64().
Referenced by flashc_memset16().
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src big-endian source double-word.
All pointer and size alignments are supported.
dst | Pointer to flash destination. |
src | Source double-word. |
nbytes | Number of bytes to set. |
erase | Whether to erase before writing: true or false . |
false
only if the destination consists only of erased words, i.e. this function can not be used to write only one bit of a previously written word. E.g., if 0x00000001
then 0xFFFFFFFE
are written to a word, the resulting value in flash may be different from 0x00000000
.References Align_down, flashc_clear_page_buffer(), flashc_erase_page(), flashc_erase_user_page(), flashc_error_status, flashc_get_flash_size(), flashc_write_page(), flashc_write_user_page(), Get_align, if(), min, Test_align, StructCVPtr::u16ptr, StructCVPtr::u32ptr, Union64::u64, UnionVPtr::u64ptr, UnionCVPtr::u64ptr, StructCVPtr::u64ptr, Union64::u8, UnionVPtr::u8ptr, UnionCVPtr::u8ptr, and StructCVPtr::u8ptr.
Referenced by flashc_memset32().
Copies nbytes bytes to the flash destination pointed to by dst from the repeated src source byte.
All pointer and size alignments are supported.
dst | Pointer to flash destination. |
src | Source byte. |
nbytes | Number of bytes to set. |
erase | Whether to erase before writing: true or false . |
false
only if the destination consists only of erased words, i.e. this function can not be used to write only one bit of a previously written word. E.g., if 0x00000001
then 0xFFFFFFFE
are written to a word, the resulting value in flash may be different from 0x00000000
.References flashc_memset16().
Issues a No Operation command to the FLASHC.
References flashc_issue_command().
bool flashc_quick_page_read | ( | int | page_number | ) |
Applies the Quick Page Read command to a page.
page_number | The page number:
|
References flashc_is_page_erased(), and flashc_issue_command().
Referenced by flashc_erase_page().
Issues a Quick Page Read User Page command to the FLASHC.
References flashc_is_page_erased(), and flashc_issue_command().
Referenced by flashc_erase_user_page().
uint64_t flashc_read_all_gp_fuses | ( | void | ) |
Reads all general-purpose fuses.
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. Referenced by flashc_erase_all_gp_fuses(), flashc_erase_gp_fuse_byte(), flashc_read_gp_fuse_bit(), flashc_read_gp_fuse_bitfield(), and flashc_read_gp_fuse_byte().
bool flashc_read_gp_fuse_bit | ( | unsigned int | gp_fuse_bit | ) |
Reads a general-purpose fuse bit.
gp_fuse_bit | The general-purpose fuse bit: 0 to 63 . |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_read_all_gp_fuses().
Referenced by flashc_erase_gp_fuse_bit(), and flashc_is_external_privileged_fetch_locked().
uint64_t flashc_read_gp_fuse_bitfield | ( | unsigned int | pos, |
unsigned int | width | ||
) |
Reads a general-purpose fuse bit-field.
pos | The bit-position of the general-purpose fuse bit-field: 0 to 63 . |
width | The bit-width of the general-purpose fuse bit-field: 0 to 64 . |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_read_all_gp_fuses(), and min.
Referenced by flashc_erase_gp_fuse_bitfield(), and flashc_get_bootloader_protected_size().
uint8_t flashc_read_gp_fuse_byte | ( | unsigned int | gp_fuse_byte | ) |
Reads a general-purpose fuse byte.
gp_fuse_byte | The general-purpose fuse byte: 0 to 7 . |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_read_all_gp_fuses().
Referenced by flashc_erase_gp_fuse_byte().
void flashc_set_all_gp_fuses | ( | uint64_t | value | ) |
Sets all general-purpose fuses with the appropriate erase and write operations.
value | The value of all general-purpose fuses as a word. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_erase_all_gp_fuses(), flashc_error_status, and flashc_write_all_gp_fuses().
unsigned int flashc_set_bootloader_protected_size | ( | unsigned int | bootprot_size | ) |
Sets the bootloader protected size.
bootprot_size | The wanted bootloader protected size in bytes. If this size is not supported, the actual size will be the nearest greater available size or the maximal possible size if the requested size is too large. |
References clz, flashc_get_bootloader_protected_size(), flashc_set_gp_fuse_bitfield(), max, and min.
void flashc_set_bus_freq | ( | unsigned int | cpu_f_hz | ) |
Depending on the CPU frequency, set the wait states of flash read accesses.
cpu_f_hz | The CPU frequency |
References flashc_set_wait_state().
void flashc_set_flash_waitstate_and_readmode | ( | unsigned long | cpu_f_hz | ) |
Depending to the CPU frequency, set the wait states of flash read accesses and enable or disable the High speed read mode.
cpu_f_hz | The CPU frequency |
Referenced by pcl_configure_synchronous_clocks(), and pcl_switch_to_osc().
Sets a general-purpose fuse bit with the appropriate erase and write operations.
gp_fuse_bit | The general-purpose fuse bit: 0 to 63 . |
value | The value of the specified general-purpose fuse bit. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_erase_gp_fuse_bit(), and flashc_write_gp_fuse_bit().
Referenced by flashc_lock_external_privileged_fetch(), and flashc_set_gp_fuse_bitfield().
void flashc_set_gp_fuse_bitfield | ( | unsigned int | pos, |
unsigned int | width, | ||
uint64_t | value | ||
) |
Sets a general-purpose fuse bit-field with the appropriate erase and write operations.
pos | The bit-position of the general-purpose fuse bit-field: 0 to 63 . |
width | The bit-width of the general-purpose fuse bit-field: 0 to 64 . |
value | The value of the specified general-purpose fuse bit-field. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_error_status, flashc_set_gp_fuse_bit(), and min.
Referenced by flashc_set_bootloader_protected_size().
void flashc_set_gp_fuse_byte | ( | unsigned int | gp_fuse_byte, |
uint8_t | value | ||
) |
Sets a general-purpose fuse byte with the appropriate erase and write operations.
gp_fuse_byte | The general-purpose fuse byte: 0 to 7 . |
value | The value of the specified general-purpose fuse byte. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_erase_gp_fuse_byte(), flashc_error_status, and flashc_write_gp_fuse_byte().
void flashc_set_wait_state | ( | unsigned int | wait_state | ) |
Sets the number of wait states of flash read accesses.
wait_state | The number of wait states of flash read accesses: 0 to 1 . |
References u_avr32_flashc_fcr_t::fcr, and u_avr32_flashc_fcr_t::FCR.
Referenced by flashc_set_bus_freq(), pm_configure_clocks(), and prv_clk_gen_start().
void flashc_write_all_gp_fuses | ( | uint64_t | value | ) |
Writes all general-purpose fuses.
value | The value of all general-purpose fuses as a word. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_error_status, and flashc_write_gp_fuse_byte().
Referenced by flashc_set_all_gp_fuses().
Writes a general-purpose fuse bit.
gp_fuse_bit | The general-purpose fuse bit: 0 to 63 . |
value | The value of the specified general-purpose fuse bit. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_issue_command().
Referenced by flashc_set_gp_fuse_bit(), and flashc_write_gp_fuse_bitfield().
void flashc_write_gp_fuse_bitfield | ( | unsigned int | pos, |
unsigned int | width, | ||
uint64_t | value | ||
) |
Writes a general-purpose fuse bit-field.
pos | The bit-position of the general-purpose fuse bit-field: 0 to 63 . |
width | The bit-width of the general-purpose fuse bit-field: 0 to 64 . |
value | The value of the specified general-purpose fuse bit-field. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_error_status, flashc_write_gp_fuse_bit(), and min.
void flashc_write_gp_fuse_byte | ( | unsigned int | gp_fuse_byte, |
uint8_t | value | ||
) |
Writes a general-purpose fuse byte.
gp_fuse_byte | The general-purpose fuse byte: 0 to 7 . |
value | The value of the specified general-purpose fuse byte. |
AVR32_FLASHC_GPF_NUM
. The other bits among the 64 are fixed at 1 by hardware. References flashc_issue_command().
Referenced by flashc_erase_gp_fuse_byte(), flashc_set_gp_fuse_byte(), and flashc_write_all_gp_fuses().
void flashc_write_page | ( | int | page_number | ) |
Writes a page from the page buffer.
page_number | The page number:
|
References flashc_issue_command().
Referenced by flashc_memcpy(), and flashc_memset64().
Writes the User page from the page buffer.
References flashc_issue_command().
Referenced by flashc_memcpy(), and flashc_memset64().
|
static |
Sticky error status of the FLASHC.
This variable is updated by functions that issue FLASHC commands. It contains the cumulated FLASHC error status of all the FLASHC commands issued by a function.
Referenced by flashc_erase_all_pages(), flashc_erase_gp_fuse_bitfield(), flashc_erase_gp_fuse_byte(), flashc_erase_page(), flashc_is_lock_error(), flashc_is_programming_error(), flashc_issue_command(), flashc_lock_all_regions(), flashc_memcpy(), flashc_memset64(), flashc_set_all_gp_fuses(), flashc_set_gp_fuse_bitfield(), flashc_set_gp_fuse_byte(), flashc_write_all_gp_fuses(), and flashc_write_gp_fuse_bitfield().
Pointer to the function used by the driver when it needs to wait until the FLASHC is ready to run a new command.
The default function is flashc_default_wait_until_ready. The user may change this pointer to use another implementation.
Referenced by flashc_issue_command().