Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FLASHCDW - FLASH Controller Double-Word

FLASHCDW interfaces a flash block with the 32-bit internal HSB bus.

Macros

#define AVR32_FLASHCDW_REGIONS
 Number of flash regions defined by the FLASHCDW. More...
 

FLASHC Status

static unsigned int flashcdw_error_status = 0
 Sticky error status of the FLASHCDW. More...
 
static unsigned int flashcdw_get_error_status (void)
 Gets the error status of the FLASHCDW. More...
 

Flash Properties

unsigned int flashcdw_get_flash_size (void)
 Gets the size of the whole flash array. More...
 
unsigned int flashcdw_get_page_count (void)
 Gets the total number of pages in the flash array. More...
 
unsigned int flashcdw_get_page_count_per_region (void)
 Gets the number of pages in each flash region. More...
 
unsigned int flashcdw_get_page_region (int page_number)
 Gets the region number of a page. More...
 
unsigned int flashcdw_get_region_first_page_number (unsigned int region)
 Gets the number of the first page of a region. More...
 

FLASHCDW Control

unsigned int flashcdw_get_wait_state (void)
 Gets the number of wait states of flash read accesses. More...
 
void flashcdw_set_wait_state (unsigned int wait_state)
 Sets the number of wait states of flash read accesses. More...
 
void flashcdw_set_flash_waitstate_and_readmode (unsigned long cpu_f_hz)
 Depending on the CPU frequency, set the wait states of flash read accesses and enable or disable the High speed read mode. More...
 
bool flashcdw_is_ready_int_enabled (void)
 Tells whether the Flash Ready interrupt is enabled. More...
 
void flashcdw_enable_ready_int (bool enable)
 Enables or disables the Flash Ready interrupt. More...
 
bool flashcdw_is_lock_error_int_enabled (void)
 Tells whether the Lock Error interrupt is enabled. More...
 
void flashcdw_enable_lock_error_int (bool enable)
 Enables or disables the Lock Error interrupt. More...
 
bool flashcdw_is_prog_error_int_enabled (void)
 Tells whether the Programming Error interrupt is enabled. More...
 
void flashcdw_enable_prog_error_int (bool enable)
 Enables or disables the Programming Error interrupt. More...
 
#define flash_set_bus_freq(cpu_f_hz)   flashcdw_set_flash_waitstate_and_readmode(cpu_f_hz)
 Alias on the flashcdw_set_flash_waitstate_and_readmode() function. More...
 

FLASHCDW Status

void(*volatile flashcdw_wait_until_ready )(void)
 Pointer to the function used by the driver when it needs to wait until the FLASHCDW is ready to run a new command. More...
 
bool flashcdw_is_ready (void)
 Tells whether the FLASHCDW is ready to run a new command. More...
 
void flashcdw_default_wait_until_ready (void)
 Waits actively until the FLASHCDW is ready to run a new command. More...
 
bool flashcdw_is_lock_error (void)
 Tells whether a Lock Error has occurred during the last function called that issued one or more FLASHCDW commands. More...
 
bool flashcdw_is_programming_error (void)
 Tells whether a Programming Error has occurred during the last function called that issued one or more FLASHCDW commands. More...
 
bool flashcdw_is_high_speed_enabled (void)
 Tells whether the High-speed read mode is enabled. More...
 

FLASHCDW Command Control

unsigned int flashcdw_get_command (void)
 Gets the last issued FLASHCDW command. More...
 
unsigned int flashcdw_get_page_number (void)
 Gets the current FLASHCDW page number. More...
 
void flashcdw_issue_command (unsigned int command, int page_number)
 Issues a FLASHCDW command. More...
 

FLASHCDW Global Commands

void flashcdw_no_operation (void)
 Issues a No Operation command to the FLASHCDW. More...
 
void flashcdw_erase_all (void)
 Issues an Erase All command to the FLASHCDW. More...
 

FLASHCDW Protection Mechanisms

bool flashcdw_is_security_bit_active (void)
 Tells whether the Security bit is active. More...
 
void flashcdw_activate_security_bit (void)
 Activates the Security bit. More...
 
unsigned int flashcdw_get_bootloader_protected_size (void)
 Gets the bootloader protected size. More...
 
unsigned int flashcdw_set_bootloader_protected_size (unsigned int bootprot_size)
 Sets the bootloader protected size. More...
 
bool flashcdw_is_external_privileged_fetch_locked (void)
 Tells whether external privileged fetch is locked. More...
 
void flashcdw_lock_external_privileged_fetch (bool lock)
 Locks or unlocks external privileged fetch. More...
 
bool flashcdw_is_jtag_user_protection_enabled (void)
 Tells whether the jtag user protection is enabled. More...
 
void flashcdw_enable_jtag_user_protection (void)
 Enable the jtag user protection feature (i.e. program (set to "0") the UPROT bit) More...
 
