SAMV71 Xplained Ultra Software Package 1.3

conf_access.h

00001 /*****************************************************************************
00002  *
00003  * \file
00004  *
00005  * \brief Memory access control configuration file.
00006  *
00007  * This file contains the possible external configuration of the memory access
00008  * control.
00009  *
00010  * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved.
00011  *
00012  * \asf_license_start
00013  *
00014  * \page License
00015  *
00016  * Redistribution and use in source and binary forms, with or without
00017  * modification, are permitted provided that the following conditions are met:
00018  *
00019  * 1. Redistributions of source code must retain the above copyright notice,
00020  *    this list of conditions and the following disclaimer.
00021  *
00022  * 2. Redistributions in binary form must reproduce the above copyright notice,
00023  *    this list of conditions and the following disclaimer in the documentation
00024  *    and/or other materials provided with the distribution.
00025  *
00026  * 3. The name of Atmel may not be used to endorse or promote products derived
00027  *    from this software without specific prior written permission.
00028  *
00029  * 4. This software may only be redistributed and used in connection with an
00030  *    Atmel microcontroller product.
00031  *
00032  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
00033  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00034  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
00035  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
00036  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00037  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00038  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00039  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
00040  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00041  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00042  * POSSIBILITY OF SUCH DAMAGE.
00043  *
00044  * \asf_license_stop
00045  *
00046  ******************************************************************************/
00047 /*
00048  * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
00049  */
00050 
00051 
00052  //! Configuration of ctrl_access which is an abstraction layer for memory interfaces (common/services/storage/ctrl_access)
00053 
00054 #ifndef _CONF_ACCESS_H_
00055 #define _CONF_ACCESS_H_
00056 
00057 #include "compiler.h"
00058 #include "board.h"
00059 
00060 
00061 /*! \name Activation of Logical Unit Numbers
00062  */
00063 //! @{
00064 #ifdef VIRTUAL_MEMORY_ENABLE
00065 #define LUN_0                ENABLE   //!< Enable On-Chip Virtual Memory.
00066 #else
00067 #define LUN_0                DISABLE  //!< Disable On-Chip Virtual Memory.
00068 #endif
00069 
00070 #ifdef AT45DBX_ENABLE
00071 #define LUN_1                ENABLE   //!< Enable AT45DBX Data Flash.
00072 #else
00073 #define LUN_1                DISABLE  //!< Disable AT45DBX Data Flash.
00074 #endif
00075 
00076 //! New setting for SD/MMC stack in common folder
00077 #ifdef SD_MMC_ENABLE
00078 #define LUN_2                ENABLE   //!< Enable common SD/MMC stack
00079 #define LUN_3                ENABLE
00080 #else
00081 #define LUN_2                DISABLE  //!< Disable common SD/MMC stack
00082 #define LUN_3                DISABLE
00083 #endif
00084 
00085 //! Old setting for SD/MMC stack in AVR folder
00086 #ifdef SD_MMC_SPI_ENABLE
00087 #define LUN_4                ENABLE   //!< Enable SD/MMC Card over SPI or SPI.
00088 #else
00089 #define LUN_4                DISABLE  //!< Disable SD/MMC Card over SPI or SPI.
00090 #endif
00091 
00092 //! Old setting for SD/MMC stack in AVR folder
00093 #ifdef SD_MMC_MCI_ENABLE
00094 #define LUN_5                ENABLE   //!< Enable SD/MMC Card over MCI or MCI.
00095 #else
00096 #define LUN_5                DISABLE  //!< Disable SD/MMC Card over MCI or MCI.
00097 #endif
00098 
00099 #define LUN_6                DISABLE
00100 #define LUN_7                DISABLE
00101 
00102 #ifdef USB_MASS_STORAGE_ENABLE
00103 #define LUN_USB              ENABLE   //!< Enable Host Mass-Storage Memory.
00104 #else
00105 #define LUN_USB              DISABLE  //!< Disable Host Mass-Storage Memory.
00106 #endif
00107 
00108 //! @}
00109 
00110 /*! \name LUN 0 Definitions
00111  */
00112 //! @{
00113 #define VIRTUAL_MEM                             LUN_0
00114 #define LUN_ID_VIRTUAL_MEM                      LUN_ID_0
00115 #define LUN_0_INCLUDE                           "virtual_mem.h"
00116 #define Lun_0_test_unit_ready                   virtual_test_unit_ready
00117 #define Lun_0_read_capacity                     virtual_read_capacity
00118 #define Lun_0_unload                            NULL /* Can not be unloaded */
00119 #define Lun_0_wr_protect                        virtual_wr_protect
00120 #define Lun_0_removal                           virtual_removal
00121 #define Lun_0_usb_read_10                       virtual_usb_read_10
00122 #define Lun_0_usb_write_10                      virtual_usb_write_10
00123 #define Lun_0_mem_2_ram                         virtual_mem_2_ram
00124 #define Lun_0_ram_2_mem                         virtual_ram_2_mem
00125 #define LUN_0_NAME                              "\"On-Chip Virtual Memory\""
00126 //! @}
00127 
00128 /*! \name LUN 1 Definitions
00129  */
00130 //! @{
00131 #define AT45DBX_MEM                             LUN_1
00132 #define LUN_ID_AT45DBX_MEM                      LUN_ID_1
00133 #define LUN_1_INCLUDE                           "at45dbx_mem.h"
00134 #define Lun_1_test_unit_ready                   at45dbx_test_unit_ready
00135 #define Lun_1_read_capacity                     at45dbx_read_capacity
00136 #define Lun_1_unload                            NULL /* Can not be unloaded */
00137 #define Lun_1_wr_protect                        at45dbx_wr_protect
00138 #define Lun_1_removal                           at45dbx_removal
00139 #define Lun_1_usb_read_10                       at45dbx_usb_read_10
00140 #define Lun_1_usb_write_10                      at45dbx_usb_write_10
00141 #define Lun_1_mem_2_ram                         at45dbx_df_2_ram
00142 #define Lun_1_ram_2_mem                         at45dbx_ram_2_df
00143 #define LUN_1_NAME                              "\"AT45DBX Data Flash\""
00144 //! @}
00145 
00146 /*! \name LUN 2 Definitions
00147  */
00148 //! @{
00149 #define SD_MMC_0_MEM                            LUN_2
00150 #define LUN_ID_SD_MMC_0_MEM                     LUN_ID_2
00151 #define LUN_2_INCLUDE                           "sd_mmc_mem.h"
00152 #define Lun_2_test_unit_ready                   sd_mmc_test_unit_ready_0
00153 #define Lun_2_read_capacity                     sd_mmc_read_capacity_0
00154 #define Lun_2_unload                            sd_mmc_unload_0
00155 #define Lun_2_wr_protect                        sd_mmc_wr_protect_0
00156 #define Lun_2_removal                           sd_mmc_removal_0
00157 #define Lun_2_usb_read_10                       sd_mmc_usb_read_10_0
00158 #define Lun_2_usb_write_10                      sd_mmc_usb_write_10_0
00159 #define Lun_2_mem_2_ram                         sd_mmc_mem_2_ram_0
00160 #define Lun_2_ram_2_mem                         sd_mmc_ram_2_mem_0
00161 #define LUN_2_NAME                              "\"SD/MMC Card Slot 0\""
00162 //! @}
00163 
00164 /*! \name LUN 3 Definitions
00165  */
00166 //! @{
00167 #define SD_MMC_1_MEM                            LUN_3
00168 #define LUN_ID_SD_MMC_1_MEM                     LUN_ID_3
00169 #define LUN_3_INCLUDE                           "sd_mmc_mem.h"
00170 #define Lun_3_test_unit_ready                   sd_mmc_test_unit_ready_1
00171 #define Lun_3_read_capacity                     sd_mmc_read_capacity_1
00172 #define Lun_3_unload                            sd_mmc_unload_1
00173 #define Lun_3_wr_protect                        sd_mmc_wr_protect_1
00174 #define Lun_3_removal                           sd_mmc_removal_1
00175 #define Lun_3_usb_read_10                       sd_mmc_usb_read_10_1
00176 #define Lun_3_usb_write_10                      sd_mmc_usb_write_10_1
00177 #define Lun_3_mem_2_ram                         sd_mmc_mem_2_ram_1
00178 #define Lun_3_ram_2_mem                         sd_mmc_ram_2_mem_1
00179 #define LUN_3_NAME                              "\"SD/MMC Card Slot 1\""
00180 //! @}
00181 
00182 /*! \name LUN 4 Definitions
00183  */
00184 //! @{
00185 #define SD_MMC_SPI_MEM                          LUN_4
00186 #define LUN_ID_SD_MMC_SPI_MEM                   LUN_ID_4
00187 #define LUN_4_INCLUDE                           "sd_mmc_spi_mem.h"
00188 #define Lun_4_test_unit_ready                   sd_mmc_spi_test_unit_ready
00189 #define Lun_4_read_capacity                     sd_mmc_spi_read_capacity
00190 #define Lun_4_unload                            NULL
00191 #define Lun_4_wr_protect                        sd_mmc_spi_wr_protect
00192 #define Lun_4_removal                           sd_mmc_spi_removal
00193 #define Lun_4_usb_read_10                       sd_mmc_spi_usb_read_10
00194 #define Lun_4_usb_write_10                      sd_mmc_spi_usb_write_10
00195 #define Lun_4_mem_2_ram                         sd_mmc_spi_mem_2_ram
00196 #define Lun_4_ram_2_mem                         sd_mmc_spi_ram_2_mem
00197 #define LUN_4_NAME                              "\"SD/MMC Card over SPI\""
00198 //! @}
00199 
00200 /*! \name LUN 5 Definitions
00201  */
00202 //! @{
00203 #define SD_MMC_MCI_0_MEM                        LUN_5
00204 #define LUN_ID_SD_MMC_MCI_0_MEM                 LUN_ID_5
00205 #define LUN_5_INCLUDE                           "sd_mmc_mci_mem.h"
00206 #define Lun_5_test_unit_ready                   sd_mmc_mci_test_unit_ready_0
00207 #define Lun_5_read_capacity                     sd_mmc_mci_read_capacity_0
00208 #define Lun_5_unload                            NULL
00209 #define Lun_5_wr_protect                        sd_mmc_mci_wr_protect_0
00210 #define Lun_5_removal                           sd_mmc_mci_removal_0
00211 #define Lun_5_usb_read_10                       sd_mmc_mci_usb_read_10_0
00212 #define Lun_5_usb_write_10                      sd_mmc_mci_usb_write_10_0
00213 #define Lun_5_mem_2_ram                         sd_mmc_mci_mem_2_ram_0
00214 #define Lun_5_ram_2_mem                         sd_mmc_mci_ram_2_mem_0
00215 #define LUN_5_NAME                              "\"SD/MMC Card over MCI Slot 0\""
00216 //! @}
00217 
00218 /*! \name USB LUNs Definitions
00219  */
00220 //! @{
00221 #define MEM_USB                                 LUN_USB
00222 #define LUN_ID_MEM_USB                          LUN_ID_USB
00223 #define LUN_USB_INCLUDE                         "uhi_msc_mem.h"
00224 #define Lun_usb_get_lun()                       uhi_msc_mem_get_lun()
00225 #define Lun_usb_test_unit_ready(lun)            uhi_msc_mem_test_unit_ready(lun)
00226 #define Lun_usb_read_capacity(lun, nb_sect)     uhi_msc_mem_read_capacity(lun, nb_sect)
00227 #define Lun_usb_read_sector_size(lun)           uhi_msc_mem_read_sector_size(lun)
00228 #define Lun_usb_wr_protect(lun)                 uhi_msc_mem_wr_protect(lun)
00229 #define Lun_usb_removal()                       uhi_msc_mem_removal()
00230 #define Lun_usb_mem_2_ram(addr, ram)            uhi_msc_mem_read_10_ram(addr, ram)
00231 #define Lun_usb_ram_2_mem(addr, ram)            uhi_msc_mem_write_10_ram(addr, ram)
00232 #define LUN_USB_NAME                            "\"Host Mass-Storage Memory\""
00233 //! @}
00234 
00235 /*! \name Actions Associated with Memory Accesses
00236  *
00237  * Write here the action to associate with each memory access.
00238  *
00239  * \warning Be careful not to waste time in order not to disturb the functions.
00240  */
00241 //! @{
00242 #define memory_start_read_action(nb_sectors)    ui_start_read()
00243 #define memory_stop_read_action()               ui_stop_read()
00244 #define memory_start_write_action(nb_sectors)   ui_start_write()
00245 #define memory_stop_write_action()              ui_stop_write()
00246 extern void ui_start_read(void);
00247 extern void ui_stop_read(void);
00248 extern void ui_start_write(void);
00249 extern void ui_stop_write(void);
00250 //! @}
00251 
00252 /*! \name Activation of Interface Features
00253  */
00254 //! @{
00255 #ifdef ACCESS_USB_ENABLED
00256 #define ACCESS_USB           true  //!< MEM <-> USB interface.
00257 #else
00258 #define ACCESS_USB           false //!< MEM <-> USB interface.
00259 #endif
00260 
00261 #ifdef ACCESS_MEM_TO_RAM_ENABLED
00262 #define ACCESS_MEM_TO_RAM    true  //!< MEM <-> RAM interface.
00263 #else
00264 #define ACCESS_MEM_TO_RAM    false //!< MEM <-> RAM interface.
00265 #endif
00266 
00267 #define ACCESS_STREAM        false //!< Streaming MEM <-> MEM interface.
00268 #define ACCESS_STREAM_RECORD false //!< Streaming MEM <-> MEM interface in record mode.
00269 #define ACCESS_MEM_TO_MEM    false //!< MEM <-> MEM interface.
00270 #define ACCESS_CODEC         false //!< Codec interface.
00271 //! @}
00272 
00273 /*! \name Specific Options for Access Control
00274  */
00275 //! @{
00276 #define GLOBAL_WR_PROTECT    false //!< Management of a global write protection.
00277 //! @}
00278 
00279 /*! \name Sector size option for different storage media.
00280  */
00281 //! @{
00282 #define SECTOR_SIZE  512
00283 //! @}
00284 
00285 #endif  // _CONF_ACCESS_H_
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines