00001 /*This file has been prepared for Doxygen automatic documentation generation.*/ 00019 /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 00020 * 00021 * Redistribution and use in source and binary forms, with or without 00022 * modification, are permitted provided that the following conditions are met: 00023 * 00024 * 1. Redistributions of source code must retain the above copyright notice, this 00025 * list of conditions and the following disclaimer. 00026 * 00027 * 2. Redistributions in binary form must reproduce the above copyright notice, 00028 * this list of conditions and the following disclaimer in the documentation 00029 * and/or other materials provided with the distribution. 00030 * 00031 * 3. The name of Atmel may not be used to endorse or promote products derived 00032 * from this software without specific prior written permission. 00033 * 00034 * 4. This software may only be redistributed and used in connection with an Atmel 00035 * AVR product. 00036 * 00037 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 00038 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 00039 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 00040 * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 00041 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 00042 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00043 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 00044 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 00045 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00046 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 00047 * 00048 */ 00049 00050 #ifndef __SUPERVISOR_H__ 00051 #define __SUPERVISOR_H__ 00052 00053 #include "FreeRTOS.h" 00054 #include "semphr.h" 00055 #include "conf_usb.h" 00056 00060 typedef enum 00061 { 00062 SYS_STATUS_STARTUP, // The module is being created. 00063 SYS_STATUS_RUNNING, // The module is up & running. 00064 SYS_STATUS_DOWN // The module is not running. 00065 } eStatus; 00066 00067 00071 typedef enum 00072 { 00073 SYS_MODID_NONE = -1, // No specific module 00074 SYS_MODID_COM1SHELL = 1, // The COM1SHELL module. 00075 SYS_MODID_HTTP = 2, // The HTTP module. 00076 SYS_MODID_USB = 4, // The USB module. 00077 SYS_MODID_MMI = 8 // The MMI module. 00078 } eModId; 00079 00080 00082 #define SYS_NB_MOD 4 00083 00084 00085 //_____ D E C L A R A T I O N S ____________________________________________ 00086 00092 void vSupervisor_Start( unsigned portBASE_TYPE uxPriority ); 00093 00101 portBASE_TYPE x_supervisor_SemaphoreTake( xSemaphoreHandle xSemaphore,portTickType xBlockTime ); 00102 00103 00110 portBASE_TYPE x_supervisor_SemaphoreGive( xSemaphoreHandle xSemaphore ); 00111 00112 00116 void v_supervisor_Host_Connects( void ); 00117 00121 void v_supervisor_Host_Disconnects( void ); 00122 00126 void v_supervisor_Device_Connects( void ); 00127 00131 void v_supervisor_Device_Disconnects( void ); 00132 00133 00134 #ifdef USB_ENABLE 00135 Bool b_USBHostCopyLogs( void ); 00136 Bool b_USBHostMoveLogs( void ); 00137 Bool b_USBHostCopyWeb( void ); 00138 Bool b_USBHostCopyCfg( void ); 00139 00140 #ifdef USB_DEVICE_FEATURE 00141 #if USB_DEVICE_FEATURE == ENABLED 00142 Bool b_supervisor_switch_to_maintenance_mode( void ); 00146 Bool b_supervisor_leave_waitingforhost_mode( void ); 00147 00148 00153 Bool b_supervisor_leave_UsbMassStorage_mode( void ); 00154 00160 Bool b_supervisor_IsInMaintenanceMode( void ); 00161 00162 #endif 00163 #endif 00164 00165 #endif 00166 00167 #if configCTRLPANEL_TRACE == 1 00168 00171 void v_supervisor_trace( void ); 00172 #endif 00173 00174 /*############################# TEMPORARY ###############################*/ 00175 00193 /* eExecStatus e_supervisor_switch_to_maintenance_mode( eModId xModId, 00194 signed short FsNavId, 00195 int ac, signed portCHAR *av[], 00196 signed portCHAR **ppcStringReply ); 00197 */ 00198 /*#######################################################################*/ 00199 00200 #endif