source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/MEMORY/DATA_FLASH/AT45DBX/at45dbx_mem.h @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 3 years ago

Adding new version

File size: 4.8 KB
Line 
1/* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */
2
3/*This file is prepared for Doxygen automatic documentation generation.*/
4/*! \file *********************************************************************
5 *
6 * \brief CTRL_ACCESS interface for the AT45DBX data flash controller.
7 *
8 * - Compiler:           IAR EWAVR32 and GNU GCC for AVR32
9 * - Supported devices:  All AVR32 devices with an SPI module can be used.
10 * - AppNote:
11 *
12 * \author               Atmel Corporation: http://www.atmel.com \n
13 *                       Support and FAQ: http://support.atmel.no/
14 *
15 ******************************************************************************/
16
17/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
18 *
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions are met:
21 *
22 * 1. Redistributions of source code must retain the above copyright notice, this
23 * list of conditions and the following disclaimer.
24 *
25 * 2. Redistributions in binary form must reproduce the above copyright notice,
26 * this list of conditions and the following disclaimer in the documentation
27 * and/or other materials provided with the distribution.
28 *
29 * 3. The name of Atmel may not be used to endorse or promote products derived
30 * from this software without specific prior written permission.
31 *
32 * 4. This software may only be redistributed and used in connection with an Atmel
33 * AVR product.
34 *
35 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
36 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
37 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
38 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
39 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
40 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
41 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
42 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
43 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
44 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
45 *
46 */
47
48#ifndef _AT45DBX_MEM_H_
49#define _AT45DBX_MEM_H_
50
51
52#include "conf_access.h"
53
54#if AT45DBX_MEM == DISABLE
55  #error at45dbx_mem.h is #included although AT45DBX_MEM is disabled
56#endif
57
58
59#include "ctrl_access.h"
60
61
62//_____ D E C L A R A T I O N S ____________________________________________
63
64/*! \name Control Interface
65 */
66//! @{
67
68/*! \brief Tests the memory state and initializes the memory if required.
69 *
70 * The TEST UNIT READY SCSI primary command allows an application client to poll
71 * a LUN until it is ready without having to allocate memory for returned data.
72 *
73 * This command may be used to check the media status of LUNs with removable
74 * media.
75 *
76 * \return Status.
77 */
78extern Ctrl_status at45dbx_test_unit_ready(void);
79
80/*! \brief Returns the address of the last valid sector in the memory.
81 *
82 * \param u32_nb_sector Pointer to the address of the last valid sector.
83 *
84 * \return Status.
85 */
86extern Ctrl_status at45dbx_read_capacity(U32 *u32_nb_sector);
87
88/*! \brief Returns the write-protection state of the memory.
89 *
90 * \return \c TRUE if the memory is write-protected, else \c FALSE.
91 *
92 * \note Only used by removable memories with hardware-specific write
93 *       protection.
94 */
95extern Bool at45dbx_wr_protect(void);
96
97/*! \brief Tells whether the memory is removable.
98 *
99 * \return \c TRUE if the memory is removable, else \c FALSE.
100 */
101extern Bool at45dbx_removal(void);
102
103//! @}
104
105
106#if ACCESS_USB == ENABLED
107
108/*! \name MEM <-> USB Interface
109 */
110//! @{
111
112/*! \brief Tranfers data from the memory to USB.
113 *
114 * \param addr      Address of first memory sector to read.
115 * \param nb_sector Number of sectors to transfer.
116 *
117 * \return Status.
118 */
119extern Ctrl_status at45dbx_usb_read_10(U32 addr, U16 nb_sector);
120
121/*! \brief Tranfers data from USB to the memory.
122 *
123 * \param addr      Address of first memory sector to write.
124 * \param nb_sector Number of sectors to transfer.
125 *
126 * \return Status.
127 */
128extern Ctrl_status at45dbx_usb_write_10(U32 addr, U16 nb_sector);
129
130//! @}
131
132#endif
133
134
135#if ACCESS_MEM_TO_RAM == ENABLED
136
137/*! \name MEM <-> RAM Interface
138 */
139//! @{
140
141/*! \brief Copies 1 data sector from the memory to RAM.
142 *
143 * \param addr  Address of first memory sector to read.
144 * \param ram   Pointer to RAM buffer to write.
145 *
146 * \return Status.
147 */
148extern Ctrl_status at45dbx_df_2_ram(U32 addr, void *ram);
149
150/*! \brief Copies 1 data sector from RAM to the memory.
151 *
152 * \param addr  Address of first memory sector to write.
153 * \param ram   Pointer to RAM buffer to read.
154 *
155 * \return Status.
156 */
157extern Ctrl_status at45dbx_ram_2_df(U32 addr, const void *ram);
158
159//! @}
160
161#endif
162
163
164#endif  // _AT45DBX_MEM_H_
Note: See TracBrowser for help on using the repository browser.