/*
 * Copyright 2022-2024, Digi International Inc.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
class CCIMX8MMINI extends ConnectCoreDevice {

    // Public constants.
    static DEVICE_TYPE = "ccimx8mm-dvk";
    static PLATFORM_NAME = "ConnectCore 8M-Mini DVK";

    // Variables.
    BOARD_IMAGE = "ccimx8mm-dvk_board.png";
    BOARD_IMAGE_SCALE = 85;

    CPU_COMPONENT_VISIBLE = true;
    CPU_COMPONENT_HAS_PANEL = true;
    CPU_COMPONENT_HAS_ARROW = true;
    CPU_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    CPU_COMPONENT_PANEL_ORIENTATION = VALUE_TOP;
    CPU_COMPONENT_PANEL_HORIZONTAL_PERCENT = 28.5;
    CPU_COMPONENT_PANEL_VERTICAL_PERCENT = 57;
    CPU_COMPONENT_ARROW_PERCENT = 33.5;
    CPU_COMPONENT_AREA_TOP_PERCENT = 45.7;
    CPU_COMPONENT_AREA_LEFT_PERCENT = 32.4;
    CPU_COMPONENT_AREA_WIDTH_PERCENT = 5.7;
    CPU_COMPONENT_AREA_HEIGHT_PERCENT = 9;

    MEMORY_COMPONENT_VISIBLE = true;
    MEMORY_COMPONENT_HAS_PANEL = true; 
    MEMORY_COMPONENT_HAS_ARROW = true;
    MEMORY_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    MEMORY_COMPONENT_PANEL_ORIENTATION = VALUE_BOTTOM;
    MEMORY_COMPONENT_PANEL_HORIZONTAL_PERCENT = 22;
    MEMORY_COMPONENT_PANEL_VERTICAL_PERCENT = 65;
    MEMORY_COMPONENT_ARROW_PERCENT = 33.7;
    MEMORY_COMPONENT_AREA_TOP_PERCENT = 37;
    MEMORY_COMPONENT_AREA_LEFT_PERCENT = 32.4;
    MEMORY_COMPONENT_AREA_WIDTH_PERCENT = 6;
    MEMORY_COMPONENT_AREA_HEIGHT_PERCENT = 7;

    WIFI_BT_COMPONENT_VISIBLE = true;
    WIFI_BT_COMPONENT_HAS_PANEL = true; 
    WIFI_BT_COMPONENT_HAS_ARROW = true;
    WIFI_BT_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    WIFI_BT_COMPONENT_PANEL_ORIENTATION = VALUE_RIGHT;
    WIFI_BT_COMPONENT_PANEL_HORIZONTAL_PERCENT = 73;
    WIFI_BT_COMPONENT_PANEL_VERTICAL_PERCENT = 38;
    WIFI_BT_COMPONENT_ARROW_PERCENT = 46;
    WIFI_BT_COMPONENT_AREA_TOP_PERCENT = 46.5;
    WIFI_BT_COMPONENT_AREA_LEFT_PERCENT = 28.3;
    WIFI_BT_COMPONENT_AREA_WIDTH_PERCENT = 4;
    WIFI_BT_COMPONENT_AREA_HEIGHT_PERCENT = 6;

    ETHERNET0_COMPONENT_VISIBLE = true;
    ETHERNET0_COMPONENT_HAS_PANEL = true;
    ETHERNET0_COMPONENT_HAS_ARROW = true;
    ETHERNET0_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    ETHERNET0_COMPONENT_PANEL_ORIENTATION = VALUE_LEFT;
    ETHERNET0_COMPONENT_PANEL_HORIZONTAL_PERCENT = 21;
    ETHERNET0_COMPONENT_PANEL_VERTICAL_PERCENT = 70;
    ETHERNET0_COMPONENT_ARROW_PERCENT = 78;
    ETHERNET0_COMPONENT_AREA_TOP_PERCENT = 77;
    ETHERNET0_COMPONENT_AREA_LEFT_PERCENT = 11;
    ETHERNET0_COMPONENT_AREA_WIDTH_PERCENT = 8.5;
    ETHERNET0_COMPONENT_AREA_HEIGHT_PERCENT = 16;

    CONSOLE_COMPONENT_VISIBLE = true;
    CONSOLE_COMPONENT_HAS_PANEL = false; 
    CONSOLE_COMPONENT_HAS_ARROW = false;
    CONSOLE_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    CONSOLE_COMPONENT_AREA_TOP_PERCENT = 6.5;
    CONSOLE_COMPONENT_AREA_LEFT_PERCENT = 26.5;
    CONSOLE_COMPONENT_AREA_WIDTH_PERCENT = 3.4;
    CONSOLE_COMPONENT_AREA_HEIGHT_PERCENT = 4.5;

    VIDEO_COMPONENT_VISIBLE = true;
    VIDEO_COMPONENT_HAS_PANEL = true; 
    VIDEO_COMPONENT_HAS_ARROW = true;
    VIDEO_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    VIDEO_COMPONENT_PANEL_ORIENTATION = VALUE_BOTTOM;
    VIDEO_COMPONENT_PANEL_HORIZONTAL_PERCENT = 47.5;
    VIDEO_COMPONENT_PANEL_VERTICAL_PERCENT = 18;
    VIDEO_COMPONENT_ARROW_PERCENT = 58.5;
    VIDEO_COMPONENT_AREA_TOP_PERCENT = 84;
    VIDEO_COMPONENT_AREA_LEFT_PERCENT = 57;
    VIDEO_COMPONENT_AREA_WIDTH_PERCENT = 6;
    VIDEO_COMPONENT_AREA_HEIGHT_PERCENT = 8;

    AUDIO_COMPONENT_VISIBLE = true;
    AUDIO_COMPONENT_HAS_PANEL = true; 
    AUDIO_COMPONENT_HAS_ARROW = true;
    AUDIO_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    AUDIO_COMPONENT_PANEL_ORIENTATION = VALUE_TOP;
    AUDIO_COMPONENT_PANEL_HORIZONTAL_PERCENT = 1;
    AUDIO_COMPONENT_PANEL_VERTICAL_PERCENT = 19;
    AUDIO_COMPONENT_ARROW_PERCENT = 16;
    AUDIO_COMPONENT_AREA_TOP_PERCENT = 7;
    AUDIO_COMPONENT_AREA_LEFT_PERCENT = 14.5;
    AUDIO_COMPONENT_AREA_WIDTH_PERCENT = 5.4;
    AUDIO_COMPONENT_AREA_HEIGHT_PERCENT = 11;

    LED_COMPONENT_VISIBLE = true;
    LED_COMPONENT_HAS_PANEL = true; 
    LED_COMPONENT_HAS_ARROW = false;
    LED_COMPONENT_PANEL_ALWAYS_VISIBLE = true;
    LED_COMPONENT_PANEL_ORIENTATION = VALUE_TOP;
    LED_COMPONENT_PANEL_HORIZONTAL_PERCENT = 61;
    LED_COMPONENT_PANEL_VERTICAL_PERCENT = 14;
    LED_COMPONENT_AREA_TOP_PERCENT = 8.5;
    LED_COMPONENT_AREA_LEFT_PERCENT = 62.6;
    LED_COMPONENT_AREA_WIDTH_PERCENT = 1.5;
    LED_COMPONENT_AREA_HEIGHT_PERCENT = 4;

    FLASH_MEMORY_COMPONENT_VISIBLE = true;
    FLASH_MEMORY_COMPONENT_HAS_PANEL = true;
    FLASH_MEMORY_COMPONENT_HAS_ARROW = true;
    FLASH_MEMORY_COMPONENT_PANEL_ALWAYS_VISIBLE = false;
    FLASH_MEMORY_COMPONENT_PANEL_ORIENTATION = VALUE_LEFT;
    FLASH_MEMORY_COMPONENT_PANEL_HORIZONTAL_PERCENT = 45;
    FLASH_MEMORY_COMPONENT_PANEL_VERTICAL_PERCENT = 36;
    FLASH_MEMORY_COMPONENT_ARROW_PERCENT = 38;
    FLASH_MEMORY_COMPONENT_AREA_TOP_PERCENT = 36.3;
    FLASH_MEMORY_COMPONENT_AREA_LEFT_PERCENT = 38.8;
    FLASH_MEMORY_COMPONENT_AREA_WIDTH_PERCENT = 5.4;
    FLASH_MEMORY_COMPONENT_AREA_HEIGHT_PERCENT = 8;


    // Capabilities
    SUPPORTS_VIDEO_BRIGHTNESS = false;
    SUPPORTS_NUM_ETHERNET = 1;

    // Misc info
    PCB_COLOR = ID_COLOR_BLUE;

    // Constructor.
    constructor(deviceData) {
        super(CCIMX8MMINI.DEVICE_TYPE, CCIMX8MMINI.PLATFORM_NAME, deviceData);
    }
}
