English
Language : 

SH7262 Datasheet, PDF (31/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.13 Sample Program Listing "serial_flash.c" (10/19)
406
407
write_enable();
408
io_cmd_exe(cmd, 2, NULL, 0);
409
busy_wait();
410 }
411 /*""FUNC COMMENT""**************************************************************
412 * ID
:
413 * Outline
: RSPI initialization
414 *------------------------------------------------------------------------------
415 * Include
:
416 *------------------------------------------------------------------------------
417 * Declaration : static void io_init_rspi(void);
418 *------------------------------------------------------------------------------
419 * Description : Initializes channel 0 of the RSPI.
420 *
: Sets the RSPI in master mode to set parameters to transfer
421 *
: according to the specifications of serial flash memory.
422 *------------------------------------------------------------------------------
423 * Argument
: void
424 *------------------------------------------------------------------------------
425 * Return Value : void
426 *------------------------------------------------------------------------------
427 * Note
: None
428 *""FUNC COMMENT END""**********************************************************/
429 static void io_init_rspi(void)
430 {
431
/* ==== PORT ==== */
432
PORT.PFCR3.BIT.PF12MD = 3; /* PF12:MISO0 */
433
PORT.PFCR2.BIT.PF11MD = 3; /* PF11:MOSI0 */
434
PORT.PFCR2.BIT.PF10MD = 3; /* PF10:SSL00 */
435
PORT.PFCR2.BIT.PF9MD = 3; /* PF9:RSPCK0 */
436
437
/* ==== CPG ==== */
438
CPG.STBCR5.BIT.MSTP51 = 0; /* RSPI0 active */
439
REJ06B0889-0100/Rev.1.00
June 2009
Page 31 of 45