Control Panel main file.
Copyright (c) 2009-2018 Microchip Technology Inc. and its subsidiaries.
#include <string.h>
#include "pm.h"
#include "flashc.h"
#include "gpio.h"
#include "spi.h"
#include "ctrl_access.h"
#include "fsaccess.h"
#include "FreeRTOS.h"
#include "task.h"
#include "serial.h"
#include "navigation.h"
#include "supervisor.h"
#include "shell.h"
#include "cptime.h"
#include "conf_ctrlpanel.h"
#include "conf_at45dbx.h"
#include "conf_sd_mmc_spi.h"
Macros | |
#define | AT45DBX_ENABLE_NPCS_PIN(NPCS, unused) {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION}, |
#define | mainSUPERVISOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) |
Init the microcontroller & the board shared resources. More... | |
Functions | |
int | main (void) |
1) Initialize the microcontroller and the shared hardware resources of the board. More... | |
static void | prv_at45dbx_resources_init (void) |
Initialize AT45DBX resources: GPIO, SPI and AT45DBX. More... | |
static void | prv_clk_gen_start (void) |
static void | prv_sd_mmc_resources_init (void) |
Initializes SD/MMC resources: GPIO, SPI and SD/MMC. More... | |
void | vApplicationStackOverflowHook (xTaskHandle *pxTask, signed portCHAR *pcTaskName) |
Variables | |
const char *const | pcCtrlPanelVersion = "GCC "__VERSION__" "__DATE__" "__TIME__" ATMEL_CONTROLPANEL_AVR32_UC3_10400"CRLF |
#define AT45DBX_ENABLE_NPCS_PIN | ( | NPCS, | |
unused | |||
) | {AT45DBX_SPI_NPCS##NPCS##_PIN, AT45DBX_SPI_NPCS##NPCS##_FUNCTION}, |
Referenced by prv_at45dbx_resources_init().
#define mainSUPERVISOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) |
Init the microcontroller & the board shared resources.
Launch the Control Panel main modules. Start FreeRTOS.Scheduler include files. Demo file headers. Priority definitions for the supervisor task.
Referenced by main().
main | ( | void | ) |
1) Initialize the microcontroller and the shared hardware resources of the board.
2) Launch the Ctrl Panel modules. 3) Start FreeRTOS.
References b_fsaccess_init(), ctrl_access_init(), CTRL_GOOD, FOSC0, LED0, LED1, LED2, LED3, LED4, LED5, LED6, LED7, LED_Off(), LUN_ID_AT45DBX_MEM, mainSUPERVISOR_TASK_PRIORITY, mem_test_unit_ready(), OSC0_STARTUP, pm_switch_to_osc0(), prv_at45dbx_resources_init(), prv_clk_gen_start(), prv_sd_mmc_resources_init(), v_cptime_Init(), vSupervisor_Start(), and vTaskStartScheduler().
Initialize AT45DBX resources: GPIO, SPI and AT45DBX.
References AT45DBX_ENABLE_NPCS_PIN, at45dbx_init(), AT45DBX_MEM_CNT, AT45DBX_SPI, AT45DBX_SPI_BITS, AT45DBX_SPI_FIRST_NPCS, AT45DBX_SPI_MASTER_SPEED, AT45DBX_SPI_MISO_FUNCTION, AT45DBX_SPI_MISO_PIN, AT45DBX_SPI_MOSI_FUNCTION, AT45DBX_SPI_MOSI_PIN, AT45DBX_SPI_SCK_FUNCTION, AT45DBX_SPI_SCK_PIN, CP_PBA_SPEED, gpio_enable_module(), MREPEAT(), spi_options_t::reg, spi_enable(), spi_initMaster(), spi_is_enabled(), and spi_selectionMode().
Referenced by main().
Start the generation of a 48-MHz clock for the USB
USB
MACB
Reduce speed Bus.
References flashc_set_wait_state(), pm_cksel(), pm_gc_enable(), pm_gc_setup(), pm_pll_enable(), pm_pll_set_option(), pm_pll_setup(), pm_switch_to_clock(), pm_wait_for_pll0_locked(), and pm_wait_for_pll1_locked().
Referenced by main().
Initializes SD/MMC resources: GPIO, SPI and SD/MMC.
References CP_PBA_SPEED, gpio_enable_module(), spi_options_t::reg, SD_MMC_SPI, SD_MMC_SPI_BITS, sd_mmc_spi_init(), SD_MMC_SPI_MASTER_SPEED, SD_MMC_SPI_MISO_FUNCTION, SD_MMC_SPI_MISO_PIN, SD_MMC_SPI_MOSI_FUNCTION, SD_MMC_SPI_MOSI_PIN, SD_MMC_SPI_NPCS, SD_MMC_SPI_NPCS_FUNCTION, SD_MMC_SPI_NPCS_PIN, SD_MMC_SPI_SCK_FUNCTION, SD_MMC_SPI_SCK_PIN, spi_enable(), spi_initMaster(), spi_is_enabled(), and spi_selectionMode().
Referenced by main().
void vApplicationStackOverflowHook | ( | xTaskHandle * | pxTask, |
signed portCHAR * | pcTaskName | ||
) |
const char* const pcCtrlPanelVersion = "GCC "__VERSION__" "__DATE__" "__TIME__" ATMEL_CONTROLPANEL_AVR32_UC3_10400"CRLF |
The Ctrl Panel sw version.
Referenced by e_syscmds_version().