English
Language : 

SH7262 Datasheet, PDF (30/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.12 Sample Program Listing "serial_flash.c" (9/19)
359 /*""FUNC COMMENT""**************************************************************
360 * ID
:
361 * Outline
: Read status
362 *------------------------------------------------------------------------------
363 * Include
:
364 *------------------------------------------------------------------------------
365 * Declaration : static unsigned char read_status(void);
366 *------------------------------------------------------------------------------
367 * Description : Reads the status of serial flash memory.
368 *------------------------------------------------------------------------------
369 * Argument
: void
370 *------------------------------------------------------------------------------
371 * Return Value : Status register value
372 *------------------------------------------------------------------------------
373 * Note
: None
374 *""FUNC COMMENT END""**********************************************************/
375 static unsigned char read_status(void)
376 {
377
unsigned char buf;
378
unsigned char cmd[1];
379
380
cmd[0] = SFLASHCMD_READ_STATUS;
381
io_cmd_exe_rdmode(cmd, 1, &buf, 1);
382
return buf;
383 }
384 /*""FUNC COMMENT""**************************************************************
385 * ID
:
386 * Outline
: Write status
387 *------------------------------------------------------------------------------
388 * Include
:
389 *------------------------------------------------------------------------------
390 * Declaration : static void write_status(unsigned char status);
391 *------------------------------------------------------------------------------
392 * Description : Writes the status of serial flash memory.
393 *------------------------------------------------------------------------------
394 * Argument
: unsigned char status ; I : status register value
395 *------------------------------------------------------------------------------
396 * Return Value : void
397 *------------------------------------------------------------------------------
398 * Note
: None
399 *""FUNC COMMENT END""**********************************************************/
400 static void write_status(unsigned char status)
401 {
402
unsigned char cmd[2];
403
404
cmd[0] = SFLASHCMD_WRITE_STATUS;
405
cmd[1] = status;
REJ06B0889-0100/Rev.1.00
June 2009
Page 30 of 45