#ifndef prog_h #define prog_h /* prog.h */ /* binwatch - Tiny binary wristwatch. {{{ * * Copyright (C) 2010 Nicolas Schodet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * 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. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * Contact : * Web: http://ni.fr.eu.org/ * Email: * }}} */ #include "io.h" /** Size of the hole flash. */ #define PROG_FLASH_SIZE (FLASHEND + 1) /** Size of a single flash page. */ #define PROG_PAGE_SIZE SPM_PAGESIZE /** Number of fuse bytes. */ #define PROG_FUSE_NB 3 /** Read from flash. */ void prog_read (uint16_t address, uint8_t *buffer, uint8_t length); /** Write a full page to flash. */ uint8_t prog_page_write (uint16_t address, const uint8_t *buffer); /** Read lfuse, hfuse and efuse. */ void prog_read_fuses (uint8_t *buffer); /** Start application, never returns. */ void prog_start (void); #endif /* prog_h */