English
Language : 

SH7262 Datasheet, PDF (25/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.7 Sample Program Listing "serial_flash.c" (4/19)
133 /*""FUNC COMMENT""**************************************************************
134 * ID
:
135 * Outline
: Chip erase
136 *------------------------------------------------------------------------------
137 * Include
:
138 *------------------------------------------------------------------------------
139 * Declaration : void sf_chip_erase(void);
140 *------------------------------------------------------------------------------
141 * Description : Erases all bits in serial flash memory.
142 *
: Before erasing or programming, issue the Write Enable command.
143 *
: After erasing or programming, make sure to check the status of
144 *
: serial flash memory if it is not busy.
145 *------------------------------------------------------------------------------
146 * Argument
: void
147 *------------------------------------------------------------------------------
148 * Return Value : void
149 *------------------------------------------------------------------------------
150 * Note
: None
151 *""FUNC COMMENT END""**********************************************************/
152 void sf_chip_erase(void)
153 {
154
unsigned char cmd[1];
155
cmd[0] = SFLASHCMD_CHIP_ERASE;
156
157
write_enable();
158
io_cmd_exe(cmd, 1, NULL, 0);
159
busy_wait();
160 }
161 /*""FUNC COMMENT""**************************************************************
162 * ID
:
163 * Outline
: Sector erase
164 *------------------------------------------------------------------------------
165 * Include
:
166 *------------------------------------------------------------------------------
167 * Declaration : void sf_sector_erase(void);
168 *------------------------------------------------------------------------------
169 * Description : Erases the specified sector in serial flash memory.
170 *
: Before erasing or programming, issue the Write Enable command.
171 *
: After erasing or programming, make sure to check the status of
172 *
: serial flash memory if it is not busy.
173 *------------------------------------------------------------------------------
174 * Argument
: int sector_no ; I : Sector number
175 *------------------------------------------------------------------------------
176 * Return Value : void
177 *------------------------------------------------------------------------------
178 * Note
: None
179 *""FUNC COMMENT END""**********************************************************/
REJ06B0889-0100/Rev.1.00
June 2009
Page 25 of 45