void flashcdw_disable_jtag_user_protection (void)
 Disable the jtag user protection feature (i.e. erase (set to "1") the UPROT bit) More...
 
bool flashcdw_is_secure_state_enabled (void)
 Tells whether the Secure State is enabled. More...
 
bool flashcdw_is_secure_state_debug_enabled (void)
 Tells whether the Secure State debug is enabled. More...
 
void flashcdw_enable_secure_state_no_debug (void)
 Enable the Secure State with the Secure State debug disabled. More...
 
void flashcdw_enable_secure_state_with_debug (void)
 Enable the Secure State with the Secure State debug enabled. More...
 
bool flashcdw_is_page_region_locked (int page_number)
 Tells whether the region of a page is locked. More...
 
bool flashcdw_is_region_locked (unsigned int region)
 Tells whether a region is locked. More...
 
void flashcdw_lock_page_region (int page_number, bool lock)
 Locks or unlocks the region of a page. More...
 
void flashcdw_lock_region (unsigned int region, bool lock)
 Locks or unlocks a region. More...
 
void flashcdw_lock_all_regions (bool lock)
 Locks or unlocks all regions. More...
 

Access to General-Purpose Fuses

bool flashcdw_read_gp_fuse_bit (unsigned int gp_fuse_bit)
 Reads a general-purpose fuse bit. More...
 
uint64_t flashcdw_read_gp_fuse_bitfield (unsigned int pos, unsigned int width)
 Reads a general-purpose fuse bit-field. More...
 
uint8_t flashcdw_read_gp_fuse_byte (unsigned int gp_fuse_byte)
 Reads a general-purpose fuse byte. More...
 
uint64_t flashcdw_read_all_gp_fuses (void)
 Reads all general-purpose fuses. More...
 
bool flashcdw_erase_gp_fuse_bit (unsigned int gp_fuse_bit, bool check)
 Erases a general-purpose fuse bit. More...
 
bool flashcdw_erase_gp_fuse_bitfield (unsigned int pos, unsigned int width, bool check)
 Erases a general-purpose fuse bit-field. More...
 
bool flashcdw_erase_gp_fuse_byte (unsigned int gp_fuse_byte, bool check)
 Erases a general-purpose fuse byte. More...
 
bool flashcdw_erase_all_gp_fuses (bool check)
 Erases all general-purpose fuses. More...
 
void flashcdw_write_gp_fuse_bit (unsigned int gp_fuse_bit, bool value)
 Writes a general-purpose fuse bit. More...
 
void flashcdw_write_gp_fuse_bitfield (unsigned int pos, unsigned int width, uint64_t value)
 Writes a general-purpose fuse bit-field. More...
 
void flashcdw_write_gp_fuse_byte (unsigned int gp_fuse_byte, uint8_t value)
 Writes a general-purpose fuse byte. More...
 
void flashcdw_write_all_gp_fuses (uint64_t value)
 Writes all general-purpose fuses. More...
 
void flashcdw_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 flashcdw_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 flashcdw_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 flashcdw_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 flashcdw_clear_page_buffer (void)
 Clears the page buffer. More...
 
bool flashcdw_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 flashcdw_quick_page_read (int page_number)
 Applies the Quick Page Read command to a page. More...
 
bool flashcdw_erase_page (int page_number, bool check)
 Erases a page. More...
 
bool flashcdw_erase_all_pages (bool check)
 Erases all pages within the flash array. More...
 
void flashcdw_write_page (int page_number)
 Writes a page from the page buffer. More...
 
bool flashcdw_quick_user_page_read (void)
 Issues a Quick Page Read User Page command to the FLASHCDW. More...
 
bool flashcdw_erase_user_page (bool check)
 Erases the User page. More...
 
void flashcdw_write_user_page (void)
 Writes the User page from the page buffer. More...
 
volatile void * flashcdw_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 * flashcdw_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 * flashcdw_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 * flashcdw_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 * flashcdw_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...
 
#define flashcdw_memset(dst, src, src_width, nbytes, erase)   TPASTE2(flashcdw_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_FLASHCDW_REGIONS
Value:
(AVR32_FLASHCDW_FLASH_SIZE /\
(AVR32_FLASHCDW_PAGES_PR_REGION * AVR32_FLASHCDW_PAGE_SIZE))

Number of flash regions defined by the FLASHCDW.

Referenced by flashcdw_get_page_count_per_region(), flashcdw_is_region_locked(), and flashcdw_lock_all_regions().

#define flash_set_bus_freq (   cpu_f_hz)    flashcdw_set_flash_waitstate_and_readmode(cpu_f_hz)

Alias on the flashcdw_set_flash_waitstate_and_readmode() function.

