English
Language : 

SH7262 Datasheet, PDF (24/45 Pages) Renesas Technology Corp – High-speed Read/Write Serial Flash Memory
SH7262/SH7264 Group
High-speed Read/Write Serial Flash Memory
Using the Renesas Serial Peripheral Interface
3.6 Sample Program Listing "serial_flash.c" (3/19)
100 void sf_init_serial_flash(void)
101 {
102
/* ==== Initializes the RSPI0 ==== */
103
io_init_rspi();
104 }
105 /*""FUNC COMMENT""**************************************************************
106
* ID
:
107
* Outline
: Protect/unprotect operation
108
*------------------------------------------------------------------------------
109
* Include
: "serial_flash.h"
110
*------------------------------------------------------------------------------
111
* Declaration : void sf_init_serial_flash(void);
112
*------------------------------------------------------------------------------
113
* Description : Protects or unprotects serial flash memory.
114
*
: Use the argument req to specify. Default setting and unprotecting
115
*
: method depends on the specifications of the serial flash memory.
116
*------------------------------------------------------------------------------
117
* Argument
: enum sf_req req ; I : SF_REQ_UNPROTECT -> Write-enable all sectors
118
*
:
SF_REQ_PROTECT -> Write-protect all sectors
119
*------------------------------------------------------------------------------
120
* Return Value : void
121
*------------------------------------------------------------------------------
122
* Note
: None
123
*""FUNC COMMENT END""**********************************************************/
124 void sf_protect_ctrl(enum sf_req req)
125 {
126
if( req == SF_REQ_UNPROTECT ){
127
write_status( UNPROTECT_WR_STATUS);
/* Unprotects total area */
128
}
129
else{
130
write_status( PROTECT_WR_STATUS ); /* Protects total area */
131
}
132 }
REJ06B0889-0100/Rev.1.00
June 2009
Page 24 of 45