English
Language : 

SH7262 Datasheet, PDF (32/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.14 Sample Program Listing "serial_flash.c" (11/19)
440
/* ==== RSPI ==== */
441
RSPI0.SPCR.BYTE = 0x00; /* Disables channel 0 of the RSPI */
442
RSPI0.SPPCR.BYTE = 0x30; /* MOSI idle fixed value = 1 */
443
RSPI0.SPBR.BYTE = 0x00; /* Specifies the base bit rate as 36 MHz
444
(Bus clock = 72 MHz) */
445
RSPI0.SPDCR.BYTE = 0x20; /* Disables to transmit the dummy data */
446
/* Access width to the SPDR register: 8-bit */
447
RSPI0.SPCKD.BYTE = 0x00; /* RSPCK delay: 1 RSPCK */
448
RSPI0.SSLND.BYTE = 0x00; /* SSL negate delay: 1 RSPCK */
449
RSPI0.SPND.BYTE = 0x00; /* Next access delay: 1 RSPCK + 2 Bus clocks */
450
RSPI0.SPSCR.BYTE = 0x00; /* Sequence length: 1 (SPCMD0 is only used) */
451
RSPI0.SPCMD0.WORD = 0xE780; /* MSB first */
452
/* Data length: 8-bit */
453
/* Keeps the SSL signal level after transfer
454
is completed */
455
/* Bit rate: Base bit rate is not divided */
456
/* RSPCK when idling is 0 */
457
/* Latches data on odd edge, outputs data on even edge */
458
RSPI0.SPBFCR.BYTE = 0xC0; /* Enables to reset data in the
459
transmit/receive buffer */
460
RSPI0.SPBFCR.BYTE = 0x00; /* Disables to reset data in the
461
transmit/receive buffer */
462
/* Number of triggers in transmit buffer:
463
more than one byte available */
464
/* Number of triggers in receive buffer:
465
more than one byte received */
466
RSPI0.SSLP.BYTE = 0x00; /* SSLP = b'0 SSL signal 0-active */
467
RSPI0.SPCR.BYTE = 0x48; /* Master mode */
468
/* Disables interrupts */
469
/* Enables channel 0 of the RSPI */
470 }
REJ06B0889-0100/Rev.1.00
June 2009
Page 32 of 45