| Electronic Components Datasheet Search |
|
SH7262 Datasheet(PDF) 38 Page - Renesas Technology Corp |
|
|
|||||||||||||||||||||||||||||
SH7262 Datasheet(HTML) 38 Page - Renesas Technology Corp |
|
38 / 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 38 of 45 3.20 Sample Program Listing "serial_flash.c" (17/19) 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 /*""FUNC COMMENT""************************************************************** * ID : * Outline : Execute command (With read data, longword transfer and DMA). *------------------------------------------------------------------------------ * Include : *------------------------------------------------------------------------------ * Declaration : static void io_cmd_exe_rdmode_dma_l(unsigned char *ope, int ope_sz, * : unsigned long *rd, int rd_sz); *------------------------------------------------------------------------------ * Description : Executes the specified command. * : Transmits the argument ope, and then receives data in the argument rd. * : Transfer the read data in units of longword, by the DMA transfer. * : Set one of the values between 0 and 8 in the ope_sz. * : Although more than 0 can be set in the rd_sz, set the value * : in multiples of 4. *------------------------------------------------------------------------------ * Argument : unsigned long *ope ; I : Start address of the opcode block and * address block * : int ope_sz ; I : Number of bytes in the opcode block and * address block * : unsigned long *rd ; I : Buffer address to store the received data * : int rd_sz ; I : Number of bytes in the data block *------------------------------------------------------------------------------ * Return Value : void *------------------------------------------------------------------------------ * Note : None *""FUNC COMMENT END""**********************************************************/ static void io_cmd_exe_rdmode_dma_l(unsigned char *ope, int ope_sz, unsigned long *rd, int rd_sz) { /* ==== Resets buffer ==== */ RSPI0.SPBFCR.BYTE = 0xC0u; RSPI0.SPBFCR.BYTE = 0x00u; /* ---- Enables the SPI transfer ---- */ RSPI0.SPCR.BIT.SPE = 1; /* ---- MOSI (command, address, dummy) ---- */ 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 */ } io_wait_tx_end(); /* Waits for transfer end */ |
|
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 |