altos/telefireone-v1.0: Track ao_led_init API change
[fw/altos] / src / drivers / ao_at45db161d.h
1 /*
2  * Copyright © 2010 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18
19 /* Defines for the Atmel AT45DB161D 16Mbit SPI Bus DataFlash® */
20
21 #ifndef _AT45DB161D_H_
22 #define _AT45DB161D_H_
23
24 /*
25  * We reserve the last block on the device for
26  * configuration space. Writes and reads in this
27  * area return errors.
28  */
29
30
31 #define FLASH_READ              0x03
32 #define FLASH_WRITE             0x82
33 #define FLASH_PAGE_ERASE        0x81
34 #define FLASH_READ_STATUS       0xd7
35 #define FLASH_SET_CONFIG        0x3d
36
37 #define FLASH_SET_512_BYTE_0    0x2a
38 #define FLASH_SET_512_BYTE_1    0x80
39 #define FLASH_SET_512_BYTE_2    0xa6
40
41 #define FLASH_STATUS_RDY                (1 << 7)
42 #define FLASH_STATUS_COMP               (1 << 6)
43 #define FLASH_STATUS_PROTECT            (1 << 1)
44 #define FLASH_STATUS_PAGESIZE_512       (1 << 0)
45
46 #endif /* _AT45DB161D_H_ */