#include <avr/cpufunc.h>
+#include <avr/boot.h>
+
#include <string.h>
#define USBASP_FUNC_WRITEEEPROM 8
#define USBASP_FUNC_SETLONGADDRESS 9
+// additional USBasp Commands
+#define USBASP_FUNC_SETISPSCK 10
+#define USBASP_FUNC_TPI_CONNECT 11
+#define USBASP_FUNC_TPI_DISCONNECT 12
+#define USBASP_FUNC_TPI_RAWREAD 13
+#define USBASP_FUNC_TPI_RAWWRITE 14
+#define USBASP_FUNC_TPI_READBLOCK 15
+#define USBASP_FUNC_TPI_WRITEBLOCK 16
+#define USBASP_FUNC_GETCAPABILITIES 127
/* ------------------------------------------------------------------------ */
#ifndef ulong
0x1e, 0x94, 0x06, 0
#elif defined (__AVR_ATmega328P__)
0x1e, 0x95, 0x0f, 0
+#elif defined (__AVR_ATmega1284P__)
+ 0x1e, 0x97, 0x05, 0
#else
# error "Device signature is not known, please edit main.c!"
#endif
}
replyBuffer[3] = rval;
len = 4;
- }else if(rq->bRequest == USBASP_FUNC_ENABLEPROG){
+ }else if((rq->bRequest == USBASP_FUNC_ENABLEPROG) || (rq->bRequest == USBASP_FUNC_SETISPSCK)){
/* replyBuffer[0] = 0; is never touched and thus always 0 which means success */
len = 1;
}else if(rq->bRequest >= USBASP_FUNC_READFLASH && rq->bRequest <= USBASP_FUNC_SETLONGADDRESS){