Parameters
cpu_f_hzThe CPU frequency
#define flashcdw_memset (   dst,
  src,
  src_width,
  nbytes,
  erase 
)    TPASTE2(flashcdw_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.

Parameters
dstPointer to flash destination.
srcSource double-word.
src_widthsrc width in bits: 8, 16, 32 or 64.
nbytesNumber of bytes to set.
eraseWhether to erase before writing: true or false.
Returns
The value of dst.
Warning
This function may be called with erase set to 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.
A Lock Error is issued if the command is applied to pages belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

Referenced by flash_rw_example().

void flashcdw_activate_security_bit ( void  )

Activates the Security bit.

Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_issue_command().

void flashcdw_clear_page_buffer ( void  )

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.

Warning
The page buffer is not automatically reset after a page write.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_issue_command().

Referenced by flashcdw_memcpy(), and flashcdw_memset64().

void flashcdw_default_wait_until_ready ( void  )

Waits actively until the FLASHCDW is ready to run a new command.

This is the default function assigned to flashcdw_wait_until_ready.

References flashcdw_is_ready().

void flashcdw_disable_jtag_user_protection ( void  )

Disable the jtag user protection feature (i.e. erase (set to "1") the UPROT bit)

Warning
A Lock Error is issued if the Security bit is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_set_gp_fuse_bit().

void flashcdw_enable_jtag_user_protection ( void  )

Enable the jtag user protection feature (i.e. program (set to "0") the UPROT bit)

Warning
A Lock Error is issued if the Security bit is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_set_gp_fuse_bit().

void flashcdw_enable_lock_error_int ( bool  enable)

Enables or disables the Lock Error interrupt.

Parameters
enableWhether to enable the Lock Error interrupt: true or false.

References u_avr32_flashcdw_fcr_t::fcr, and u_avr32_flashcdw_fcr_t::FCR.

void flashcdw_enable_prog_error_int ( bool  enable)

Enables or disables the Programming Error interrupt.

Parameters
enableWhether to enable the Programming Error interrupt: true or false.

References u_avr32_flashcdw_fcr_t::fcr, and u_avr32_flashcdw_fcr_t::FCR.

void flashcdw_enable_ready_int ( bool  enable)

Enables or disables the Flash Ready interrupt.

Parameters
enableWhether to enable the Flash Ready interrupt: true or false.

References u_avr32_flashcdw_fcr_t::fcr, and u_avr32_flashcdw_fcr_t::FCR.

void flashcdw_enable_secure_state_no_debug ( void  )

Enable the Secure State with the Secure State debug disabled.

Warning
A Lock Error is issued if the SECURE mode is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_write_gp_fuse_bitfield().

void flashcdw_enable_secure_state_with_debug ( void  )

Enable the Secure State with the Secure State debug enabled.

Warning
A Lock Error is issued if the SECURE mode is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_write_gp_fuse_bitfield().

void flashcdw_erase_all ( void  )

Issues an Erase All command to the FLASHCDW.

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.

Warning
A Lock Error is issued if at least one region is locked or the bootloader protection is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.

References flashcdw_issue_command().

bool flashcdw_erase_all_gp_fuses ( bool  check)

Erases all general-purpose fuses.

Parameters
checkWhether to check erase: true or false.
Returns
Whether the erase succeeded or always true if erase check was not requested.
Warning
A Lock Error is issued if the Security bit is active or if the SECURE mode is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_issue_command(), and flashcdw_read_all_gp_fuses().

Referenced by flashcdw_erase_gp_fuse_byte(), and flashcdw_set_all_gp_fuses().

bool flashcdw_erase_all_pages ( bool  check)

Erases all pages within the flash array.

Parameters
checkWhether to check erase: true or false.
Returns
Whether the erase succeeded or always true if erase check was not requested.
Warning
A Lock Error is issued if at least one region is locked or the bootloader protection is active or the SECURE mode is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.

References flashcdw_erase_page(), flashcdw_error_status, and flashcdw_get_page_count().

bool flashcdw_erase_gp_fuse_bit ( unsigned int  gp_fuse_bit,
bool  check 
)

Erases a general-purpose fuse bit.

Parameters
gp_fuse_bitThe general-purpose fuse bit: 0 to 63.
checkWhether to check erase: true or false.
Returns
Whether the erase succeeded or always true if erase check was not requested.
Warning
A Lock Error is issued:
  • if the Security bit is active and the command is applied to BOOTPROT or EPFL or UPROT fuses,
  • if the SECURE mode is active and the command is applied to the SECURE bits.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_issue_command(), and flashcdw_read_gp_fuse_bit().

Referenced by flashcdw_erase_gp_fuse_bitfield(), and flashcdw_set_gp_fuse_bit().

bool flashcdw_erase_gp_fuse_bitfield ( unsigned int  pos,
unsigned int  width,
bool  check 
)

Erases a general-purpose fuse bit-field.

Parameters
posThe bit-position of the general-purpose fuse bit-field: 0 to 63.
widthThe bit-width of the general-purpose fuse bit-field: 0 to 64.
checkWhether to check erase: true or false.
Returns
Whether the erase succeeded or always true if erase check was not requested.
Warning
A Lock Error is issued:
  • if the Security bit is active and the command is applied to BOOTPROT or EPFL or UPROT fuses,
  • if the SECURE mode is active and the command is applied to the SECURE bits.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_erase_gp_fuse_bit(), flashcdw_error_status, flashcdw_read_gp_fuse_bitfield(), and min.

bool flashcdw_erase_gp_fuse_byte ( unsigned int  gp_fuse_byte,
bool  check 
)

Erases a general-purpose fuse byte.

Parameters
gp_fuse_byteThe general-purpose fuse byte: 0 to 7.
checkWhether to check erase: true or false.
Returns
Whether the erase succeeded or always true if erase check was not requested.
Warning
A Lock Error is issued if the Security bit is active or if the SECURE mode is active and the SECURE bits are in the target fuse byte.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_erase_all_gp_fuses(), flashcdw_error_status, flashcdw_read_all_gp_fuses(), flashcdw_read_gp_fuse_byte(), and flashcdw_write_gp_fuse_byte().

Referenced by flashcdw_set_gp_fuse_byte().

bool flashcdw_erase_page ( int  page_number,
bool  check 
)

Erases a page.

Parameters
page_numberThe page number:
checkWhether to check erase: true or false.
Returns
Whether the erase succeeded or always true if erase check was not requested.
Warning
A Lock Error is issued if the command is applied to a page belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.

References flashcdw_error_status, flashcdw_issue_command(), and flashcdw_quick_page_read().

Referenced by flashcdw_erase_all_pages(), flashcdw_memcpy(), and flashcdw_memset64().

bool flashcdw_erase_user_page ( bool  check)

Erases the User page.

Parameters
checkWhether to check erase: true or false.
Returns
Whether the erase succeeded or always true if erase check was not requested.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
An erase operation can only set bits.

References flashcdw_issue_command(), and flashcdw_quick_user_page_read().

Referenced by flashcdw_memcpy(), and flashcdw_memset64().

unsigned int flashcdw_get_bootloader_protected_size ( void  )

Gets the bootloader protected size.

Returns
The bootloader protected size in bytes.

References flashcdw_read_gp_fuse_bitfield().

Referenced by flashcdw_set_bootloader_protected_size().

unsigned int flashcdw_get_command ( void  )

Gets the last issued FLASHCDW command.

Returns
The last issued FLASHCDW command.
static unsigned int flashcdw_get_error_status ( void  )
static

Gets the error status of the FLASHCDW.

Returns
The error status of the FLASHCDW built up from AVR32_FLASHCDW_FSR_LOCKE_MASK and AVR32_FLASHCDW_FSR_PROGE_MASK.
Warning
This hardware error status is cleared by all functions reading the Flash Status Register (FSR). This function is therefore not part of the driver's API which instead presents flashcdw_is_lock_error and flashcdw_is_programming_error.

Referenced by flashcdw_issue_command().

unsigned int flashcdw_get_flash_size ( void  )

Gets the size of the whole flash array.

Returns
The size of the whole flash array in bytes.

Referenced by flashcdw_get_page_count(), flashcdw_memcpy(), and flashcdw_memset64().

unsigned int flashcdw_get_page_count ( void  )

Gets the total number of pages in the flash array.

Returns
The total number of pages in the flash array.

References flashcdw_get_flash_size().

Referenced by flashcdw_erase_all_pages(), and flashcdw_get_page_count_per_region().

unsigned int flashcdw_get_page_count_per_region ( void  )

Gets the number of pages in each flash region.

Returns
The number of pages in each flash region.

References AVR32_FLASHCDW_REGIONS, and flashcdw_get_page_count().

Referenced by flashcdw_get_page_region(), and flashcdw_get_region_first_page_number().

unsigned int flashcdw_get_page_number ( void  )

Gets the current FLASHCDW page number.

Returns
The current FLASHCDW page number.

Referenced by flashcdw_get_page_region().

unsigned int flashcdw_get_page_region ( int  page_number)

Gets the region number of a page.

Parameters
page_numberThe page number:
Returns
The region number of the specified page.

References flashcdw_get_page_count_per_region(), and flashcdw_get_page_number().

Referenced by flashcdw_is_page_region_locked().

unsigned int flashcdw_get_region_first_page_number ( unsigned int  region)

Gets the number of the first page of a region.

Parameters
regionThe region number: 0 to (AVR32_FLASHCDW_REGIONS - 1).
Returns
The number of the first page of the specified region.

References flashcdw_get_page_count_per_region().

Referenced by flashcdw_lock_region().

unsigned int flashcdw_get_wait_state ( void  )

Gets the number of wait states of flash read accesses.

Returns
The number of wait states of flash read accesses.
bool flashcdw_is_external_privileged_fetch_locked ( void  )

Tells whether external privileged fetch is locked.

Returns
Whether external privileged fetch is locked.

References flashcdw_read_gp_fuse_bit().

bool flashcdw_is_high_speed_enabled ( void  )

Tells whether the High-speed read mode is enabled.

Returns
1 if the high-speed read mode is enabled, else 0.
bool flashcdw_is_jtag_user_protection_enabled ( void  )

Tells whether the jtag user protection is enabled.

Returns
Whether the jtag user protection is enabled.

References flashcdw_read_gp_fuse_bit().

bool flashcdw_is_lock_error ( void  )

Tells whether a Lock Error has occurred during the last function called that issued one or more FLASHCDW commands.

Returns
Whether a Lock Error has occurred during the last function called that issued one or more FLASHCDW commands.

References flashcdw_error_status.

bool flashcdw_is_lock_error_int_enabled ( void  )

Tells whether the Lock Error interrupt is enabled.

Returns
Whether the Lock Error interrupt is enabled.
bool flashcdw_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.

Returns
Whether the page to which the last Quick Page Read or Quick Page Read User Page command was applied was erased.

Referenced by flashcdw_quick_page_read(), and flashcdw_quick_user_page_read().

bool flashcdw_is_page_region_locked ( int  page_number)

Tells whether the region of a page is locked.

Parameters
page_numberThe page number:
Returns
Whether the region of the specified page is locked.

References flashcdw_get_page_region(), and flashcdw_is_region_locked().

bool flashcdw_is_prog_error_int_enabled ( void  )

Tells whether the Programming Error interrupt is enabled.

Returns
Whether the Programming Error interrupt is enabled.
bool flashcdw_is_programming_error ( void  )

Tells whether a Programming Error has occurred during the last function called that issued one or more FLASHCDW commands.

Returns
Whether a Programming Error has occurred during the last function called that issued one or more FLASHCDW commands.

References flashcdw_error_status.

bool flashcdw_is_ready ( void  )

Tells whether the FLASHCDW is ready to run a new command.

Returns
Whether the FLASHCDW is ready to run a new command.

Referenced by flashcdw_default_wait_until_ready().

bool flashcdw_is_ready_int_enabled ( void  )

Tells whether the Flash Ready interrupt is enabled.

Returns
Whether the Flash Ready interrupt is enabled.
bool flashcdw_is_region_locked ( unsigned int  region)

Tells whether a region is locked.

Parameters
regionThe region number: 0 to (AVR32_FLASHCDW_REGIONS - 1).
Returns
Whether the specified region is locked.

References AVR32_FLASHCDW_REGIONS.

Referenced by flashcdw_is_page_region_locked().

bool flashcdw_is_secure_state_debug_enabled ( void  )

Tells whether the Secure State debug is enabled.

Returns
Whether the Secure State debug is enabled.

References flashcdw_read_gp_fuse_bitfield().

bool flashcdw_is_secure_state_enabled ( void  )

Tells whether the Secure State is enabled.

Returns
Whether the Secure State is enabled.

References flashcdw_read_gp_fuse_bitfield().

bool flashcdw_is_security_bit_active ( void  )

Tells whether the Security bit is active.

Returns
Whether the Security bit is active.
void flashcdw_issue_command ( unsigned int  command,
int  page_number 
)

Issues a FLASHCDW command.

Parameters
commandThe command: AVR32_FLASHCDW_FCMD_CMD_x.
page_numberThe page number to apply the command to:
  • 0 to (flashcdw_get_page_count() - 1): a page number within the flash array;
  • < 0: use this to apply the command to the current page number or if the command does not apply to any page number;
  • this argument may have other meanings according to the command. See the FLASHCDW chapter of the MCU datasheet.
Warning
A Lock Error is issued if the command violates the protection mechanism.
A Programming Error is issued if the command is invalid.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References u_avr32_flashcdw_fcmd_t::fcmd, u_avr32_flashcdw_fcmd_t::FCMD, flashcdw_error_status, flashcdw_get_error_status(), and flashcdw_wait_until_ready.

Referenced by flashcdw_activate_security_bit(), flashcdw_clear_page_buffer(), flashcdw_erase_all(), flashcdw_erase_all_gp_fuses(), flashcdw_erase_gp_fuse_bit(), flashcdw_erase_page(), flashcdw_erase_user_page(), flashcdw_lock_page_region(), flashcdw_no_operation(), flashcdw_quick_page_read(), flashcdw_quick_user_page_read(), flashcdw_set_flash_waitstate_and_readmode(), flashcdw_write_gp_fuse_bit(), flashcdw_write_gp_fuse_byte(), flashcdw_write_page(), and flashcdw_write_user_page().

void flashcdw_lock_all_regions ( bool  lock)

Locks or unlocks all regions.

Parameters
lockWhether to lock the regions: true or false.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References AVR32_FLASHCDW_REGIONS, flashcdw_error_status, and flashcdw_lock_region().

void flashcdw_lock_external_privileged_fetch ( bool  lock)

Locks or unlocks external privileged fetch.

Parameters
lockWhether to lock external privileged fetch: true or false.
Warning
A Lock Error is issued if the Security bit is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_set_gp_fuse_bit().

void flashcdw_lock_page_region ( int  page_number,
bool  lock 
)

Locks or unlocks the region of a page.

Parameters
page_numberThe page number:
lockWhether to lock the region of the specified page: true or false.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_issue_command().

Referenced by flashcdw_lock_region().

void flashcdw_lock_region ( unsigned int  region,
bool  lock 
)

Locks or unlocks a region.

Parameters
regionThe region number: 0 to (AVR32_FLASHCDW_REGIONS - 1).
lockWhether to lock the specified region: true or false.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_get_region_first_page_number(), and flashcdw_lock_page_region().

Referenced by flashcdw_lock_all_regions().

volatile void* flashcdw_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.

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.

Parameters
dstPointer to flash destination.
srcPointer to source data.
nbytesNumber of bytes to copy.
eraseWhether to erase before writing: true or false.
Returns
The value of dst.
Warning
If copying takes place between areas that overlap, the behavior is undefined.
This function may be called with erase set to 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.
A Lock Error is issued if the command is applied to pages belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References Assert, flashcdw_clear_page_buffer(), flashcdw_erase_page(), flashcdw_erase_user_page(), flashcdw_error_status, flashcdw_get_flash_size(), flashcdw_write_page(), flashcdw_write_user_page(), Union64::u64, and Union64::u8.

Referenced by flash_rw_example().

volatile void* flashcdw_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.

All pointer and size alignments are supported.

Parameters
dstPointer to flash destination.
srcSource half-word.
nbytesNumber of bytes to set.
eraseWhether to erase before writing: true or false.
Returns
The value of dst.
Warning
This function may be called with erase set to 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.
A Lock Error is issued if the command is applied to pages belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_memset32().

Referenced by flashcdw_memset8().

volatile void* flashcdw_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.

All pointer and size alignments are supported.

Parameters
dstPointer to flash destination.
srcSource word.
nbytesNumber of bytes to set.
eraseWhether to erase before writing: true or false.
Returns
The value of dst.
Warning
This function may be called with erase set to 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.
A Lock Error is issued if the command is applied to pages belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_memset64().

Referenced by flashcdw_memset16().

volatile void* flashcdw_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.

All pointer and size alignments are supported.

Parameters
dstPointer to flash destination.
srcSource double-word.
nbytesNumber of bytes to set.
eraseWhether to erase before writing: true or false.
Returns
The value of dst.
Warning
This function may be called with erase set to 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.
A Lock Error is issued if the command is applied to pages belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References Align_down, flashcdw_clear_page_buffer(), flashcdw_erase_page(), flashcdw_erase_user_page(), flashcdw_error_status, flashcdw_get_flash_size(), flashcdw_write_page(), flashcdw_write_user_page(), Get_align, min, Test_align, StructCVPtr::u16ptr, Union64::u32, UnionVPtr::u32ptr, StructCVPtr::u32ptr, Union64::u64, UnionVPtr::u64ptr, UnionCVPtr::u64ptr, StructCVPtr::u64ptr, Union64::u8, UnionVPtr::u8ptr, UnionCVPtr::u8ptr, and StructCVPtr::u8ptr.

Referenced by flashcdw_memset32().

volatile void* flashcdw_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.

All pointer and size alignments are supported.

Parameters
dstPointer to flash destination.
srcSource byte.
nbytesNumber of bytes to set.
eraseWhether to erase before writing: true or false.
Returns
The value of dst.
Warning
This function may be called with erase set to false only if the destination consists only of erased words, i.e. this function cannot 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.
A Lock Error is issued if the command is applied to pages belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_memset16().

void flashcdw_no_operation ( void  )

Issues a No Operation command to the FLASHCDW.

Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_issue_command().

bool flashcdw_quick_page_read ( int  page_number)

Applies the Quick Page Read command to a page.

Parameters
page_numberThe page number:
Returns
Whether the specified page is erased.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_is_page_erased(), and flashcdw_issue_command().

Referenced by flashcdw_erase_page().

bool flashcdw_quick_user_page_read ( void  )

Issues a Quick Page Read User Page command to the FLASHCDW.

Returns
Whether the User page is erased.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References flashcdw_is_page_erased(), and flashcdw_issue_command().

Referenced by flashcdw_erase_user_page().

uint64_t flashcdw_read_all_gp_fuses ( void  )

Reads all general-purpose fuses.

Returns
The value of all general-purpose fuses as a word.
Note
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

Referenced by flashcdw_erase_all_gp_fuses(), flashcdw_erase_gp_fuse_byte(), flashcdw_read_gp_fuse_bit(), flashcdw_read_gp_fuse_bitfield(), and flashcdw_read_gp_fuse_byte().

bool flashcdw_read_gp_fuse_bit ( unsigned int  gp_fuse_bit)

Reads a general-purpose fuse bit.

Parameters
gp_fuse_bitThe general-purpose fuse bit: 0 to 63.
Returns
The value of the specified general-purpose fuse bit.
Note
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_read_all_gp_fuses().

Referenced by flashcdw_erase_gp_fuse_bit(), flashcdw_is_external_privileged_fetch_locked(), and flashcdw_is_jtag_user_protection_enabled().

uint64_t flashcdw_read_gp_fuse_bitfield ( unsigned int  pos,
unsigned int  width 
)

Reads a general-purpose fuse bit-field.

Parameters
posThe bit-position of the general-purpose fuse bit-field: 0 to 63.
widthThe bit-width of the general-purpose fuse bit-field: 0 to 64.
Returns
The value of the specified general-purpose fuse bit-field.
Note
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_read_all_gp_fuses(), and min.

Referenced by flashcdw_erase_gp_fuse_bitfield(), flashcdw_get_bootloader_protected_size(), flashcdw_is_secure_state_debug_enabled(), and flashcdw_is_secure_state_enabled().

uint8_t flashcdw_read_gp_fuse_byte ( unsigned int  gp_fuse_byte)

Reads a general-purpose fuse byte.

Parameters
gp_fuse_byteThe general-purpose fuse byte: 0 to 7.
Returns
The value of the specified general-purpose fuse byte.
Note
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_read_all_gp_fuses().

Referenced by flashcdw_erase_gp_fuse_byte().

void flashcdw_set_all_gp_fuses ( uint64_t  value)

Sets all general-purpose fuses with the appropriate erase and write operations.

Parameters
valueThe value of all general-purpose fuses as a word.
Warning
A Lock Error is issued if the Security bit is active or if the SECURE mode is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_erase_all_gp_fuses(), flashcdw_error_status, and flashcdw_write_all_gp_fuses().

unsigned int flashcdw_set_bootloader_protected_size ( unsigned int  bootprot_size)

Sets the bootloader protected size.

Parameters
bootprot_sizeThe 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.
Returns
The actual bootloader protected size in bytes.
Warning
A Lock Error is issued if the Security bit is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.

References clz, flashcdw_get_bootloader_protected_size(), flashcdw_set_gp_fuse_bitfield(), max, and min.

void flashcdw_set_flash_waitstate_and_readmode ( unsigned long  cpu_f_hz)

Depending on the CPU frequency, set the wait states of flash read accesses and enable or disable the High speed read mode.

Parameters
cpu_f_hzThe CPU frequency

References flashcdw_issue_command(), and flashcdw_set_wait_state().

Referenced by pcl_configure_synchronous_clocks(), and pcl_switch_to_osc().

void flashcdw_set_gp_fuse_bit ( unsigned int  gp_fuse_bit,
bool  value 
)

Sets a general-purpose fuse bit with the appropriate erase and write operations.

Parameters
gp_fuse_bitThe general-purpose fuse bit: 0 to 63.
valueThe value of the specified general-purpose fuse bit.
Warning
A Lock Error is issued:
  • if the Security bit is active and the command is applied to BOOTPROT or EPFL or UPROT fuses,
  • if the SECURE mode is active and the command is applied to the SECURE bits.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_erase_gp_fuse_bit(), and flashcdw_write_gp_fuse_bit().

Referenced by flashcdw_disable_jtag_user_protection(), flashcdw_enable_jtag_user_protection(), flashcdw_lock_external_privileged_fetch(), and flashcdw_set_gp_fuse_bitfield().

void flashcdw_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.

Parameters
posThe bit-position of the general-purpose fuse bit-field: 0 to 63.
widthThe bit-width of the general-purpose fuse bit-field: 0 to 64.
valueThe value of the specified general-purpose fuse bit-field.
Warning
A Lock Error is issued:
  • if the Security bit is active and the command is applied to BOOTPROT or EPFL or UPROT fuses,
  • if the SECURE mode is active and the command is applied to the SECURE bits.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_error_status, flashcdw_set_gp_fuse_bit(), and min.

Referenced by flashcdw_set_bootloader_protected_size().

void flashcdw_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.

Parameters
gp_fuse_byteThe general-purpose fuse byte: 0 to 7.
valueThe value of the specified general-purpose fuse byte.
Warning
A Lock Error is issued if the Security bit is active or if the SECURE mode is active and the SECURE bits are in the target fuse byte.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_erase_gp_fuse_byte(), flashcdw_error_status, and flashcdw_write_gp_fuse_byte().

void flashcdw_set_wait_state ( unsigned int  wait_state)

Sets the number of wait states of flash read accesses.

Parameters
wait_stateThe number of wait states of flash read accesses: 0 to 1.

References u_avr32_flashcdw_fcr_t::fcr, and u_avr32_flashcdw_fcr_t::FCR.

Referenced by flashcdw_set_flash_waitstate_and_readmode().

void flashcdw_write_all_gp_fuses ( uint64_t  value)

Writes all general-purpose fuses.

Parameters
valueThe value of all general-purpose fuses as a word.
Warning
A Lock Error is issued if the Security bit is active or if the SECURE mode is active.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
A write operation can only clear bits; in other words, an erase operation must first be done if some bits need to be set to 1.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_error_status, and flashcdw_write_gp_fuse_byte().

Referenced by flashcdw_set_all_gp_fuses().

void flashcdw_write_gp_fuse_bit ( unsigned int  gp_fuse_bit,
bool  value 
)

Writes a general-purpose fuse bit.

Parameters
gp_fuse_bitThe general-purpose fuse bit: 0 to 63.
valueThe value of the specified general-purpose fuse bit.
Warning
A Lock Error is issued:
  • if the Security bit is active and the command is applied to BOOTPROT or EPFL or UPROT fuses,
  • if the SECURE mode is active and the command is applied to the SECURE bits.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
A write operation can only clear bits; in other words, an erase operation must first be done if some bits need to be set to 1.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_issue_command().

Referenced by flashcdw_set_gp_fuse_bit(), and flashcdw_write_gp_fuse_bitfield().

void flashcdw_write_gp_fuse_bitfield ( unsigned int  pos,
unsigned int  width,
uint64_t  value 
)

Writes a general-purpose fuse bit-field.

Parameters
posThe bit-position of the general-purpose fuse bit-field: 0 to 63.
widthThe bit-width of the general-purpose fuse bit-field: 0 to 64.
valueThe value of the specified general-purpose fuse bit-field.
Warning
A Lock Error is issued:
  • if the Security bit is active and the command is applied to BOOTPROT or EPFL or UPROT fuses,
  • if the SECURE mode is active and the command is applied to the SECURE bits.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
A write operation can only clear bits; in other words, an erase operation must first be done if some bits need to be set to 1.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_error_status, flashcdw_write_gp_fuse_bit(), and min.

Referenced by flashcdw_enable_secure_state_no_debug(), and flashcdw_enable_secure_state_with_debug().

void flashcdw_write_gp_fuse_byte ( unsigned int  gp_fuse_byte,
uint8_t  value 
)

Writes a general-purpose fuse byte.

Parameters
gp_fuse_byteThe general-purpose fuse byte: 0 to 7.
valueThe value of the specified general-purpose fuse byte.
Warning
A Lock Error is issued if the Security bit is active or if the SECURE mode is active and the SECURE bits are in the target fuse byte.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
A write operation can only clear bits; in other words, an erase operation must first be done if some bits need to be set to 1.
The actual number of general-purpose fuse bits implemented by hardware is given by AVR32_FLASHCDW_GPF_NUM. The other bits among the 64 are fixed at 1 by hardware.

References flashcdw_issue_command().

Referenced by flashcdw_erase_gp_fuse_byte(), flashcdw_set_gp_fuse_byte(), and flashcdw_write_all_gp_fuses().

void flashcdw_write_page ( int  page_number)

Writes a page from the page buffer.

Parameters
page_numberThe page number:
Warning
A Lock Error is issued if the command is applied to a page belonging to a locked region or to the bootloader protected area or to a secure area requiring secure privileges.
The page buffer is not automatically reset after a page write.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
A write operation can only clear bits; in other words, an erase operation must first be done if some bits need to be set to 1.

References flashcdw_issue_command().

Referenced by flashcdw_memcpy(), and flashcdw_memset64().

void flashcdw_write_user_page ( void  )

Writes the User page from the page buffer.

Warning
The page buffer is not automatically reset after a page write.
Note
The FLASHCDW error status returned by flashcdw_is_lock_error and flashcdw_is_programming_error is updated.
A write operation can only clear bits; in other words, an erase operation must first be done if some bits need to be set to 1.

References flashcdw_issue_command().

Referenced by flashcdw_memcpy(), and flashcdw_memset64().

unsigned int flashcdw_error_status = 0
static
void(*volatile flashcdw_wait_until_ready)(void)

Pointer to the function used by the driver when it needs to wait until the FLASHCDW is ready to run a new command.

The default function is flashcdw_default_wait_until_ready. The user may change this pointer to use another implementation.

Referenced by flashcdw_issue_command().