#include <stdlib.h>
#include <string.h>
#include "board.h"
#include "gpio.h"
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "ctrl_access.h"
#include "conf_access.h"
#include "navigation.h"
#include "tracedump.h"
#include "shell.h"
#include "fscmds.h"
#include "supervisor.h"
#include "mmi.h"
#include "dip204.h"
#include "spi.h"
#include "cptime.h"
Macros | |
#define | ATMEL_BANNER " ATMEL AVR32 UC3 " |
#define | DATE_LINE LINE_1 |
#define | LINE_1 0x01 |
#define | LINE_2 0x02 |
#define | LINE_3 0x03 |
#define | LINE_4 0x04 |
#define | MMI_IDLE_MENU_MAX_ITEM 6 |
#define | MMI_LINE_LENGTH 20 |
#define | MMI_NB_LINE 4 |
#define | MMI_QUEUE_SIZE MMI_NB_LINE |
#define | MMI_SPACE 0x20 |
#define | MMI_USB_CONNECTED 0xB7 |
#define | MMI_USB_DEVICE_MENU_MAX_ITEM 1 |
#define | MMI_USB_HOST_MENU_MAX_ITEM 4 |
#define | MMI_WAIT_MENU_MAX_ITEM 1 |
#define | PARAM_LINE LINE_2 |
#define | USER_MENU_LINE LINE_3 |
#define | USER_MESS_LINE LINE_4 |
Typedefs | |
typedef bool(* | pfUserAction )(void) |
Functions | |
bool | b_MMI_do_nothing (void) |
function to do nothing upon user action More... | |
static bool | b_mmi_format_a (void) |
Format the a drive. More... | |
static bool | b_mmi_format_b (void) |
Format the b drive. More... | |
static bool | b_mmi_mkdir_aLOG (void) |
Create the /LOG directory under a. More... | |
static bool | b_mmi_mkdir_bLOG (void) |
Create the /LOG directory under b. More... | |
bool | bMMI_start (void) |
Init MMI, for Man to Machine Interface management. More... | |
static void | prvMMI_Init (void) |
MMI function for initialisation. More... | |
void | vMMI_DisplayDateAndTime (portCHAR *pcDateTime) |
display Date in Date space More... | |
void | vMMI_DisplayIP (portCHAR *IPAddress) |
display IP in Param space More... | |
void | vMMI_DisplayUSBState (bool bConnected) |
display USB connection status. More... | |
void | vMMI_Manage (void) |
MMI function for Man to Machine Interface management. More... | |
void | vMMI_SetUserMenuMode (eUserMenu UserMenu, bool ResetCurrentState) |
set MMI current Menu More... | |
void | vMMI_UserMenuDisplay (portCHAR *Message) |
display message in User Menu space More... | |
void | vMMI_UserMenuDisplayNextItem (bool UnderIT) |
display next screen in User Menu space More... | |
void | vMMI_UserMenuDisplayPreviousItem (bool UnderIT) |
display previous screen in User Menu space More... | |
void | vMMI_UserMenuValidateItem (bool UnderIT) |
Validate the current item in User Menu. More... | |
void | vMMI_UserMessDisplay (portCHAR *Message) |
display message in User Mess space More... | |
Variables | |
portCHAR | cMMI_SubMenu_CurrentItem = 0 |
portCHAR * | DateScreen = Line[DATE_LINE - 1] |
eUserMenu | eCurrentUserMenu = eUserMenuIdle |
portCHAR | Line [MMI_NB_LINE][MMI_LINE_LENGTH+1] |
const portCHAR *const | MMI_IdleActingMenu [MMI_IDLE_MENU_MAX_ITEM] |
const portCHAR *const | MMI_IdleMenu [MMI_IDLE_MENU_MAX_ITEM] |
portCHAR * | ParamScreen = Line[PARAM_LINE - 1] |
const signed portCHAR *const | pcStringLogDirectoryNameA |
const signed portCHAR *const | pcStringLogDirectoryNameB |
const signed portCHAR *const | pcStringLogDirName = (signed portCHAR *)"LOG" |
static char | pcTempoDate [17] |
pfUserAction const | pfIdleUserAction [MMI_IDLE_MENU_MAX_ITEM] |
signed short | sMmiNavId |
portCHAR * | UserMenuScreen = Line[USER_MENU_LINE - 1] |
portCHAR * | UserMessScreen = Line[USER_MESS_LINE - 1] |
static xQueueHandle | xMMIQueue = 0 |
xQueueHandle | xSUPERVISORQueue |
#define ATMEL_BANNER " ATMEL AVR32 UC3 " |
Banner for ATMEL product
Referenced by bMMI_start().
#define DATE_LINE LINE_1 |
Link date line to the first one
Referenced by vMMI_Manage().
#define LINE_1 0x01 |
this is the first line
#define LINE_2 0x02 |
this is the second line
#define LINE_3 0x03 |
this is the third line
#define LINE_4 0x04 |
this is the fourth line
#define MMI_IDLE_MENU_MAX_ITEM 6 |
number of items in Idle Menu
Referenced by vMMI_UserMenuDisplayNextItem().
#define MMI_LINE_LENGTH 20 |
number of chars per line
Referenced by bMMI_start(), vMMI_DisplayIP(), vMMI_DisplayUSBState(), vMMI_UserMenuDisplay(), and vMMI_UserMessDisplay().
#define MMI_NB_LINE 4 |
number of lines on display
Referenced by bMMI_start().
#define MMI_QUEUE_SIZE MMI_NB_LINE |
definition of the MMI queue size
Referenced by bMMI_start().
#define MMI_SPACE 0x20 |
define the White space char
Referenced by bMMI_start(), vMMI_DisplayIP(), vMMI_DisplayUSBState(), vMMI_UserMenuDisplay(), and vMMI_UserMessDisplay().
#define MMI_USB_CONNECTED 0xB7 |
define the char used upon USB connection
Referenced by vMMI_DisplayUSBState().
#define MMI_USB_DEVICE_MENU_MAX_ITEM 1 |
number of items in USB Device Menu
Referenced by vMMI_UserMenuDisplayNextItem().
#define MMI_USB_HOST_MENU_MAX_ITEM 4 |
number of items in USB host Menu
Referenced by vMMI_UserMenuDisplayNextItem().
#define MMI_WAIT_MENU_MAX_ITEM 1 |
number of items in Waiting-for-host Menu
#define PARAM_LINE LINE_2 |
Link param line to the second one
Referenced by vMMI_Manage().
#define USER_MENU_LINE LINE_3 |
Link User Menu line to the third one
Referenced by vMMI_Manage().
#define USER_MESS_LINE LINE_4 |
Link User Mess line to the fourth one
Referenced by vMMI_Manage().
typedef bool(* pfUserAction)(void) |
definition of the User action function pointer
bool b_MMI_do_nothing | ( | void | ) |
function to do nothing upon user action
Function to do nothing
References NAKED_TRACE_COM2, and pdTRUE.
|
static |
Format the a drive.
References e_fscmds_format(), eUserMenuIdle, eUserMenuIdleActing, FSCMDS_STATUS_OK, LUN_ID_AT45DBX_MEM, pdFALSE, pdTRUE, sMmiNavId, vMMI_SetUserMenuMode(), and vTaskDelay().
|
static |
Format the b drive.
References e_fscmds_format(), eUserMenuIdle, eUserMenuIdleActing, FSCMDS_STATUS_OK, LUN_ID_SD_MMC_SPI_MEM, pdFALSE, pdTRUE, sMmiNavId, vMMI_SetUserMenuMode(), and vTaskDelay().
|
static |
Create the /LOG directory under a.
References e_fscmds_shell_mkdir(), eUserMenuIdle, eUserMenuIdleActing, FS_DATE_LAST_WRITE, LUN_ID_AT45DBX_MEM, nav_drive_set(), nav_file_dateset(), nav_partition_mount(), nav_select(), NULL, pcStringLogDirName, pcTempoDate, pdFALSE, pdTRUE, SHELL_EXECSTATUS_OK, sMmiNavId, SYS_MODID_MMI, v_cptime_GetDateInFatStringFormat(), vMMI_SetUserMenuMode(), and vTaskDelay().
|
static |
Create the /LOG directory under b.
References e_fscmds_shell_mkdir(), eUserMenuIdle, eUserMenuIdleActing, FS_DATE_LAST_WRITE, LUN_ID_SD_MMC_SPI_MEM, nav_drive_set(), nav_file_dateset(), nav_partition_mount(), nav_select(), NULL, pcStringLogDirName, pcTempoDate, pdFALSE, pdTRUE, SHELL_EXECSTATUS_OK, sMmiNavId, SYS_MODID_MMI, v_cptime_GetDateInFatStringFormat(), vMMI_SetUserMenuMode(), and vTaskDelay().
bool bMMI_start | ( | void | ) |
Init MMI, for Man to Machine Interface management.
References ATMEL_BANNER, eUserMenuIdle, i, Line, MMI_LINE_LENGTH, MMI_NB_LINE, MMI_QUEUE_SIZE, MMI_SPACE, pdFALSE, pdTRUE, prvMMI_Init(), vMMI_SetUserMenuMode(), vMMI_UserMessDisplay(), and xQueueCreate().
Referenced by portTASK_FUNCTION().
|
static |
MMI function for initialisation.
References backlight_PWM, CP_PBA_SPEED, dip204_hide_cursor(), dip204_init(), DIP204_SPI, DIP204_SPI_MISO_FUNCTION, DIP204_SPI_MISO_PIN, DIP204_SPI_MOSI_FUNCTION, DIP204_SPI_MOSI_PIN, DIP204_SPI_NPCS, DIP204_SPI_NPCS_FUNCTION, DIP204_SPI_NPCS_PIN, DIP204_SPI_SCK_FUNCTION, DIP204_SPI_SCK_PIN, gpio_enable_module(), gpio_enable_module_pin(), spi_options_t::reg, spi_enable(), spi_initMaster(), spi_selectionMode(), and spi_setupChipReg().
Referenced by bMMI_start().
void vMMI_DisplayDateAndTime | ( | portCHAR * | pcDateTime | ) |
display Date in Date space
pcDateTime | Input. date to display |
References DateScreen, and xQueueSend.
Referenced by portTASK_FUNCTION().
void vMMI_DisplayIP | ( | portCHAR * | IPAddress | ) |
display IP in Param space
IPAddress | Input. IP to display |
References i, MMI_LINE_LENGTH, MMI_SPACE, ParamScreen, UserMenuScreen, and xQueueSend.
Referenced by prvEthernetConfigureInterface().
void vMMI_DisplayUSBState | ( | bool | bConnected | ) |
display USB connection status.
bConnected | Input. USB connection status. |
References MMI_LINE_LENGTH, MMI_SPACE, MMI_USB_CONNECTED, ParamScreen, pdTRUE, and xQueueSend.
Referenced by portTASK_FUNCTION().
void vMMI_Manage | ( | void | ) |
MMI function for Man to Machine Interface management.
References DATE_LINE, DateScreen, dip204_set_cursor_position(), dip204_write_string(), Line, PARAM_LINE, ParamScreen, pdTRUE, USER_MENU_LINE, USER_MESS_LINE, UserMenuScreen, UserMessScreen, and xQueueReceive.
Referenced by portTASK_FUNCTION().
set MMI current Menu
UserMenu | Input. User Menu to handle |
ResetCurrentState | Input. pdFALSE if no need to reset MMI current screen number |
References cMMI_SubMenu_CurrentItem, eCurrentUserMenu, eUserMenuIdle, eUserMenuIdleActing, eUserMenuUSBDevice, eUserMenuUSBHost, eUserMenuUSBHostActing, eUserMenuWaitHost, MMI_IdleActingMenu, MMI_IdleMenu, UserMenuScreen, and xQueueSend.
Referenced by b_mmi_format_a(), b_mmi_format_b(), b_mmi_mkdir_aLOG(), b_mmi_mkdir_bLOG(), bMMI_start(), e_supervisor_switch_to_maintenance_mode(), portTASK_FUNCTION(), and x_supervisor_SemaphoreGive().
void vMMI_UserMenuDisplay | ( | portCHAR * | Message | ) |
display message in User Menu space
Message | Input. Message to display |
References eCurrentUserMenu, eUserMenuIdle, i, MMI_LINE_LENGTH, MMI_SPACE, UserMenuScreen, and xQueueSend.
void vMMI_UserMenuDisplayNextItem | ( | bool | UnderIT | ) |
display next screen in User Menu space
UnderIT | Input. True if calling from IT |
References cMMI_SubMenu_CurrentItem, eCurrentUserMenu, eUserMenuIdle, eUserMenuUSBDevice, eUserMenuUSBHost, Min, MMI_IDLE_MENU_MAX_ITEM, MMI_IdleMenu, MMI_USB_DEVICE_MENU_MAX_ITEM, MMI_USB_HOST_MENU_MAX_ITEM, pdFALSE, portENTER_CRITICAL, portEXIT_CRITICAL, UserMenuScreen, xQueueSend, and xQueueSendFromISR.
Referenced by prvjoystick_ISR_NonNakedBehaviour().
void vMMI_UserMenuDisplayPreviousItem | ( | bool | UnderIT | ) |
display previous screen in User Menu space
UnderIT | Input. True if calling from IT |
References cMMI_SubMenu_CurrentItem, eCurrentUserMenu, eUserMenuIdle, eUserMenuUSBDevice, eUserMenuUSBHost, Max, MMI_IdleMenu, pdFALSE, portENTER_CRITICAL, portEXIT_CRITICAL, UserMenuScreen, xQueueSend, and xQueueSendFromISR.
Referenced by prvjoystick_ISR_NonNakedBehaviour().
void vMMI_UserMenuValidateItem | ( | bool | UnderIT | ) |
Validate the current item in User Menu.
UnderIT | Input. True if calling from IT |
References cMMI_SubMenu_CurrentItem, eCurrentUserMenu, eUserMenuIdle, eUserMenuUSBDevice, eUserMenuUSBHost, eUserMenuWaitHost, pdFALSE, pfIdleUserAction, portENTER_CRITICAL, portEXIT_CRITICAL, xQueueSend, and xQueueSendFromISR.
Referenced by prvjoystick_ISR_NonNakedBehaviour().
void vMMI_UserMessDisplay | ( | portCHAR * | Message | ) |
display message in User Mess space
Message | Input. Message to display |
References i, MMI_LINE_LENGTH, MMI_SPACE, UserMessScreen, and xQueueSend.
Referenced by bMMI_start(), and e_lcd_set_value().
portCHAR cMMI_SubMenu_CurrentItem = 0 |
current item in user menu
Referenced by vMMI_SetUserMenuMode(), vMMI_UserMenuDisplayNextItem(), vMMI_UserMenuDisplayPreviousItem(), and vMMI_UserMenuValidateItem().
pointer to the memory image of the date line
Referenced by vMMI_DisplayDateAndTime(), and vMMI_Manage().
eUserMenu eCurrentUserMenu = eUserMenuIdle |
current MMI user menu to handle
Referenced by vMMI_SetUserMenuMode(), vMMI_UserMenuDisplay(), vMMI_UserMenuDisplayNextItem(), vMMI_UserMenuDisplayPreviousItem(), and vMMI_UserMenuValidateItem().
portCHAR Line[MMI_NB_LINE][MMI_LINE_LENGTH+1] |
memory image of the display
const portCHAR* const MMI_IdleActingMenu[MMI_IDLE_MENU_MAX_ITEM] |
lines to display in Idle menu when an action is performed.
Referenced by vMMI_SetUserMenuMode().
const portCHAR* const MMI_IdleMenu[MMI_IDLE_MENU_MAX_ITEM] |
lines to display in Idle menu
Referenced by vMMI_SetUserMenuMode(), vMMI_UserMenuDisplayNextItem(), and vMMI_UserMenuDisplayPreviousItem().
portCHAR* ParamScreen = Line[PARAM_LINE - 1] |
pointer to the memory image of the param line
Referenced by vMMI_DisplayIP(), vMMI_DisplayUSBState(), and vMMI_Manage().
const signed portCHAR* const pcStringLogDirectoryNameA |
The <drive letter>:/LOG strings.
"\<drive letter>:/LOG" strings.
Referenced by b_datalog_set_current_log_drive_toDF(), and bdatalog_start().
const signed portCHAR* const pcStringLogDirectoryNameB |
Referenced by b_datalog_set_current_log_drive_toSDMMC().
const signed portCHAR* const pcStringLogDirName = (signed portCHAR *)"LOG" |
The "LOG" string.
Referenced by b_mmi_mkdir_aLOG(), and b_mmi_mkdir_bLOG().
|
static |
Temporary array to set the creation date of the LOG directory.
Referenced by b_mmi_mkdir_aLOG(), and b_mmi_mkdir_bLOG().
pfUserAction const pfIdleUserAction[MMI_IDLE_MENU_MAX_ITEM] |
functions to call in Idle menu
Referenced by vMMI_UserMenuValidateItem().
signed short sMmiNavId |
MMI navigator ID.
Referenced by b_mmi_format_a(), b_mmi_format_b(), b_mmi_mkdir_aLOG(), b_mmi_mkdir_bLOG(), and portTASK_FUNCTION().
portCHAR* UserMenuScreen = Line[USER_MENU_LINE - 1] |
pointer to the memory image of the User Menu line
Referenced by vMMI_DisplayIP(), vMMI_Manage(), vMMI_SetUserMenuMode(), vMMI_UserMenuDisplay(), vMMI_UserMenuDisplayNextItem(), and vMMI_UserMenuDisplayPreviousItem().
portCHAR* UserMessScreen = Line[USER_MESS_LINE - 1] |
pointer to the memory image of the User Mess line
|
static |
The handle of the queue of MMI.
xQueueHandle xSUPERVISORQueue |
The handle of the queue of SUPERVISOR.