2 * isp.h - part of USBasp
4 * Autor..........: Thomas Fischl <tfischl@gmx.de>
5 * Description....: Provides functions for communication/programming
7 * Licence........: GNU GPL v2 (see Readme.txt)
8 * Creation Date..: 2005-02-23
9 * Last change....: 2009-02-28
12 #ifndef __isp_h_included__
13 #define __isp_h_included__
16 #define uchar unsigned char
27 /* Prepare connection to target device */
30 /* Close connection to target device */
33 /* read an write a byte from isp using software (slow) */
34 uchar
ispTransmit_sw(uchar send_byte
);
36 /* read an write a byte from isp using hardware (fast) */
37 uchar
ispTransmit_hw(uchar send_byte
);
39 /* enter programming mode */
40 uchar
ispEnterProgrammingMode();
42 /* read byte from eeprom at given address */
43 uchar
ispReadEEPROM(unsigned int address
);
45 /* write byte to flash at given address */
46 uchar
ispWriteFlash(unsigned long address
, uchar data
, uchar pollmode
);
48 uchar
ispFlushPage(unsigned long address
, uchar pollvalue
);
50 /* read byte from flash at given address */
51 uchar
ispReadFlash(unsigned long address
);
53 /* write byte to eeprom at given address */
54 uchar
ispWriteEEPROM(unsigned int address
, uchar data
);
56 /* pointer to sw or hw transmit function */
57 uchar (*ispTransmit
)(uchar
);
59 /* set SCK speed. call before ispConnect! */
60 void ispSetSCKOption(uchar sckoption
);
62 #endif /* __isp_h_included__ */