whitespace.
[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
23
24 //! Read a byte of EEPROM.
25 u8 avr_peekeeprom(u16 adr);
26 //! Read a byte of EEPROM.
27 u8 avr_pokeeeprom(u16 adr, u8 val);
28
29 //! Is the AVR ready or busy?
30 u8 avr_isready();
31
32 //Command codes.
33 //! Performa  chip erase.
34 #define AVR_ERASE 0xF0
35 //! Fetch RDY/!BSY byte.
36 #define AVR_RDYBSY 0xF1
37
38 //! Read Program Memory
39 #define AVR_PEEKPGM 0x80
40 //! Read EEPROM
41 #define AVR_PEEKEEPROM 0x81
42 //! Write EEPROM
43 #define AVR_POKEEEPROM 0x91
44 //! Read lock bits.
45 #define AVR_PEEKLOCK 0x82
46 //! Read signature.
47 #define AVR_PEEKSIG 0x83
48 //! Read fuse bits.
49 #define AVR_READFUSES 0x84
50 //! Read calibration byte.
51 #define AVR_READCAL 0x85