English
Language : 

SH7262 Datasheet, PDF (29/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.11 Sample Program Listing "serial_flash.c" (8/19)
314 /*""FUNC COMMENT""**************************************************************
315 * ID
:
316 * Outline
: Write disable
317 *------------------------------------------------------------------------------
318 * Include
:
319 *------------------------------------------------------------------------------
320 * Declaration : static void write_disable(void);
321 *------------------------------------------------------------------------------
322 * Description : Issues the Write Disable command to disable erasing or programming
323 *
: serial flash memory.
324 *------------------------------------------------------------------------------
325 * Argument
: void
326 *------------------------------------------------------------------------------
327 * Return Value : void
328 *------------------------------------------------------------------------------
329 * Note
: None
330 *""FUNC COMMENT END""**********************************************************/
331 static void write_disable(void)
332 {
333
unsigned char cmd[1];
334
cmd[0] = SFLASHCMD_WRITE_DISABLE;
335
io_cmd_exe(cmd, 1, NULL, 0);
336 }
337 /*""FUNC COMMENT""**************************************************************
338 * ID
:
339 * Outline
: Busy wait
340 *------------------------------------------------------------------------------
341 * Include
:
342 *------------------------------------------------------------------------------
343 * Declaration : static void busy_wait(void);
344 *------------------------------------------------------------------------------
345 * Description : Loops internally when the serial flash memory is busy.
346 *------------------------------------------------------------------------------
347 * Argument
: void
348 *------------------------------------------------------------------------------
349 * Return Value : void
350 *------------------------------------------------------------------------------
351 * Note
: None
352 *""FUNC COMMENT END""**********************************************************/
353 static void busy_wait(void)
354 {
355
while ((read_status() & 0x01) != 0) { /* RDY/BSY */
356
/* serial flash is busy */
357
}
358 }
REJ06B0889-0100/Rev.1.00
June 2009
Page 29 of 45