Go to the source code of this file.
Defines | |
#define | ISPMOSI_PORT PORTE |
#define | ISPMOSI_DDR DDRE |
#define | ISPMOSI_BIT 0 |
#define | ISPMISO_PORT PORTE |
#define | ISPMISO_DDR DDRE |
#define | ISPMISO_PIN PINE |
#define | ISPMISO_BIT 1 |
#define | ISPSCK_PORT PORTB |
#define | ISPSCK_DDR DDRB |
#define | ISPSCK_BIT 1 |
Functions | |
int | SpiFlashEnable (void) |
Enable SPI device flash programming. | |
void | SpiFlashId (u_char *id) |
int | SpiFlashWriteByte (u_char high, u_short addr, u_char data) |
Write byte to the target's flash memory. | |
int | SpiFlashWriteWord (u_short addr, u_short data) |
Write word to the target's flash memory. | |
void | SpiFlashErase (void) |
Erase target's flash memory. | |
int | main (void) |
#define ISPMOSI_PORT PORTE |
Definition at line 73 of file isp2.c.
Referenced by SpiFlashEnable().
#define ISPMOSI_DDR DDRE |
#define ISPMOSI_BIT 0 |
#define ISPMISO_PORT PORTE |
#define ISPMISO_DDR DDRE |
#define ISPMISO_BIT 1 |
#define ISPSCK_PORT PORTB |
#define ISPSCK_DDR DDRB |
#define ISPSCK_BIT 1 |
int SpiFlashEnable | ( | void | ) |
void SpiFlashId | ( | u_char * | id | ) |
Write byte to the target's flash memory.
The target must have been erased by a previous call to SpiFlashErase().
high | Must be 0 to write the low byte or 8 to write the high byte. | |
addr | Word address to write to. | |
data | Byte value to write. |
Definition at line 183 of file isp2.c.
Referenced by SpiFlashWriteWord().
void SpiFlashErase | ( | void | ) |
int main | ( | void | ) |
Definition at line 257 of file isp2.c.
References _fileno(), _ioctl(), devDebug1, devUrom, EOF, fgetc(), fopen(), freopen(), NutRegisterDevice(), printf, putchar(), puts, SpiFlashEnable(), SpiFlashErase(), SpiFlashId(), SpiFlashWriteWord(), stdout, and UART_SETSPEED.