aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.UI/ViewsContracts/IMachineSetupView.cs
blob: 65b194f7b65ef1de40895720b98d6f2955249c76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.PPC.Common;
using static Tango.PPC.UI.ViewModels.MachineSetupViewVM;

namespace Tango.PPC.UI.ViewsContracts
{
    /// <summary>
    /// Represents the machine setup view contract.
    /// </summary>
    /// <seealso cref="Tango.PPC.Common.IPPCView" />
    public interface IMachineSetupView : IPPCView
    {
        /// <summary>
        /// Appends the log.
        /// </summary>
        /// <param name="log">The log.</param>
        void AppendLog(String log);

        /// <summary>
        /// Navigates to the specified machine setup view.
        /// </summary>
        /// <param name="view">The view.</param>
        Task NavigateTo(MachineSetupView view);
    }
}
.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#include <Container.h>
#include "include.h"
/*#include <stdbool.h>
#include <stdio.h>
#include <xdc/runtime/System.h>
#include <ti/sysbios/BIOS.h>
#include <ti/sysbios/knl/Task.h>
//#include <ti/drivers/USBMSCHFatFs.h>
#include <driverlib/sysctl.h>
#include <driverlib/interrupt.h>
#include <driverlib/rom_map.h>
#include <ti/sysbios/knl/Semaphore.h>
*/
#include <driverlib/sysctl.h>
#include "Drivers/USB_Communication/USBCDCD.h"
#include "Drivers/I2C_Communication/I2C.h"
#include "PMR/common/MessageContainer.pb-c.h"
#include "Common/Sys_PinOut_Config/Pin.h"
#include "Common/Sys_PinOut_Config/Pin_config.h"
#include "Common/utilities/idle_task.h"
#include "Drivers/ADC_Sampling/ADC.h"
#include "Drivers/Peripheral_GPIO/GPIO.h"
#include "drivers/Heater/Heater.h"
#include "drivers/Motors/Motor.h"

#include "Communication/CommunicationTask.h"

#include "drivers/twine_graphicslib/graphics_adapter.h"
#include <drivers/Flash_Memory/Flash_Memory.h>
#include <DataDef.h>
#include "Sys_PinOut_Config/MCU_MAIN_pinout.h"

/*
#include "Drivers/SPI_SDCARD/SDSPI.h"
#include "Drivers/SPI_SDCARD/SDCardSPI.h"
#include "Drivers/Ethernet_Config/EMACCommon.h"
#include "Drivers/USBStick_FileSys/USBstick.h"
#include "Drivers/USBStick_FileSys/USBMSCHFatFs.h"
*/
#include "Modules/Control/control.h"
#include "Modules/Heaters/Heaters_ex.h"
#include "StateMachines/Printing/PrintingSTM.h"
extern Semaphore_Handle sdCardSem;


#include "drivers/Danser_SSI/SSI_Comm.h"
#include "drivers/SPI/SPI_Comm.h"
#include "drivers/Uart_Comm/Uart.h"

#include "drivers/FPGA/FPGA.h"
#include <drivers/FPGA/FPGA_Comm.h>

#include <Drivers/I2C_Communication/Previous_Code/I2C.h>
#include "Drivers/I2C_Communication/I2C.h"




//#define WATCHDOG
//*****************************************************************************
//
// The system tick rate expressed both as ticks per second and a millisecond
// period.
//
//*****************************************************************************
#define TICKS_PER_SECOND        1000

//*****************************************************************************
//
// Global system tick counter
//
//*****************************************************************************
static volatile uint32_t g_ui32SysTickCount = 0;

// Flags used to pass commands from interrupt context to the main loop.
static volatile uint32_t g_ui32Flags;

//MessageContainer createContainer(MessageType type, char* token, protobuf_c_boolean completed, void* response, size_t (*packPtr)(void*, uint8_t*), size_t (*sizePtr)(void*));

//*****************************************************************************
//
// Interrupt handler for the system tick counter.
//
//*****************************************************************************
void SysTickHandler(void)
{
    // Update our system time.
    g_ui32SysTickCount++;
}

void Init_EVB()
{

    InitPinOutPullUps();

    #ifdef Stub_Mode
    //MOTOR Driver L6470 SPI
    SPI2_Init();
    init_BUSY_Pin();

    //Danser_ENC:
    SSI1_Init(); // Read dancer ENC SSI

    #endif

}

int main(void)
{
    // Enable interrupts to the processor.
    //
    ROM_IntMasterDisable();
	//Set the clock 120MHz
	uint32_t ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ | SYSCTL_OSC_MAIN | SYSCTL_USE_PLL | SYSCTL_CFG_VCO_480), SYS_CLK_FREQ);

    // Set the system clock to run at 120MHz from the PLL.

    // Save the PLL rate used by this application.
    //SysCtlVCOGet(SYSCTL_XTAL_25MHZ, &ui32PLLRate);

    // Enable the system tick.
    ROM_SysTickPeriodSet(ui32SysClock / TICKS_PER_SECOND);
    ROM_SysTickIntEnable();
    ROM_SysTickEnable();

	PortFunctionInit();
    #ifdef EVALUATION_BOARD
        Init_EVB();
    #endif
	//InitI2C();
    Init_All_I2C();

    #ifndef EVALUATION_BOARD
        STATUS_GREEN_LED_ON;
	    FPGA_Init();
    #endif


	//ROM_GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE, GPIO_PIN_7); // set PQ7 to output (Green LED)
	//ROM_GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE, GPIO_PIN_4); // set PQ4 to output (Blue LED)
	//ROM_GPIOPinTypeGPIOOutput(GPIO_PORTN_BASE, GPIO_PIN_5); // set PN5 to output (RED LED)
    //ROM_GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE, GPIO_PIN_2); // set PN5 to output (RED LED)
    //ROM_GPIOPinTypeGPIOOutput(GPIO_PORTH_BASE, GPIO_PIN_3); // set PN5 to output (RED LED)
	//DeActivateHeater(0);
	//DeActivateHeater(1);
    //ROM_IntDisable(INT_ADC0SS0);

    //FlashFS_Init();
	//
	// Enable lazy stacking for interrupt handlers.  This allows floating-point
	// instructions to be used within interrupt handlers, but at the expense of
	// extra stack usage.
	//
	MAP_FPULazyStackingEnable();

    SysCtlUSBPLLEnable();

#ifdef WATCHDOG
	InitWatchdog(ui32SysClock);
#endif

	CommunicationTaskInit();
	utilsInit(ui32SysClock);
	MotorsInit();
//    init_graphics(ui32SysClock);
//    clear();

    //messageHostInit();
	//InitUSBMSCHFatFs();

    //----------------------------------------------------------
   // Debug_Start_PT00(); // temporary ------------------------------

	//F3_GPO_01_bus |= BIT1; // FPGA LED
	//F3_GPO_01_bus &= ~BIT0;

	//FPGA_SensorInitConfig();

	//test_fpga_gpi();

	//FPGA_Read_limit_Switches_Registers();
	//test_fpga_gpi();
	//Run_I2C(/*ui32SysClock*/);

    //-----------------------------------------------------------

	//EMAC_initEMAC();
    ControlInit();
    Heaters_Init();
	//LoadManual();
	//Semaphore_post(sdCardSem);

    RegisterReceiveCallback(&receive_callback);
    //StartUSB(ui32SysClock);

    // Enable interrupts to the processor.
    //
    ROM_IntMasterEnable();


    IDLE_TASK_package_init();

    //ControlStart();

    BIOS_start();

    return (0);
    //while(1){};
}