75cd5043db3a9eb88495e7ac83452dade7d18a04
[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_devicecode();
18
19
20 //Command codes.
21 //! Performa  chip erase.
22 #define AVR_ERASE 0xF0
23 //! Fetch RDY/!BSY byte.
24 #define AVR_RDYBSY 0xF1
25
26 //! Read Program Memory
27 #define AVR_PEEKPGM 0x80
28 //! Read EEPROM
29 #define AVR_PEEKEEPROM 0x81
30 //! Read lock bits.
31 #define AVR_PEEKLOCK 0x82
32 //! Read signature.
33 #define AVR_PEEKSIG 0x83
34 //! Read fuse bits.
35 #define AVR_READFUSES 0x84
36 //! Read calibration byte.
37 #define AVR_READCAL 0x85