User`s manual
RX600 & RX200 Series Simple Flash API for RX
R01AN0544EU0250 Rev.2.50 Page 24 of 33
March 4, 2014
4.5 R_FlashDataAreaAccess
This function allows Data Flash areas to be accessed or modified. The data flash cannot be read, written,
or erased before calling this function.
Format
void R_FlashDataAreaAccess(uint16_t read_en_mask,
uint16_t write_en_mask);
Parameters
read_en_mask
This is a bitmapped value where bits are used to determine which Data blocks should be able to be
read by the MCU. A ‘0’ indicates the block cannot be accessed and a ‘1’ indicates it can. Bits 0-3
represent Data Blocks 0-3 respectively.
write_en_mask
This is a bitmapped value where bits are used to determine which Data blocks should be able to be
modified (Erase/Write) by the Flash Control Unit (FCU). A ‘0’ indicates the block cannot be modified
and a ‘1’ indicates it can. Bits 0-3 represent Data Blocks 0-3 respectively.
Return Values
None.
Properties
Prototyped in file “r_flash_api_rx_if.h”
Implemented in file “r_flash_api_rx.c”
Description
After reset, the data flash area is not readable by the MCU. It is also not enabled for reprogramming. This
function is used to select what blocks you would like to be read or modifiable. You only have to set this
function once at the beginning of your application.
Reentrant
No, but this function should only need to be called once after reset.
Example
/* Enable reading, writing, and erasing of all data flash blocks. */
R_FlashDataAreaAccess(0xFFFF, 0xFFFF);
Special Notes:
None.