diff options
Diffstat (limited to 'firmware/src/system_config')
11 files changed, 1829 insertions, 0 deletions
diff --git a/firmware/src/system_config/default/configuration.xml b/firmware/src/system_config/default/configuration.xml new file mode 100644 index 0000000..4606dcc --- /dev/null +++ b/firmware/src/system_config/default/configuration.xml @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<configuration version="1.0.6.12"> + <General> + <HarmonyPath path="../../../../opt/microchip/harmony/v1_06"/> + <ForceOptimization flag="false"/> + </General> + <Manifest> + <Files> + <File> + <Name>sys_devcon_cache_pic32mz.S</Name> + <Path>Source Files/framework/system/devcon/src</Path> + </File> + <File> + <Name>sys_module.h</Name> + <Path>Header Files/framework/system/common</Path> + </File> + <File> + <Name>sys_devcon.c</Name> + <Path>Source Files/framework/system/devcon/src</Path> + </File> + <File> + <Name>sys_devcon_cache.h</Name> + <Path>Header Files/framework/system/devcon</Path> + </File> + <File> + <Name>sys_common.h</Name> + <Path>Header Files/framework/system/common</Path> + </File> + <File> + <Name>sys_ports.h</Name> + <Path>Header Files/framework/system/ports</Path> + </File> + <File> + <Name>system.h</Name> + <Path>Header Files/framework/system</Path> + </File> + <File> + <Name>sys_ports.c</Name> + <Path>Source Files/framework/system/ports/src</Path> + </File> + <File> + <Name>sys_devcon.h</Name> + <Path>Header Files/framework/system/devcon</Path> + </File> + <File> + <Name>sys_devcon_pic32mz.c</Name> + <Path>Source Files/framework/system/devcon/src</Path> + </File> + </Files> + <Templates> + <Template> + <Name>main.c</Name> + <Path>Source Files/app</Path> + </Template> + <Template> + <Name>system_exceptions.c</Name> + <Path>Source Files/app/system_config/default</Path> + <Checksum>C111969CA43D6CEA1E9E33A6164E7AE0</Checksum> + </Template> + <Template> + <Name>app.c</Name> + <Path>Source Files/app</Path> + </Template> + <Template> + <Name>system_config.h</Name> + <Path>Header Files/app/system_config/default</Path> + <Checksum>AACDE55E44291B8ECCFF86EB2C6D3F1B</Checksum> + </Template> + <Template> + <Name>system_init.c</Name> + <Path>Source Files/app/system_config/default</Path> + <Checksum>A20E6051172F14BA64FD464630B2D979</Checksum> + </Template> + <Template> + <Name>system_interrupt.c</Name> + <Path>Source Files/app/system_config/default</Path> + <Checksum>9AC33B2960C8DF72C5EB0E3662303FF4</Checksum> + </Template> + <Template> + <Name>sys_ports_static.c</Name> + <Path>Source Files/app/system_config/default/framework/system/ports/src</Path> + <Checksum>5F2394E93856B6D50B7274ADB5A4FF75</Checksum> + </Template> + <Template> + <Name>sys_clk_static.h</Name> + <Path>Header Files/app/system_config/default/framework/system/clk</Path> + <Checksum>999179DADE9ECD59953526F5E9F83ACC</Checksum> + </Template> + <Template> + <Name>app.h</Name> + <Path>Header Files/app</Path> + </Template> + <Template> + <Name>sys_clk_static.c</Name> + <Path>Source Files/app/system_config/default/framework/system/clk/src</Path> + <Checksum>58CE0B253D4367C188EB62895C501C46</Checksum> + </Template> + <Template> + <Name>system_tasks.c</Name> + <Path>Source Files/app/system_config/default</Path> + <Checksum>BE644D0142ACA48D9CA2E6255A02CDBA</Checksum> + </Template> + <Template> + <Name>system_definitions.h</Name> + <Path>Header Files/app/system_config/default</Path> + <Checksum>08B5EB4F7D9B07DBF06AD124A3AC99C1</Checksum> + </Template> + </Templates> + <Libraries> + <Library value="../../../../../../opt/microchip/harmony/v1_06/bin/framework/peripheral/PIC32MZ2048ECG064_peripherals.a"/> + </Libraries> + </Manifest> +</configuration> diff --git a/firmware/src/system_config/default/default.mhc b/firmware/src/system_config/default/default.mhc new file mode 100644 index 0000000..94fdc77 --- /dev/null +++ b/firmware/src/system_config/default/default.mhc @@ -0,0 +1,433 @@ +# +# Configuration generated by Microchip Harmony Configurator (MHC) v1.0.6.12 +# Project name: PIC32MZ_harmony_tryout +# Configuration: default +# Device: PIC32MZ2048ECG064 +# Harmony version: 1.06 +# +# +# from $PROJECT_FIRMWARE_DIRECTORY/$PROJECT_NAME.hconfig +# +CONFIG_APP_INSTANCES=1 +# +# from $HARMONY_VERSION_PATH/utilities/mhc/config/app_name_idx.ftl +# +CONFIG_APP_MENU_IDX0=y +CONFIG_APP_NAME_0="app" +# +# from $PROJECT_FIRMWARE_DIRECTORY/$PROJECT_NAME.hconfig +# +CONFIG_USE_EXCEPTION_HANDLER=y +CONFIG_EXCEPTION_USE_SYS_DEBUG=y +CONFIG_EXCEPTION_BREAKPOINT=y +# +# from $HARMONY_VERSION_PATH/framework/bluetooth/config/bluetooth.hconfig +# +CONFIG_USE_BLUETOOTH_LIBRARIES=n +# +# from $HARMONY_VERSION_PATH/framework/bootloader/config/bootloader.hconfig +# +CONFIG_USE_BOOTLOADER=n +# +# from $HARMONY_VERSION_PATH/framework/crypto/config/crypto.hconfig +# +CONFIG_USE_CRYPTO_LIB=n +# +# from $HARMONY_VERSION_PATH/framework/driver/adc/config/drv_adc.hconfig +# +CONFIG_USE_DRV_ADC=n +# +# from $HARMONY_VERSION_PATH/framework/driver/camera/config/drv_camera.hconfig +# +CONFIG_USE_DRV_CAMERA=n +# +# from $HARMONY_VERSION_PATH/framework/driver/cmp/config/drv_cmp.hconfig +# +CONFIG_DRV_CVREF_ENABLE=n +CONFIG_USE_DRV_CMP=n +# +# from $HARMONY_VERSION_PATH/framework/driver/codec/config/drv_codec.hconfig +# +CONFIG_SELECT_DRV_AK4384=n +CONFIG_SELECT_DRV_AK4642=n +CONFIG_SELECT_DRV_AK4645=n +CONFIG_SELECT_DRV_AK4953=n +# +# from $HARMONY_VERSION_PATH/framework/driver/encx24j600/config/drv_encx24j600.hconfig +# +CONFIG_DRV_ENCX24J600_USE_DRIVER=n +# +# from $HARMONY_VERSION_PATH/framework/tcpip/config/tcpip_mac.hconfig +# +CONFIG_TCPIP_USE_ETH_MAC=n +# +# from $HARMONY_VERSION_PATH/framework/driver/gfx/controller/lcc/config/drv_gfx_lcc.hconfig +# +CONFIG_USE_DRV_GFX_LCC=n +# +# from $HARMONY_VERSION_PATH/framework/driver/gfx/controller/otm2201a/config/drv_gfx_otm2201a.hconfig +# +CONFIG_USE_DRV_GFX_OTM2201A=n +# +# from $HARMONY_VERSION_PATH/framework/driver/gfx/controller/ssd1926/config/drv_gfx_ssd1926.hconfig +# +CONFIG_USE_DRV_GFX_SSD1926=n +# +# from $HARMONY_VERSION_PATH/framework/driver/gfx/controller/ssd1289/config/drv_gfx_ssd1289.hconfig +# +CONFIG_USE_DRV_GFX_SSD1289=n +# +# from $HARMONY_VERSION_PATH/framework/driver/gfx/controller/s1d13517/config/drv_gfx_s1d13517.hconfig +# +CONFIG_USE_DRV_GFX_S1D13517=n +# +# from $HARMONY_VERSION_PATH/framework/driver/gfx/controller/tft002/config/drv_gfx_tft002.hconfig +# +CONFIG_USE_DRV_GFX_TFT002=n +# +# from $HARMONY_VERSION_PATH/framework/driver/gfx/display/config/drv_gfx_display.hconfig +# +CONFIG_USE_DRV_GFX_DISPLAY=n +# +# from $HARMONY_VERSION_PATH/framework/driver/i2c/config/drv_i2c.hconfig +# +CONFIG_USE_DRV_I2C=n +# +# from $HARMONY_VERSION_PATH/framework/driver/i2s/config/drv_i2s.hconfig +# +CONFIG_USE_DRV_I2S=n +# +# from $HARMONY_VERSION_PATH/framework/driver/ic/config/drv_ic.hconfig +# +CONFIG_USE_DRV_IC=n +# +# from $HARMONY_VERSION_PATH/framework/driver/nvm/config/drv_nvm.hconfig +# +CONFIG_USE_DRV_NVM=n +# +# from $HARMONY_VERSION_PATH/framework/driver/oc/config/drv_oc.hconfig +# +CONFIG_USE_DRV_OC=n +# +# from $HARMONY_VERSION_PATH/framework/driver/pmp/config/drv_pmp.hconfig +# +CONFIG_USE_DRV_PMP=n +# +# from $HARMONY_VERSION_PATH/framework/driver/rtcc/config/drv_rtcc.hconfig +# +CONFIG_USE_DRV_RTCC=n +# +# from $HARMONY_VERSION_PATH/framework/driver/sample/config/drv_sample.hconfig +# +CONFIG_USE_DRV_SAMPLE=n +# +# from $HARMONY_VERSION_PATH/framework/driver/sdcard/config/drv_sdcard.hconfig +# +CONFIG_USE_DRV_SDCARD=n +# +# from $HARMONY_VERSION_PATH/framework/driver/spi/config/drv_spi.hconfig +# +CONFIG_DRV_SPI_USE_DRIVER=n +# +# from $HARMONY_VERSION_PATH/framework/driver/sqi/config/drv_sqi.hconfig +# +CONFIG_DRV_SQI_USE_DRIVER=n +# +# from $HARMONY_VERSION_PATH/framework/driver/spi_flash/sst25vf016b/config/drv_sst25vf016b.hconfig +# +CONFIG_USE_DRV_SST25VF016B=n +# +# from $HARMONY_VERSION_PATH/framework/driver/spi_flash/sst25vf020b/config/drv_sst25vf020b.hconfig +# +CONFIG_USE_DRV_SST25VF020B=n +# +# from $HARMONY_VERSION_PATH/framework/driver/spi_flash/sst25vf064c/config/drv_sst25vf064c.hconfig +# +CONFIG_USE_DRV_SST25VF064C=n +# +# from $HARMONY_VERSION_PATH/framework/driver/tmr/config/drv_tmr.hconfig +# +CONFIG_USE_DRV_TMR=n +# +# from $HARMONY_VERSION_PATH/framework/driver/touch/adc10bit/config/drv_adc10bit.hconfig +# +CONFIG_USE_DRV_TOUCH_ADC10BIT=n +# +# from $HARMONY_VERSION_PATH/framework/driver/touch/ar1020/config/drv_ar1020.hconfig +# +CONFIG_USE_DRV_TOUCH_AR1020=n +# +# from $HARMONY_VERSION_PATH/framework/driver/touch/mtch6301/config/drv_mtch6301.hconfig +# +CONFIG_USE_DRV_TOUCH_MTCH6301=n +# +# from $HARMONY_VERSION_PATH/framework/driver/usart/config/drv_usart.hconfig +# +CONFIG_USE_DRV_USART=n +# +# from $HARMONY_VERSION_PATH/framework/driver/wifi/config/drv_wifi.hconfig +# +CONFIG_USE_DRV_WIFI=n +# +# from $HARMONY_VERSION_PATH/framework/gfx/config/gfx.hconfig +# +CONFIG_USE_GFX_STACK=n +# +# from $HARMONY_VERSION_PATH/framework/math/dsp/config/dsp.hconfig +# +CONFIG_USE_DSP=n +# +# from $HARMONY_VERSION_PATH/framework/math/libq/config/libq.hconfig +# +CONFIG_USE_LIBQ=n +# +# from $HARMONY_VERSION_PATH/framework/osal/config/osal.hconfig +# +CONFIG_USE_OSAL=y +# +# from $HARMONY_VERSION_PATH/framework/peripheral/config/peripheral.hconfig +# +CONFIG_PERIPHERAL_LIB=y +# +# from $HARMONY_VERSION_PATH/framework/system/clk/config/sys_clk.hconfig +# +CONFIG_USE_SYS_CLK=y +CONFIG_SYS_CLK_MODE="STATIC" +CONFIG_SYS_CLK_PBDIV0_MZ=2 +CONFIG_SYS_CLK_PBCLK1_ENABLE=n +CONFIG_SYS_CLK_PBCLK2_ENABLE=y +CONFIG_SYS_CLK_PBDIV2=2 +CONFIG_SYS_CLK_PBCLK3_ENABLE=y +CONFIG_SYS_CLK_PBDIV3=2 +CONFIG_SYS_CLK_PBCLK4_ENABLE=n +CONFIG_SYS_CLK_PBCLK6_ENABLE=y +CONFIG_SYS_CLK_PBDIV6=1 +CONFIG_SYS_CLK_PBCLK7_ENABLE=n +CONFIG_SYS_CLK_REFCLK0_ENABLE=n +CONFIG_SYS_CLK_REFCLK1_ENABLE=n +CONFIG_SYS_CLK_REFCLK2_ENABLE=n +CONFIG_SYS_CLK_REFCLK3_ENABLE=n +CONFIG_SYS_CLK_CONFIG_PRIMARY_XTAL="24000000" +CONFIG_SYS_CLK_CONFIG_SECONDARY_XTAL="32768" +CONFIG_SYS_CLK_FREQ="80000000" +CONFIG_SYS_CLK_PBCLK0_FREQ="40000000" +CONFIG_SYS_CLK_PBCLK2_FREQ="40000000" +CONFIG_SYS_CLK_PBCLK3_FREQ="40000000" +CONFIG_SYS_CLK_PBCLK6_FREQ="80000000" +# +# from $HARMONY_VERSION_PATH/framework/system/command/config/sys_command.hconfig +# +CONFIG_USE_SYS_COMMAND=n +# +# from $HARMONY_VERSION_PATH/framework/system/common/config/sys_common.hconfig +# +CONFIG_USE_SYS_COMMON=y +CONFIG_SYS_BUFFER=n +CONFIG_SYS_QUEUE=n +# +# from $HARMONY_VERSION_PATH/framework/system/console/config/sys_console.hconfig +# +CONFIG_USE_SYS_CONSOLE=n +# +# from $HARMONY_VERSION_PATH/framework/system/debug/config/sys_debug.hconfig +# +CONFIG_USE_SYS_DEBUG=n +# +# from $HARMONY_VERSION_PATH/framework/system/devcon/config/sys_devcon.hconfig +# +CONFIG_USE_SYS_DEVCON=y +CONFIG_SYS_DEVCON_USE_JTAG=n +CONFIG_SYS_DEVCON_USE_TRACE=n +# +# from $HARMONY_VERSION_PATH/framework/system/dma/config/sys_dma.hconfig +# +CONFIG_USE_SYS_DMA=n +# +# from $HARMONY_VERSION_PATH/framework/system/fs/config/sys_fs.hconfig +# +CONFIG_USE_SYS_FS=n +# +# from $HARMONY_VERSION_PATH/framework/system/int/config/sys_int.hconfig +# +CONFIG_USE_SYS_INT=n +CONFIG_USE_EXT_INT=n +# +# from $HARMONY_VERSION_PATH/framework/system/msg/config/sys_msg.hconfig +# +CONFIG_USE_SYS_MSG=n +# +# from $HARMONY_VERSION_PATH/framework/system/ports/config/sys_ports.hconfig +# +CONFIG_USE_SYS_PORTS=y +CONFIG_COMPONENT_PACKAGE="TQFP" +CONFIG_USE_SYS_PORTS_CN_INTERRUPT=n +# +# from $HARMONY_VERSION_PATH/framework/system/ports/config/sys_ports_idx.ftl +# +CONFIG_USE_PORT_B=y +CONFIG_SYS_PORT_B_ANSEL=0x0 +CONFIG_SYS_PORT_B_TRIS=0x0 +CONFIG_SYS_PORT_B_LAT=0x0 +CONFIG_SYS_PORT_B_ODC=0x0 +CONFIG_SYS_PORT_B_CNPU=0x0 +CONFIG_SYS_PORT_B_CNPD=0x0 +CONFIG_SYS_PORT_B_CNEN=0x0 +CONFIG_USE_PORT_C=y +CONFIG_SYS_PORT_C_ANSEL=0x0 +CONFIG_SYS_PORT_C_TRIS=0xf000 +CONFIG_SYS_PORT_C_LAT=0x0 +CONFIG_SYS_PORT_C_ODC=0x0 +CONFIG_SYS_PORT_C_CNPU=0x0 +CONFIG_SYS_PORT_C_CNPD=0x0 +CONFIG_SYS_PORT_C_CNEN=0x0 +CONFIG_USE_PORT_D=y +CONFIG_SYS_PORT_D_ANSEL=0x0 +CONFIG_SYS_PORT_D_TRIS=0xe3f +CONFIG_SYS_PORT_D_LAT=0x0 +CONFIG_SYS_PORT_D_ODC=0x0 +CONFIG_SYS_PORT_D_CNPU=0xe3f +CONFIG_SYS_PORT_D_CNPD=0x0 +CONFIG_SYS_PORT_D_CNEN=0x0 +CONFIG_USE_PORT_E=y +CONFIG_SYS_PORT_E_ANSEL=0x0 +CONFIG_SYS_PORT_E_TRIS=0xff +CONFIG_SYS_PORT_E_LAT=0x0 +CONFIG_SYS_PORT_E_ODC=0x0 +CONFIG_SYS_PORT_E_CNPU=0xff +CONFIG_SYS_PORT_E_CNPD=0x0 +CONFIG_SYS_PORT_E_CNEN=0x0 +CONFIG_USE_PORT_F=y +CONFIG_SYS_PORT_F_ANSEL=0x0 +CONFIG_SYS_PORT_F_TRIS=0x3b +CONFIG_SYS_PORT_F_LAT=0x0 +CONFIG_SYS_PORT_F_ODC=0x0 +CONFIG_SYS_PORT_F_CNPU=0x3b +CONFIG_SYS_PORT_F_CNPD=0x0 +CONFIG_SYS_PORT_F_CNEN=0x0 +CONFIG_USE_PORT_G=y +CONFIG_SYS_PORT_G_ANSEL=0x0 +CONFIG_SYS_PORT_G_TRIS=0x1c0 +CONFIG_SYS_PORT_G_LAT=0x0 +CONFIG_SYS_PORT_G_ODC=0x0 +CONFIG_SYS_PORT_G_CNPU=0x0 +CONFIG_SYS_PORT_G_CNPD=0x0 +CONFIG_SYS_PORT_G_CNEN=0x0 +# +# from $HARMONY_VERSION_PATH/framework/system/random/config/sys_random.hconfig +# +CONFIG_USE_SYS_RANDOM=n +# +# from $HARMONY_VERSION_PATH/framework/system/reset/config/sys_reset.hconfig +# +CONFIG_USE_SYS_RESET=n +# +# from $HARMONY_VERSION_PATH/framework/system/touch/config/sys_touch.hconfig +# +CONFIG_USE_SYS_TOUCH=n +# +# from $HARMONY_VERSION_PATH/framework/system/tmr/config/sys_tmr.hconfig +# +CONFIG_USE_SYS_TMR=n +# +# from $HARMONY_VERSION_PATH/framework/system/wdt/config/sys_wdt.hconfig +# +CONFIG_USE_SYS_WDT=n +# +# from $HARMONY_VERSION_PATH/framework/tcpip/config/tcpip_stack.hconfig +# +CONFIG_USE_TCPIP_STACK=n +# +# from $HARMONY_VERSION_PATH/framework/usb/config/usb.hconfig +# +CONFIG_USE_USB_STACK=n +# +# from $HARMONY_VERSION_PATH/framework/sample/config/sample_module.hconfig +# +CONFIG_USE_SAMPLE_MODULE=n +# +# from $HARMONY_VERSION_PATH/framework/test/config/test.hconfig +# +CONFIG_USE_TEST_HARNESS=n +# +# from $HARMONY_VERSION_PATH/framework/decoder/config/decoder.hconfig +# +CONFIG_USE_DECODER=n +# +# from $HARMONY_VERSION_PATH/framework/net/pres/config/net_pres.hconfig +# +CONFIG_NET_PRES_USE=n +# +# from $HARMONY_VERSION_PATH/bsp/config/bsp.hconfig +# +CONFIG_USE_BSP=n +# +# from $HARMONY_VERSION_PATH/third_party/rtos/config/rtos.hconfig +# +CONFIG_USE_3RDPARTY_RTOS=n +# +# from $HARMONY_VERSION_PATH/third_party/tcpip/config/wolfssl.hconfig +# +CONFIG_USE_3RDPARTY_WOLFSSL=n +# +# from $HARMONY_VERSION_PATH/third_party/tcpip/iniche/config/embtcp.hconfig +# +CONFIG_IN_EMB_TCPIP_USE_TCP=n +# +# from $HARMONY_VERSION_PATH/third_party/tcpip/iniche/config/embdual.hconfig +# +CONFIG_IN_EMB_DUAL_USE_TCP=n +# +# from $HARMONY_VERSION_PATH/third_party/tcpip/iniche/config/stack.hconfig +# +CONFIG_IN_TCPIP=n +# +# from $HARMONY_VERSION_PATH/config/harmony.hconfig +# +CONFIG_DEVICE_CONFIGURATION=y +# +# from $HARMONY_VERSION_PATH/utilities/mhc/config/PIC32MZ2048ECG064.hconfig +# +CONFIG_USERID=0xffff +CONFIG_FMIIEN="ON" +CONFIG_FETHIO="OFF" +CONFIG_PGL1WAY="ON" +CONFIG_PMDL1WAY="ON" +CONFIG_IOL1WAY="ON" +CONFIG_FUSBIDIO="OFF" +CONFIG_FPLLIDIV="DIV_1" +CONFIG_FPLLRNG="RANGE_5_10_MHZ" +CONFIG_FPLLICLK="PLL_FRC" +CONFIG_FPLLMULT="MUL_80" +CONFIG_FPLLODIV="DIV_8" +CONFIG_UPLLFSEL="FREQ_12MHZ" +CONFIG_UPLLEN="OFF" +CONFIG_FNOSC="SPLL" +CONFIG_DMTINTV="WIN_127_128" +CONFIG_FSOSCEN="OFF" +CONFIG_IESO="ON" +CONFIG_POSCMOD="OFF" +CONFIG_OSCIOFNC="OFF" +CONFIG_FCKSM="CSECME" +CONFIG_WDTPS="PS1048576" +CONFIG_WDTSPGM="STOP" +CONFIG_WINDIS="NORMAL" +CONFIG_FWDTEN="OFF" +CONFIG_FWDTWINSZ="WINSZ_25" +CONFIG_DMTCNT="DMT31" +CONFIG_FDMTEN="OFF" +CONFIG_DEBUG="OFF" +CONFIG_JTAGEN="OFF" +CONFIG_ICESEL="ICS_PGx1" +CONFIG_TRCEN="ON" +CONFIG_BOOTISA="MIPS32" +CONFIG_FECCCON="OFF_UNLOCKED" +CONFIG_FSLEEP="OFF" +CONFIG_DBGPER="PG_ALL" +CONFIG_EJTAGBEN="NORMAL" +CONFIG_CP="OFF" +CONFIG_TSEQ=0xffff +CONFIG_CSEQ=0xffff +# +# from $HARMONY_VERSION_PATH/utilities/mhc/config/project.hconfig +# +CONFIG_XC32_HEAP="4096" diff --git a/firmware/src/system_config/default/framework/system/clk/src/sys_clk_static.c b/firmware/src/system_config/default/framework/system/clk/src/sys_clk_static.c new file mode 100644 index 0000000..06a146b --- /dev/null +++ b/firmware/src/system_config/default/framework/system/clk/src/sys_clk_static.c @@ -0,0 +1,283 @@ +/*******************************************************************************
+ SYS CLK Static Functions for Clock System Service
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ sys_clk_static.c
+
+ Summary:
+ SYS CLK static function implementations for the Clock System Service.
+
+ Description:
+ The Clock System Service provides a simple interface to manage the oscillators
+ on Microchip microcontrollers. This file defines the static implementation for the
+ Clock System Service.
+
+ Remarks:
+ Static functions incorporate all system clock configuration settings as
+ determined by the user via the Microchip Harmony Configurator GUI. It provides
+ static version of the routines, eliminating the need for an object ID or
+ object handle.
+
+ Static single-open interfaces also eliminate the need for the open handle.
+*******************************************************************************/
+
+//DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+*******************************************************************************/
+//DOM-IGNORE-END
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Include Files
+// *****************************************************************************
+// *****************************************************************************
+
+#include "system_config.h"
+#include "system_definitions.h"
+#include "peripheral/osc/plib_osc.h"
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: File Scope Functions
+// *****************************************************************************
+// *****************************************************************************
+
+// *****************************************************************************
+/* Function:
+ void SYS_CLK_Static_Initialize ( const SYS_CLK_INIT const * clkInit )
+
+ Summary:
+ Initializes hardware and internal data structure of the System Clock.
+
+ Description:
+ This function initializes the hardware and internal data structure of System
+ Clock Service.
+
+ Remarks:
+ This is configuration values for the static version of the Clock System Service
+ module is determined by the user via the Microchip Harmony Configurator GUI.
+ This template will build a sys_clk_static.h and sys_clk_static.c file with
+ the configuration per the user's choice.
+
+ The objective is to eliminate the user's need to be knowledgeable in the function of
+ the 'configuration bits' to configure the system oscillators.
+*/
+
+void SYS_CLK_Initialize( const SYS_CLK_INIT const * clkInit )
+{
+ SYS_DEVCON_SystemUnlock ( );
+
+ PLIB_OSC_FRCDivisorSelect( OSC_ID_0, OSC_FRC_DIV_1);
+
+ /* Enable Peripheral Bus 1 */
+ PLIB_OSC_PBClockDivisorSet (OSC_ID_0, 0, 2 );
+ PLIB_OSC_PBOutputClockEnable (OSC_ID_0, 0 );
+ /* Disable Peripheral Bus 2 */
+ PLIB_OSC_PBOutputClockDisable (OSC_ID_0, 1 );
+
+ /* Enable Peripheral Bus 3 */
+ PLIB_OSC_PBClockDivisorSet (OSC_ID_0, 2, 2 );
+ PLIB_OSC_PBOutputClockEnable (OSC_ID_0, 2 );
+ /* Enable Peripheral Bus 4 */
+ PLIB_OSC_PBClockDivisorSet (OSC_ID_0, 3, 2 );
+ PLIB_OSC_PBOutputClockEnable (OSC_ID_0, 3 );
+ /* Disable Peripheral Bus 5 */
+ PLIB_OSC_PBOutputClockDisable (OSC_ID_0, 4 );
+
+ /* Enable Peripheral Bus 7 */
+ PLIB_OSC_PBClockDivisorSet (OSC_ID_0, 6, 1 );
+ PLIB_OSC_PBOutputClockEnable (OSC_ID_0, 6 );
+ /* Disable Peripheral Bus 8 */
+ PLIB_OSC_PBOutputClockDisable (OSC_ID_0, 7 );
+
+ /* Disable REFCLKO1*/
+ PLIB_OSC_ReferenceOscDisable ( OSC_ID_0, OSC_REFERENCE_1 );
+ /* Disable REFCLK1_OE*/
+ PLIB_OSC_ReferenceOutputDisable ( OSC_ID_0, OSC_REFERENCE_1 );
+ /* Disable REFCLKO2*/
+ PLIB_OSC_ReferenceOscDisable ( OSC_ID_0, OSC_REFERENCE_2 );
+ /* Disable REFCLK2_OE*/
+ PLIB_OSC_ReferenceOutputDisable ( OSC_ID_0, OSC_REFERENCE_2 );
+ /* Disable REFCLKO3*/
+ PLIB_OSC_ReferenceOscDisable ( OSC_ID_0, OSC_REFERENCE_3 );
+ /* Disable REFCLK3_OE*/
+ PLIB_OSC_ReferenceOutputDisable ( OSC_ID_0, OSC_REFERENCE_3 );
+ /* Disable REFCLKO4*/
+ PLIB_OSC_ReferenceOscDisable ( OSC_ID_0, OSC_REFERENCE_4 );
+ /* Disable REFCLK4_OE*/
+ PLIB_OSC_ReferenceOutputDisable ( OSC_ID_0, OSC_REFERENCE_4 );
+
+ SYS_DEVCON_SystemLock ( );
+}
+
+//******************************************************************************
+/* Function:
+ inline uint32_t SYS_CLK_SystemFrequencyGet ( void )
+
+ Summary:
+ Gets the system clock frequency in Hertz.
+
+ Description:
+ This function gets the System clock frequency in Hertz.
+
+ Precondition:
+ None.
+
+ Parameters:
+ None.
+
+ Returns:
+ System clock frequency in Hertz.
+
+ Example:
+ <code>
+ uint32_t sysClockHz;
+
+ sysClockHz = SYS_CLK_SystemFrequencyGet ( );
+ </code>
+
+ Remarks:
+ */
+
+inline uint32_t SYS_CLK_SystemFrequencyGet ( void )
+{
+ return SYS_CLK_FREQ;
+}
+
+//******************************************************************************
+/* Function:
+ inline uint32_t SYS_CLK_PeripheralFrequencyGet ( CLK_BUSES_PERIPHERAL peripheralBus )
+
+ Summary:
+ Gets the selected clock peripheral bus frequency in Hertz.
+
+ Description:
+ This function gets the selected peripheral bus clock frequency in Hertz.
+
+ Precondition:
+ None.
+
+ Parameters:
+ peripheralBus - Reference clock bus selection. One of the possible value from
+ CLK_BUSES_PERIPHERAL enum. For devices that do not have multiple
+ clock channels for Reference clock, CLK_BUS_PERIPHERAL_1 should be
+ the selection.
+
+ Returns:
+ Clock frequency in Hertz.
+
+ Example:
+ <code>
+ unsigned long peripheralClockHz;
+
+ peripheralClockHz = SYS_CLK_PeripheralFrequencyGet ( CLK_BUS_PERIPHERAL_5 );
+ </code>
+
+ Remarks:
+ Most of the devices doesn't have multiple Peripheral clock buses. In that case,
+ pass CLK_USB_PERIPHERAL_1 as the bus number.
+ */
+
+inline uint32_t SYS_CLK_PeripheralFrequencyGet ( CLK_BUSES_PERIPHERAL peripheralBus )
+{
+ uint32_t freq = 0;
+
+ switch (peripheralBus)
+ {
+ case CLK_BUS_PERIPHERAL_1:
+ freq = SYS_CLK_BUS_PERIPHERAL_1;
+ break;
+ case CLK_BUS_PERIPHERAL_2:
+ break;
+ case CLK_BUS_PERIPHERAL_3:
+ freq = SYS_CLK_BUS_PERIPHERAL_3;
+ break;
+ case CLK_BUS_PERIPHERAL_4:
+ freq = SYS_CLK_BUS_PERIPHERAL_4;
+ break;
+ case CLK_BUS_PERIPHERAL_5:
+ break;
+ case CLK_BUS_PERIPHERAL_7:
+ freq = SYS_CLK_BUS_PERIPHERAL_7;
+ break;
+ case CLK_BUS_PERIPHERAL_8:
+ break;
+ }
+
+ return freq;
+}
+
+
+//******************************************************************************
+/* Function:
+ inline uint32_t SYS_CLK_ReferenceClockFrequencyGet ( CLK_BUSES_REFERENCE referenceBus )
+
+ Summary:
+ Gets the selected Reference clock bus frequency in Hertz.
+
+ Description:
+ This function gets frequency of the selected Reference clock bus in Hertz.
+
+ Precondition:
+ None.
+
+ Parameters:
+ peripheralBus - Reference clock bus selection. One of the possible value from
+ CLK_BUSES_REFERENCE enum. For devices that do not have multiple
+ clock channels for Reference clock, CLK_BUS_REFERENCE_1 should be
+ the selection.
+
+ Returns:
+ Clock frequency in Hz.
+
+ Example:
+ <code>
+ unsigned long sysClockOutputHz;
+
+ sysClockOutputHz = SYS_CLK_ReferenceClockFrequencyGet ( CLK_BUS_REFERENCE_3 );
+ </code>
+
+ Remarks:
+ */
+
+inline uint32_t SYS_CLK_ReferenceClockFrequencyGet ( CLK_BUSES_REFERENCE referenceBus )
+{
+ uint32_t freq = 0;
+
+ switch (referenceBus)
+ {
+ case CLK_BUS_REFERENCE_1:
+ break;
+ case CLK_BUS_REFERENCE_2:
+ break;
+ case CLK_BUS_REFERENCE_3:
+ break;
+ case CLK_BUS_REFERENCE_4:
+ break;
+ }
+
+ return freq;
+}
\ No newline at end of file diff --git a/firmware/src/system_config/default/framework/system/clk/sys_clk_static.h b/firmware/src/system_config/default/framework/system/clk/sys_clk_static.h new file mode 100644 index 0000000..23a0cf5 --- /dev/null +++ b/firmware/src/system_config/default/framework/system/clk/sys_clk_static.h @@ -0,0 +1,65 @@ +/*******************************************************************************
+ SYS CLK Static Interface Declarations for Clock System Service
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ sys_clk_static.h
+
+ Summary:
+ SYS CLK interface declarations for the static system service.
+
+ Description:
+ The Clock System Service provides a simple interface to manage the oscillators
+ on Microchip microcontrollers. This file defines the interface
+ Declarations for the SYS CLK system service.
+
+ Remarks:
+ Static interfaces incorporate all system clock configuration settings as
+ determined by the user via the Microchip Harmony Configurator GUI. It provides
+ static version of the routines, eliminating the need for an object ID or
+ object handle.
+
+ Static single-open interfaces also eliminate the need for the open handle.
+*******************************************************************************/
+
+//DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+*******************************************************************************/
+//DOM-IGNORE-END
+
+#ifndef _SYS_CLK_STATIC_H
+#define _SYS_CLK_STATIC_H
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: SYS CLK Module Initialization Routine (Static Version)
+// *****************************************************************************
+// *****************************************************************************
+
+#endif // #ifndef _SYS_CLK_STATIC_H
+
+/*******************************************************************************
+ End of File
+*/
diff --git a/firmware/src/system_config/default/framework/system/ports/src/sys_ports_static.c b/firmware/src/system_config/default/framework/system/ports/src/sys_ports_static.c new file mode 100644 index 0000000..b125472 --- /dev/null +++ b/firmware/src/system_config/default/framework/system/ports/src/sys_ports_static.c @@ -0,0 +1,130 @@ +/*******************************************************************************
+ SYS PORTS Static Functions for PORTS System Service
+
+ Company:
+ Microchip Technology Inc.
+
+ File Name:
+ sys_ports_static.c
+
+ Summary:
+ SYS PORTS static function implementations for the Ports System Service.
+
+ Description:
+ The Ports System Service provides a simple interface to manage the ports
+ on Microchip microcontrollers. This file defines the static implementation for the
+ Ports System Service.
+
+ Remarks:
+ Static functions incorporate all system ports configuration settings as
+ determined by the user via the Microchip Harmony Configurator GUI. It provides
+ static version of the routines, eliminating the need for an object ID or
+ object handle.
+
+*******************************************************************************/
+
+//DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+*******************************************************************************/
+//DOM-IGNORE-END
+
+#include "system_config.h"
+#include "peripheral/ports/plib_ports.h"
+#include "peripheral/int/plib_int.h"
+
+
+void SYS_PORTS_Initialize(void)
+{
+
+ /* PORT B Initialization */
+ PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_B, SYS_PORT_B_ODC);
+ PLIB_PORTS_Write( PORTS_ID_0, PORT_CHANNEL_B, SYS_PORT_B_LAT);
+ PLIB_PORTS_DirectionOutputSet( PORTS_ID_0, PORT_CHANNEL_B, SYS_PORT_B_TRIS ^ 0xFFFF);
+ PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_B);
+ PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_B, SYS_PORT_B_ANSEL ^ 0xFFFF, PORTS_PIN_MODE_DIGITAL);
+ PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_B, SYS_PORT_B_CNEN);
+ PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_B, SYS_PORT_B_CNPU);
+ PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_B, SYS_PORT_B_CNPD);
+
+ /* PORT C Initialization */
+ PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, SYS_PORT_C_ODC);
+ PLIB_PORTS_Write( PORTS_ID_0, PORT_CHANNEL_C, SYS_PORT_C_LAT);
+ PLIB_PORTS_DirectionOutputSet( PORTS_ID_0, PORT_CHANNEL_C, SYS_PORT_C_TRIS ^ 0xFFFF);
+ PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
+ PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, SYS_PORT_C_ANSEL ^ 0xFFFF, PORTS_PIN_MODE_DIGITAL);
+ PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, SYS_PORT_C_CNEN);
+ PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C, SYS_PORT_C_CNPU);
+ PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C, SYS_PORT_C_CNPD);
+
+ /* PORT D Initialization */
+ PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_D, SYS_PORT_D_ODC);
+ PLIB_PORTS_Write( PORTS_ID_0, PORT_CHANNEL_D, SYS_PORT_D_LAT);
+ PLIB_PORTS_DirectionOutputSet( PORTS_ID_0, PORT_CHANNEL_D, SYS_PORT_D_TRIS ^ 0xFFFF);
+ PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_D);
+ PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_D, SYS_PORT_D_ANSEL ^ 0xFFFF, PORTS_PIN_MODE_DIGITAL);
+ PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_D, SYS_PORT_D_CNEN);
+ PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_D, SYS_PORT_D_CNPU);
+ PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_D, SYS_PORT_D_CNPD);
+
+ /* PORT E Initialization */
+ PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_E, SYS_PORT_E_ODC);
+ PLIB_PORTS_Write( PORTS_ID_0, PORT_CHANNEL_E, SYS_PORT_E_LAT);
+ PLIB_PORTS_DirectionOutputSet( PORTS_ID_0, PORT_CHANNEL_E, SYS_PORT_E_TRIS ^ 0xFFFF);
+ PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_E);
+ PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_E, SYS_PORT_E_ANSEL ^ 0xFFFF, PORTS_PIN_MODE_DIGITAL);
+ PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_E, SYS_PORT_E_CNEN);
+ PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_E, SYS_PORT_E_CNPU);
+ PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_E, SYS_PORT_E_CNPD);
+
+ /* PORT F Initialization */
+ PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_F, SYS_PORT_F_ODC);
+ PLIB_PORTS_Write( PORTS_ID_0, PORT_CHANNEL_F, SYS_PORT_F_LAT);
+ PLIB_PORTS_DirectionOutputSet( PORTS_ID_0, PORT_CHANNEL_F, SYS_PORT_F_TRIS ^ 0xFFFF);
+ PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_F);
+ PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_F, SYS_PORT_F_ANSEL ^ 0xFFFF, PORTS_PIN_MODE_DIGITAL);
+ PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_F, SYS_PORT_F_CNEN);
+ PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_F, SYS_PORT_F_CNPU);
+ PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_F, SYS_PORT_F_CNPD);
+
+ /* PORT G Initialization */
+ PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_G, SYS_PORT_G_ODC);
+ PLIB_PORTS_Write( PORTS_ID_0, PORT_CHANNEL_G, SYS_PORT_G_LAT);
+ PLIB_PORTS_DirectionOutputSet( PORTS_ID_0, PORT_CHANNEL_G, SYS_PORT_G_TRIS ^ 0xFFFF);
+ PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_G);
+ PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_G, SYS_PORT_G_ANSEL ^ 0xFFFF, PORTS_PIN_MODE_DIGITAL);
+ PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_G, SYS_PORT_G_CNEN);
+ PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_G, SYS_PORT_G_CNPU);
+ PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_G, SYS_PORT_G_CNPD);
+
+
+ /* PPS Input Remapping */
+
+ /* PPS Output Remapping */
+
+
+}
+
+
+/*******************************************************************************
+ End of File
+*/
diff --git a/firmware/src/system_config/default/system_config.h b/firmware/src/system_config/default/system_config.h new file mode 100644 index 0000000..a8faed8 --- /dev/null +++ b/firmware/src/system_config/default/system_config.h @@ -0,0 +1,165 @@ +/*******************************************************************************
+ MPLAB Harmony System Configuration Header
+
+ File Name:
+ system_config.h
+
+ Summary:
+ Build-time configuration header for the system defined by this MPLAB Harmony
+ project.
+
+ Description:
+ An MPLAB Project may have multiple configurations. This file defines the
+ build-time options for a single configuration.
+
+ Remarks:
+ This configuration header must not define any prototypes or data
+ definitions (or include any files that do). It only provides macro
+ definitions for build-time configuration options that are not instantiated
+ until used by another MPLAB Harmony module or application.
+
+ Created with MPLAB Harmony Version 1.06
+*******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+*******************************************************************************/
+// DOM-IGNORE-END
+
+#ifndef _SYSTEM_CONFIG_H
+#define _SYSTEM_CONFIG_H
+
+/* This is a temporary workaround for an issue with the peripheral library "Exists"
+ functions that causes superfluous warnings. It "nulls" out the definition of
+ The PLIB function attribute that causes the warning. Once that issue has been
+ resolved, this definition should be removed. */
+#define _PLIB_UNSUPPORTED
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Included Files
+// *****************************************************************************
+// *****************************************************************************
+/* This section Includes other configuration headers necessary to completely
+ define this configuration.
+*/
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: System Service Configuration
+// *****************************************************************************
+// *****************************************************************************
+
+// *****************************************************************************
+/* Common System Service Configuration Options
+*/
+#define SYS_VERSION_STR "1.06"
+#define SYS_VERSION 10600
+
+// *****************************************************************************
+/* Clock System Service Configuration Options
+*/
+#define SYS_CLK_FREQ 80000000ul
+#define SYS_CLK_BUS_PERIPHERAL_1 40000000ul
+#define SYS_CLK_BUS_PERIPHERAL_3 40000000ul
+#define SYS_CLK_BUS_PERIPHERAL_4 40000000ul
+#define SYS_CLK_BUS_PERIPHERAL_7 80000000ul
+#define SYS_CLK_CONFIG_PRIMARY_XTAL 24000000ul
+#define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
+
+/*** Ports System Service Configuration ***/
+
+#define SYS_PORT_B_ANSEL 0x0
+#define SYS_PORT_B_TRIS 0x0
+#define SYS_PORT_B_LAT 0x0
+#define SYS_PORT_B_ODC 0x0
+#define SYS_PORT_B_CNPU 0x0
+#define SYS_PORT_B_CNPD 0x0
+#define SYS_PORT_B_CNEN 0x0
+#define SYS_PORT_C_ANSEL 0x0
+#define SYS_PORT_C_TRIS 0xf000
+#define SYS_PORT_C_LAT 0x0
+#define SYS_PORT_C_ODC 0x0
+#define SYS_PORT_C_CNPU 0x0
+#define SYS_PORT_C_CNPD 0x0
+#define SYS_PORT_C_CNEN 0x0
+
+#define SYS_PORT_D_ANSEL 0x0
+#define SYS_PORT_D_TRIS 0xe3f
+#define SYS_PORT_D_LAT 0x0
+#define SYS_PORT_D_ODC 0x0
+#define SYS_PORT_D_CNPU 0xe3f
+#define SYS_PORT_D_CNPD 0x0
+#define SYS_PORT_D_CNEN 0x0
+
+#define SYS_PORT_E_ANSEL 0x0
+#define SYS_PORT_E_TRIS 0xff
+#define SYS_PORT_E_LAT 0x0
+#define SYS_PORT_E_ODC 0x0
+#define SYS_PORT_E_CNPU 0xff
+#define SYS_PORT_E_CNPD 0x0
+#define SYS_PORT_E_CNEN 0x0
+
+#define SYS_PORT_F_ANSEL 0x0
+#define SYS_PORT_F_TRIS 0x3b
+#define SYS_PORT_F_LAT 0x0
+#define SYS_PORT_F_ODC 0x0
+#define SYS_PORT_F_CNPU 0x3b
+#define SYS_PORT_F_CNPD 0x0
+#define SYS_PORT_F_CNEN 0x0
+
+#define SYS_PORT_G_ANSEL 0x0
+#define SYS_PORT_G_TRIS 0x1c0
+#define SYS_PORT_G_LAT 0x0
+#define SYS_PORT_G_ODC 0x0
+#define SYS_PORT_G_CNPU 0x0
+#define SYS_PORT_G_CNPD 0x0
+#define SYS_PORT_G_CNEN 0x0
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Driver Configuration
+// *****************************************************************************
+// *****************************************************************************
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Middleware & Other Library Configuration
+// *****************************************************************************
+// *****************************************************************************
+
+
+
+
+
+
+
+#endif // _SYSTEM_CONFIG_H
+/*******************************************************************************
+ End of File
+*/
+
diff --git a/firmware/src/system_config/default/system_definitions.h b/firmware/src/system_config/default/system_definitions.h new file mode 100644 index 0000000..5bc5468 --- /dev/null +++ b/firmware/src/system_config/default/system_definitions.h @@ -0,0 +1,119 @@ +/*******************************************************************************
+ System Definitions
+
+ File Name:
+ system_definitions.h
+
+ Summary:
+ MPLAB Harmony project system definitions.
+
+ Description:
+ This file contains the system-wide prototypes and definitions for an MPLAB
+ Harmony project.
+ *******************************************************************************/
+
+//DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+ *******************************************************************************/
+//DOM-IGNORE-END
+
+#ifndef _SYS_DEFINITIONS_H
+#define _SYS_DEFINITIONS_H
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Included Files
+// *****************************************************************************
+// *****************************************************************************
+
+#include <stdint.h>
+#include <stddef.h>
+#include <stdbool.h>
+#include "system/common/sys_common.h"
+#include "system/common/sys_module.h"
+#include "system/clk/sys_clk.h"
+#include "system/clk/sys_clk_static.h"
+#include "system/devcon/sys_devcon.h"
+#include "system/ports/sys_ports.h"
+
+
+#include "app.h"
+
+
+// DOM-IGNORE-BEGIN
+#ifdef __cplusplus // Provide C++ Compatibility
+
+extern "C" {
+
+#endif
+// DOM-IGNORE-END
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Type Definitions
+// *****************************************************************************
+// *****************************************************************************
+
+// *****************************************************************************
+/* System Objects
+
+ Summary:
+ Structure holding the system's object handles
+
+ Description:
+ This structure contains the object handles for all objects in the
+ MPLAB Harmony project's system configuration.
+
+ Remarks:
+ These handles are returned from the "Initialize" functions for each module
+ and must be passed into the "Tasks" function for each module.
+*/
+
+typedef struct
+{
+ SYS_MODULE_OBJ sysDevcon;
+
+} SYSTEM_OBJECTS;
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: extern declarations
+// *****************************************************************************
+// *****************************************************************************
+
+extern SYSTEM_OBJECTS sysObj;
+
+
+//DOM-IGNORE-BEGIN
+#ifdef __cplusplus
+}
+#endif
+//DOM-IGNORE-END
+
+#endif /* _SYS_DEFINITIONS_H */
+/*******************************************************************************
+ End of File
+*/
+
diff --git a/firmware/src/system_config/default/system_exceptions.c b/firmware/src/system_config/default/system_exceptions.c new file mode 100644 index 0000000..73a2380 --- /dev/null +++ b/firmware/src/system_config/default/system_exceptions.c @@ -0,0 +1,143 @@ +/*******************************************************************************
+ MPLAB Harmony Exceptions Source File
+
+ File Name:
+ system_exceptions.c
+
+ Summary:
+ This file contains a function which overrides the deafult _weak_ exception
+ handler provided by the XC32 compiler.
+
+ Description:
+ This file redefines the default _weak_ exception handler with a more debug
+ friendly one. If an unexpected exception occurs the code will stop in a
+ while(1) loop. The debugger can be halted and two variables _excep_code and
+ _except_addr can be examined to determine the cause and address where the
+ exception occured.
+ *******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+ *******************************************************************************/
+// DOM-IGNORE-END
+
+
+#include <xc.h> /* Defines special funciton registers, CP0 regs */
+#include "system_config.h"
+#include "system_definitions.h"
+#include "system/debug/sys_debug.h"
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Global Data Definitions
+// *****************************************************************************
+// *****************************************************************************
+
+/*******************************************************************************
+ Exception Reason Data
+
+ <editor-fold defaultstate="expanded" desc="Exception Reason Data">
+
+ Remarks:
+ These global static items are used instead of local variables in the
+ _general_exception_handler function because the stack may not be available
+ if an exception has occured.
+*/
+
+/* Code identifying the cause of the exception (CP0 Cause register). */
+static unsigned int _excep_code;
+
+/* Address of instruction that caused the exception. */
+static unsigned int _excep_addr;
+
+/* Pointer to the string describing the cause of the exception. */
+static char *_cause_str;
+
+/* Array identifying the cause (indexed by _exception_code). */
+static char *cause[] =
+{
+ "Interrupt",
+ "Undefined",
+ "Undefined",
+ "Undefined",
+ "Load/fetch address error",
+ "Store address error",
+ "Instruction bus error",
+ "Data bus error",
+ "Syscall",
+ "Breakpoint",
+ "Reserved instruction",
+ "Coprocessor unusable",
+ "Arithmetic overflow",
+ "Trap",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved",
+ "Reserved"
+};
+
+// </editor-fold>
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Exception Handling
+// *****************************************************************************
+// *****************************************************************************
+
+/*******************************************************************************
+ Function:
+ void _general_exception_handler ( void )
+
+ Summary:
+ Overrides the XC32 _weak_ _generic_exception_handler.
+
+ Description:
+ This function overrides the XC32 default _weak_ _generic_exception_handler.
+
+ Remarks:
+ Refer to the XC32 User's Guide for additional information.
+ */
+
+void _general_exception_handler ( void )
+{
+ /* Mask off Mask of the ExcCode Field from the Cause Register
+ Refer to the MIPs Software User's manual */
+ _excep_code = (_CP0_GET_CAUSE() & 0x0000007C) >> 2;
+ _excep_addr = _CP0_GET_EPC();
+ _cause_str = cause[_excep_code];
+
+ SYS_DEBUG_PRINT(SYS_ERROR_ERROR, "\nGeneral Exception %s (cause=%d, addr=%x).\n",
+ _cause_str, _excep_code, _excep_addr);
+
+ while (1)
+ {
+ SYS_DEBUG_BreakPoint();
+ }
+}
+
+/*******************************************************************************
+ End of File
+*/
diff --git a/firmware/src/system_config/default/system_init.c b/firmware/src/system_config/default/system_init.c new file mode 100644 index 0000000..9c69c4e --- /dev/null +++ b/firmware/src/system_config/default/system_init.c @@ -0,0 +1,210 @@ +/*******************************************************************************
+ System Initialization File
+
+ File Name:
+ system_init.c
+
+ Summary:
+ This file contains source code necessary to initialize the system.
+
+ Description:
+ This file contains source code necessary to initialize the system. It
+ implements the "SYS_Initialize" function, defines the configuration bits,
+ and allocates any necessary global system resources, such as the
+ sysObj structure that contains the object handles to all the MPLAB Harmony
+ module objects in the system.
+ *******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+ *******************************************************************************/
+// DOM-IGNORE-END
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Included Files
+// *****************************************************************************
+// *****************************************************************************
+
+#include "system_config.h"
+#include "system_definitions.h"
+
+
+// ****************************************************************************
+// ****************************************************************************
+// Section: Configuration Bits
+// ****************************************************************************
+// ****************************************************************************
+// <editor-fold defaultstate="collapsed" desc="Configuration Bits">
+
+/*** DEVCFG0 ***/
+
+#pragma config DEBUG = OFF
+#pragma config JTAGEN = OFF
+#pragma config ICESEL = ICS_PGx1
+#pragma config TRCEN = ON
+#pragma config BOOTISA = MIPS32
+#pragma config FECCCON = OFF_UNLOCKED
+#pragma config FSLEEP = OFF
+#pragma config DBGPER = PG_ALL
+#pragma config EJTAGBEN = NORMAL
+#pragma config CP = OFF
+
+/*** DEVCFG1 ***/
+
+#pragma config FNOSC = SPLL
+#pragma config DMTINTV = WIN_127_128
+#pragma config FSOSCEN = OFF
+#pragma config IESO = ON
+#pragma config POSCMOD = OFF
+#pragma config OSCIOFNC = OFF
+#pragma config FCKSM = CSECME
+#pragma config WDTPS = PS1048576
+#pragma config WDTSPGM = STOP
+#pragma config FWDTEN = OFF
+#pragma config WINDIS = NORMAL
+#pragma config FWDTWINSZ = WINSZ_25
+#pragma config DMTCNT = DMT31
+#pragma config FDMTEN = OFF
+
+/*** DEVCFG2 ***/
+
+#pragma config FPLLIDIV = DIV_1
+#pragma config FPLLRNG = RANGE_5_10_MHZ
+#pragma config FPLLICLK = PLL_FRC
+#pragma config FPLLMULT = MUL_80
+#pragma config FPLLODIV = DIV_8
+#pragma config UPLLFSEL = FREQ_12MHZ
+#pragma config UPLLEN = OFF
+
+/*** DEVCFG3 ***/
+
+#pragma config USERID = 0xffff
+#pragma config FMIIEN = ON
+#pragma config FETHIO = OFF
+#pragma config PGL1WAY = ON
+#pragma config PMDL1WAY = ON
+#pragma config IOL1WAY = ON
+#pragma config FUSBIDIO = OFF
+
+/*** BF1SEQ0 ***/
+
+#pragma config TSEQ = 0xffff
+#pragma config CSEQ = 0xffff
+// </editor-fold>
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Library/Stack Initialization Data
+// *****************************************************************************
+// *****************************************************************************
+
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Driver Initialization Data
+// *****************************************************************************
+// *****************************************************************************
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: System Data
+// *****************************************************************************
+// *****************************************************************************
+
+/* Structure to hold the object handles for the modules in the system. */
+SYSTEM_OBJECTS sysObj;
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Module Initialization Data
+// *****************************************************************************
+// *****************************************************************************
+
+/*******************************************************************************
+ Device Control System Service Initialization Data
+
+ <editor-fold defaultstate="collapsed"
+ desc="Device Control System Service Initialization Data">
+*/
+
+const SYS_DEVCON_INIT sysDevconInit =
+{
+ .moduleInit = {0},
+};
+
+// </editor-fold>
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Static Initialization Functions
+// *****************************************************************************
+// *****************************************************************************
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: System Initialization
+// *****************************************************************************
+// *****************************************************************************
+
+/*******************************************************************************
+ Function:
+ void SYS_Initialize ( SYS_INIT_DATA *data )
+
+ Summary:
+ Initializes the board, services, drivers, application and other modules.
+
+ Remarks:
+ See prototype in system/common/sys_module.h.
+ */
+
+void SYS_Initialize ( void* data )
+{
+ /* Core Processor Initialization */
+ SYS_CLK_Initialize( NULL );
+ sysObj.sysDevcon = SYS_DEVCON_Initialize(SYS_DEVCON_INDEX_0, (SYS_MODULE_INIT*)&sysDevconInit);
+ SYS_DEVCON_PerformanceConfig(SYS_CLK_SystemFrequencyGet());
+ SYS_PORTS_Initialize();
+
+ /* Initialize Drivers */
+
+ /* Initialize System Services */
+
+ /* Initialize Middleware */
+
+ /* Initialize the Application */
+ APP_Initialize();
+}
+
+
+/*******************************************************************************
+ End of File
+*/
+
diff --git a/firmware/src/system_config/default/system_interrupt.c b/firmware/src/system_config/default/system_interrupt.c new file mode 100644 index 0000000..a676c11 --- /dev/null +++ b/firmware/src/system_config/default/system_interrupt.c @@ -0,0 +1,77 @@ +/*******************************************************************************
+ System Interrupts File
+
+ File Name:
+ system_int.c
+
+ Summary:
+ Raw ISR definitions.
+
+ Description:
+ This file contains a definitions of the raw ISRs required to support the
+ interrupt sub-system.
+
+ Summary:
+ This file contains source code for the interrupt vector functions in the
+ system.
+
+ Description:
+ This file contains source code for the interrupt vector functions in the
+ system. It implements the system and part specific vector "stub" functions
+ from which the individual "Tasks" functions are called for any modules
+ executing interrupt-driven in the MPLAB Harmony system.
+
+ Remarks:
+ This file requires access to the systemObjects global data structure that
+ contains the object handles to all MPLAB Harmony module objects executing
+ interrupt-driven in the system. These handles are passed into the individual
+ module "Tasks" functions to identify the instance of the module to maintain.
+ *******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2011-2014 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+ *******************************************************************************/
+// DOM-IGNORE-END
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Included Files
+// *****************************************************************************
+// *****************************************************************************
+
+#include <xc.h>
+#include <sys/attribs.h>
+#include "app.h"
+#include "system_definitions.h"
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: System Interrupt Vector Functions
+// *****************************************************************************
+// *****************************************************************************
+
+/*******************************************************************************
+ End of File
+*/
+
diff --git a/firmware/src/system_config/default/system_tasks.c b/firmware/src/system_config/default/system_tasks.c new file mode 100644 index 0000000..14c834d --- /dev/null +++ b/firmware/src/system_config/default/system_tasks.c @@ -0,0 +1,91 @@ +/*******************************************************************************
+ System Tasks File
+
+ File Name:
+ system_tasks.c
+
+ Summary:
+ This file contains source code necessary to maintain system's polled state
+ machines.
+
+ Description:
+ This file contains source code necessary to maintain system's polled state
+ machines. It implements the "SYS_Tasks" function that calls the individual
+ "Tasks" functions for all polled MPLAB Harmony modules in the system.
+
+ Remarks:
+ This file requires access to the systemObjects global data structure that
+ contains the object handles to all MPLAB Harmony module objects executing
+ polled in the system. These handles are passed into the individual module
+ "Tasks" functions to identify the instance of the module to maintain.
+ *******************************************************************************/
+
+// DOM-IGNORE-BEGIN
+/*******************************************************************************
+Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
+
+Microchip licenses to you the right to use, modify, copy and distribute
+Software only when embedded on a Microchip microcontroller or digital signal
+controller that is integrated into your product or third party product
+(pursuant to the sublicense terms in the accompanying license agreement).
+
+You should refer to the license agreement accompanying this Software for
+additional information regarding your rights and obligations.
+
+SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
+EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
+MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
+IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
+CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
+OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
+INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
+CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
+SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
+(INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
+ *******************************************************************************/
+// DOM-IGNORE-END
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: Included Files
+// *****************************************************************************
+// *****************************************************************************
+
+#include "system_config.h"
+#include "system_definitions.h"
+
+
+// *****************************************************************************
+// *****************************************************************************
+// Section: System "Tasks" Routine
+// *****************************************************************************
+// *****************************************************************************
+
+/*******************************************************************************
+ Function:
+ void SYS_Tasks ( void )
+
+ Remarks:
+ See prototype in system/common/sys_module.h.
+*/
+
+void SYS_Tasks ( void )
+{
+ /* Maintain system services */
+ SYS_DEVCON_Tasks(sysObj.sysDevcon);
+
+ /* Maintain Device Drivers */
+
+ /* Maintain Middleware & Other Libraries */
+
+
+ /* Maintain the application's state machine. */
+ APP_Tasks();
+}
+
+
+/*******************************************************************************
+ End of File
+ */
+
|