00001 /* ---------------------------------------------------------------------------- */ 00002 /* Atmel Microcontroller Software Support */ 00003 /* SAM Software Package License */ 00004 /* ---------------------------------------------------------------------------- */ 00005 /* Copyright (c) 2015, Atmel Corporation */ 00006 /* */ 00007 /* All rights reserved. */ 00008 /* */ 00009 /* Redistribution and use in source and binary forms, with or without */ 00010 /* modification, are permitted provided that the following condition is met: */ 00011 /* */ 00012 /* - Redistributions of source code must retain the above copyright notice, */ 00013 /* this list of conditions and the disclaimer below. */ 00014 /* */ 00015 /* Atmel's name may not be used to endorse or promote products derived from */ 00016 /* this software without specific prior written permission. */ 00017 /* */ 00018 /* DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR */ 00019 /* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF */ 00020 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE */ 00021 /* DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT, */ 00022 /* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT */ 00023 /* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */ 00024 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF */ 00025 /* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */ 00026 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, */ 00027 /* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ 00028 /* ---------------------------------------------------------------------------- */ 00029 00030 /** 00031 * \page loader Loader Example 00032 * 00033 * \section Purpose 00034 * 00035 * The Loader example shows how to detect a specified condition and then execute 00036 * the embedded applications. 00037 * 00038 * \section Requirements 00039 * 00040 * This package can be used with SAMV71 Xplained Ultra board or SAME70 Xplained board. 00041 * 00042 * 00043 * \section Description 00044 * 00045 * In the demonstration two apps are used, one is "fft_demo", and another is 00046 * "usb_video". To run the demonstration properly the apps should be flashed 00047 * into the embedded flash in advance. 00048 * 00049 * The demonstration program detects whether or not an Image sensor is mounted 00050 * on the board then to execute the UVC (usb_video) example or the FFT example. 00051 * 00052 * For UVC example an image sensor (OV2643/OV5640/OV7740/OV9740) should be used. 00053 * 00054 * \section Usage 00055 * 00056 * -# Build the program and download it inside the board. 00057 * Please refer to the Getting Started with SAM V71/E70 Microcontrollers.pdf 00058 * -# On the computer, open and configure a terminal application 00059 * (e.g. HyperTerminal on Microsoft Windows) with these settings: 00060 * - 115200 baud rate 00061 * - 8 bits of data 00062 * - No parity 00063 * - 1 stop bit 00064 * - No flow control 00065 * -# Start the application. 00066 * -# The following text should appear (values depend on the board and chip used): 00067 * \code 00068 * -- Loader Example xxx -- 00069 * -- xxxxxx-xx 00070 * -- Compiled: xxx xx xxxx xx:xx:xx -- 00071 * \endcode 00072 * -# Execution of the UVC or FFT example. 00073 * 00074 * \section References 00075 * - loader/main.c 00076 * - loader/loader.c 00077 * - loader/loader.h 00078 * - trace.h 00079 */ 00080 00081 /** \file 00082 * 00083 * This file contains all the specific code for the loader example. 00084 * 00085 */ 00086 00087 /*---------------------------------------------------------------------------- 00088 * Headers 00089 *----------------------------------------------------------------------------*/ 00090 00091 #include "board.h" 00092 #include "loader.h" 00093 00094 /*---------------------------------------------------------------------------- 00095 * Local definitions 00096 *----------------------------------------------------------------------------*/ 00097 #define LOCATION_USB_VIDEO 0x00420000 00098 #define LOCATION_FFT_DEMO 0x00440000 00099 00100 00101 /*---------------------------------------------------------------------------- 00102 * External functions 00103 *----------------------------------------------------------------------------*/ 00104 uint32_t UVC_preCondition(void); 00105 00106 /*---------------------------------------------------------------------------- 00107 * Local variables 00108 *----------------------------------------------------------------------------*/ 00109 static AppConfig appConfig[] = { 00110 { 00111 UVC_preCondition, 00112 LOCATION_USB_VIDEO, 00113 (char *)"USB video: UVC example with OV7740 or OV9740 modules.\n\r" 00114 }, 00115 { 00116 NULL, 00117 LOCATION_FFT_DEMO, 00118 (char *)"FFT demo: The example demonstrates complex FFT of 22.05K signals." 00119 } 00120 }; 00121 00122 /*---------------------------------------------------------------------------- 00123 * Exported functions 00124 *----------------------------------------------------------------------------*/ 00125 /** 00126 * \brief getting-started Application entry point. 00127 * 00128 * \return Unused (ANSI-C compatibility). 00129 */ 00130 extern int main( void ) 00131 { 00132 /* Output example information */ 00133 printf("\n\r-- Loader Example %s --\n\r", SOFTPACK_VERSION); 00134 printf("-- %s\n\r", BOARD_NAME); 00135 printf("-- Compiled: %s %s With %s--\n\r", __DATE__, __TIME__ , COMPILER_NAME); 00136 00137 LOADER_AppSwitch(appConfig, sizeof(appConfig)/sizeof(appConfig[0])); 00138 00139 return 0; 00140 }