| Electronic Components Datasheet Search |
|
SH7262 Datasheet(PDF) 26 Page - Renesas Technology Corp |
|
|
|||||||||||||||||||||||||||||
SH7262 Datasheet(HTML) 26 Page - Renesas Technology Corp |
|
26 / 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 26 of 45 3.8 Sample Program Listing "serial_flash.c" (5/19) 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 void sf_sector_erase(int sector_no) { unsigned char cmd[4]; unsigned long addr = sector_no * SF_SECTOR_SIZE; cmd[0] = SFLASHCMD_SECTOR_ERASE; cmd[1] = (addr >> 16) & 0xff; cmd[2] = (addr >> 8) & 0xff; cmd[3] = addr & 0xff; write_enable(); io_cmd_exe(cmd, 4, NULL, 0); busy_wait(); } /*""FUNC COMMENT""************************************************************** * ID : * Outline : Program data *------------------------------------------------------------------------------ * Include : *------------------------------------------------------------------------------ * Declaration : void sf_byte_program(unsigned long addr, unsigned char *buf, int size); *------------------------------------------------------------------------------ * Description : Programs the specified data in serial flash memory. * : Before erasing or programming, issue the Write Enable command. * : After erasing or programming, make sure to check the status of * : serial flash memory if it is not busy. * : The maximum write data size depends on the type of the device. *------------------------------------------------------------------------------ * Argument : unsigned long addr ; I : Address in serial flash memory to write * : unsigned char *buf ; I : Buffer address to store the write data * : int size ; I : Number of bytes to write *------------------------------------------------------------------------------ * Return Value : void *------------------------------------------------------------------------------ * Note : None *""FUNC COMMENT END""**********************************************************/ void sf_byte_program(unsigned long addr, unsigned char *buf, int size) { unsigned char cmd[4]; cmd[0] = SFLASHCMD_BYTE_PROGRAM; cmd[1] = (unsigned char)((addr >> 16) & 0xff); cmd[2] = (unsigned char)((addr >> 8) & 0xff); cmd[3] = (unsigned char)( addr & 0xff); write_enable(); io_cmd_exe(cmd, 4, buf, size); busy_wait(); } |
|
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 |