Statistics
| Branch: | Tag: | Revision:

root / LUFA / Drivers / Misc / AT45DB642D.h @ 978b99e5

History | View | Annotate | Download (4.59 KB)

1
/*
2
             LUFA Library
3
     Copyright (C) Dean Camera, 2011.
4

5
  dean [at] fourwalledcubicle [dot] com
6
           www.lufa-lib.org
7
*/
8

    
9
/*
10
  Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com)
11

12
  Permission to use, copy, modify, distribute, and sell this
13
  software and its documentation for any purpose is hereby granted
14
  without fee, provided that the above copyright notice appear in
15
  all copies and that both that the copyright notice and this
16
  permission notice and warranty disclaimer appear in supporting
17
  documentation, and that the name of the author not be used in
18
  advertising or publicity pertaining to distribution of the
19
  software without specific, written prior permission.
20

21
  The author disclaim all warranties with regard to this
22
  software, including all implied warranties of merchantability
23
  and fitness.  In no event shall the author be liable for any
24
  special, indirect or consequential damages or any damages
25
  whatsoever resulting from loss of use, data or profits, whether
26
  in an action of contract, negligence or other tortious action,
27
  arising out of or in connection with the use or performance of
28
  this software.
29
*/
30

    
31
/** \file
32
 *  \brief Command constants for the Atmel AT45DB642D Dataflash.
33
 *  \copydetails Group_AT45DB642D
34
 */
35

    
36
/** \ingroup Group_MiscDrivers
37
 *  \defgroup Group_AT45DB642D Atmel AT45DB642D Dataflash Commands
38
 *  \brief Command constants for the Atmel AT45DB642D Dataflash.
39
 *
40
 *  Dataflash command constants for the Atmel AT45DB642D Dataflash IC.
41
 *
42
 *  @{
43
 */
44

    
45
#ifndef __AT45DB642D_CMDS_H__
46
#define __AT45DB642D_CMDS_H__
47

    
48
        /* Public Interface - May be used in end-application: */
49
                /* Macros: */
50
                        /** \name Dataflash Status Values */
51
                        //@{
52
                        #define DF_STATUS_READY                         (1 << 7)
53
                        #define DF_STATUS_COMPMISMATCH                  (1 << 6)
54
                        #define DF_STATUS_SECTORPROTECTION_ON           (1 << 1)
55
                        #define DF_STATUS_BINARYPAGESIZE_ON             (1 << 0)
56
                        //@}
57

    
58
                        /** \name Dataflash Commands */
59
                        //@{
60
                        #define DF_CMD_GETSTATUS                        0xD7
61
                        #define DF_CMD_POWERDOWN                        0xB9
62
                        #define DF_CMD_WAKEUP                           0xAB
63

    
64
                        #define DF_CMD_MAINMEMTOBUFF1                   0x53
65
                        #define DF_CMD_MAINMEMTOBUFF2                   0x55
66
                        #define DF_CMD_MAINMEMTOBUFF1COMP               0x60
67
                        #define DF_CMD_MAINMEMTOBUFF2COMP               0x61
68
                        #define DF_CMD_AUTOREWRITEBUFF1                 0x58
69
                        #define DF_CMD_AUTOREWRITEBUFF2                 0x59
70

    
71
                        #define DF_CMD_MAINMEMPAGEREAD                  0xD2
72
                        #define DF_CMD_CONTARRAYREAD_LF                 0x03
73
                        #define DF_CMD_BUFF1READ_LF                     0xD1
74
                        #define DF_CMD_BUFF2READ_LF                     0xD3
75

    
76
                        #define DF_CMD_BUFF1WRITE                       0x84
77
                        #define DF_CMD_BUFF2WRITE                       0x87
78
                        #define DF_CMD_BUFF1TOMAINMEMWITHERASE          0x83
79
                        #define DF_CMD_BUFF2TOMAINMEMWITHERASE          0x86
80
                        #define DF_CMD_BUFF1TOMAINMEM                   0x88
81
                        #define DF_CMD_BUFF2TOMAINMEM                   0x89
82
                        #define DF_CMD_MAINMEMPAGETHROUGHBUFF1          0x82
83
                        #define DF_CMD_MAINMEMPAGETHROUGHBUFF2          0x85
84

    
85
                        #define DF_CMD_PAGEERASE                        0x81
86
                        #define DF_CMD_BLOCKERASE                       0x50
87
                        #define DF_CMD_SECTORERASE                      0x7C
88

    
89
                        #define DF_CMD_CHIPERASE                        ((char[]){0xC7, 0x94, 0x80, 0x9A})
90
                        #define DF_CMD_CHIPERASE_BYTE1                  0xC7
91
                        #define DF_CMD_CHIPERASE_BYTE2                  0x94
92
                        #define DF_CMD_CHIPERASE_BYTE3                  0x80
93
                        #define DF_CMD_CHIPERASE_BYTE4                  0x9A
94

    
95
                        #define DF_CMD_SECTORPROTECTIONOFF              ((char[]){0x3D, 0x2A, 0x7F, 0x9A})
96
                        #define DF_CMD_SECTORPROTECTIONOFF_BYTE1        0x3D
97
                        #define DF_CMD_SECTORPROTECTIONOFF_BYTE2        0x2A
98
                        #define DF_CMD_SECTORPROTECTIONOFF_BYTE3        0x7F
99
                        #define DF_CMD_SECTORPROTECTIONOFF_BYTE4        0x9A
100

    
101
                        #define DF_CMD_BINARYPAGESIZEMODEON             ((char[]){0x3D, 0x2A, 0x80, 0xA6})
102
                        #define DF_CMD_BINARYPAGESIZEMODEON_BYTE1       0x3D
103
                        #define DF_CMD_BINARYPAGESIZEMODEON_BYTE2       0x2A
104
                        #define DF_CMD_BINARYPAGESIZEMODEON_BYTE3       0x80
105
                        #define DF_CMD_BINARYPAGESIZEMODEON_BYTE4       0xA6
106

    
107
                        #define DF_CMD_READMANUFACTURERDEVICEINFO       0x9F
108
                        //@}
109

    
110
                        /** Manufacturer code for Atmel Corporation, returned by Atmel Dataflash ICs in response to the \c DF_CMD_READMANUFACTURERDEVICEINFO command. */
111
                        #define DF_MANUFACTURER_ATMEL                   0x1F
112

    
113
#endif
114

    
115
/** @} */
116