Glitch app is in progress, first support will be for AVR.
[goodfet] / firmware / include / avr.h
1 /*! \file avr.h
2   \author Travis Goodspeed
3   \brief AVR SPI Programmer
4 */
5
6 #include "spi.h"
7
8 //! Setup the AVR pins.
9 void avrsetup();
10
11 //! Initialized an attached AVR.
12 void avrconnect();
13
14 //! Enable AVR programming mode.
15 void avr_prgen();
16 //! Read AVR device code.
17 u8 avr_sig(u8 i);
18 //! Erase an AVR device
19 void avr_erase();
20 //! Read lock bits.
21 u8 avr_lockbits();
22 //! Read a byte of Flash
23 u8 avr_peekflash(u16 adr);
24
25 //! Read a byte of EEPROM.
26 u8 avr_peekeeprom(u16 adr);
27 //! Read a byte of EEPROM.
28 u8 avr_pokeeeprom(u16 adr, u8 val);
29
30 //! Is the AVR ready or busy?
31 u8 avr_isready();
32
33 //Command codes.
34 //! Performa  chip erase.
35 #define AVR_ERASE 0xF0
36 //! Fetch RDY/!BSY byte.
37 #define AVR_RDYBSY 0xF1
38
39 //! Read Program Memory
40 #define AVR_PEEKPGM 0x80
41 //! Read EEPROM
42 #define AVR_PEEKEEPROM 0x81
43 //! Write EEPROM
44 #define AVR_POKEEEPROM 0x91
45 //! Read lock bits.
46 #define AVR_PEEKLOCK 0x82
47 //! Read signature.
48 #define AVR_PEEKSIG 0x83
49 //! Read fuse bits.
50 #define AVR_READFUSES 0x84
51 //! Read calibration byte.
52 #define AVR_READCAL 0x85