X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=firmware%2Finclude%2Favr.h;h=bcf76ef7573042faf5663fb2337411a8760af4f2;hb=0c53a410a2d82927261d39e74cd98ecc6b6eebf1;hp=cd19a38a7d59e8a40149bd7a5f91675a85756456;hpb=43d125b5bca16f0941450bee6ba7bd94ab41dc72;p=goodfet diff --git a/firmware/include/avr.h b/firmware/include/avr.h index cd19a38..bcf76ef 100644 --- a/firmware/include/avr.h +++ b/firmware/include/avr.h @@ -3,7 +3,13 @@ \brief AVR SPI Programmer */ +#ifndef AVR_H +#define AVR_H + #include "spi.h" +#include "app.h" + +#define AVR 0x32 //! Setup the AVR pins. void avrsetup(); @@ -19,6 +25,9 @@ u8 avr_sig(u8 i); void avr_erase(); //! Read lock bits. u8 avr_lockbits(); +//! Write lock bits. +void avr_setlock(u8 bits); + //! Read a byte of Flash u8 avr_peekflash(u16 adr); @@ -31,7 +40,7 @@ u8 avr_pokeeeprom(u16 adr, u8 val); u8 avr_isready(); //Command codes. -//! Performa chip erase. +//! Perform a chip erase. #define AVR_ERASE 0xF0 //! Fetch RDY/!BSY byte. #define AVR_RDYBSY 0xF1 @@ -44,9 +53,17 @@ u8 avr_isready(); #define AVR_POKEEEPROM 0x91 //! Read lock bits. #define AVR_PEEKLOCK 0x82 +//! Write lock its. +#define AVR_POKELOCK 0x92 //! Read signature. #define AVR_PEEKSIG 0x83 //! Read fuse bits. #define AVR_READFUSES 0x84 //! Read calibration byte. #define AVR_READCAL 0x85 +//! Bulk load data +#define AVR_BULKLOAD 0x86 + +extern app_t const avr_app; + +#endif // AVR_H