Microchip® Advanced Software Framework

main.c File Reference

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},
#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.
Returns
Should never occur.
Note

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().

static void prv_clk_gen_start ( void  )
static

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().

void vApplicationStackOverflowHook ( xTaskHandle pxTask,
signed portCHAR *  pcTaskName 
)

References LED0, LED1, LED2, LED3, LED4, LED5, LED6, LED7, LED_On(), and LED_Toggle().

const char* const pcCtrlPanelVersion = "GCC "__VERSION__" "__DATE__" "__TIME__" ATMEL_CONTROLPANEL_AVR32_UC3_10400"CRLF

The Ctrl Panel sw version.

Referenced by e_syscmds_version().