| Electronic Components Datasheet Search |
|
SH7262 Datasheet(PDF) 33 Page - Renesas Technology Corp |
|
|
|||||||||||||||||||||||||||||
SH7262 Datasheet(HTML) 33 Page - Renesas Technology Corp |
|
33 / 45 page ![]() SH7262/SH7264 Group High-speed Read/Write Serial Flash Memory Using the Renesas Serial Peripheral Interface REJ06B0889-0100/Rev.1.00 June 2009 Page 33 of 45 3.15 Sample Program Listing "serial_flash.c" (12/19) 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 /*""FUNC COMMENT""************************************************************** * ID : * Outline : Execute command (No read data). *------------------------------------------------------------------------------ * Include : *------------------------------------------------------------------------------ * Declaration : static void io_cmd_exe(unsigned char *ope, int ope_sz, * : unsigned char *data,int data_sz) *------------------------------------------------------------------------------ * Description : Executes the specified command. * : Transmits the argument ope, and then transmits the argument data. * : Discards the received data. * : Set one of the values between 0 and 8 in the ope_sz. * : Set one of the values between 0 and 256 in the data_sz. *------------------------------------------------------------------------------ * Argument : unsigned char *ope ; I : Start address of the opcode block and * address block to transmit * : int ope_sz ; I : Number of bytes in the opcode block and * address block * : unsigned char *data; I : Start address of the data block to transmit * : int data_sz ; I : Number of bytes in the data block *------------------------------------------------------------------------------ * Return Value : void *------------------------------------------------------------------------------ * Note : None *""FUNC COMMENT END""**********************************************************/ static void io_cmd_exe(unsigned char *ope, int ope_sz, unsigned char *data, int data_sz) { unsigned char tmp; /* ==== Resets buffer ==== */ RSPI0.SPBFCR.BYTE = 0xC0u; RSPI0.SPBFCR.BYTE = 0x00u; /* ---- Enables the SPI transfer ---- */ RSPI0.SPCR.BIT.SPE = 1; /* ==== MOSI (command, address, write data) ==== */ RSPI0.SPCMD0.BIT.CPOL= 1; /* RSPCK when idling is 1 */ RSPI0.SPCMD0.BIT.CPHA= 0; /* Outputs data on even (rising) edge */ while(ope_sz--){ RSPI0.SPDR.BYTE = *ope++; /* Command size must be equal or less than 8 bytes */ } |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |