/* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. See the file COPYING * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Copyright (C) 2010 Frank van Maarseveen */ #ifndef _SPM_H_ #define _SPM_H_ #include #include "types.h" /* * These describe the program flash organization of the target (Attiny85): */ #define PAGE_SHIFT 6 #define PAGE_SIZE (1 << PAGE_SHIFT) #define NPAGES 128 /* * packet layout */ struct spm { uint8_t syn; uint8_t pageno; uint8_t npages; uint8_t data[PAGE_SIZE]; uint8_t crc[2]; }; bool_t spm_setup(struct spm *spm); void spm_program(struct spm *spm); bool_t spm_complete(void); #endif