Exemple #1
0
static void prvSetupHardware( void )
{
            /* Set up SPI for display of speed, distance, temperature and total time*/
        setup_UART1();
        initialize_CLS();
      
        setup_SPI2();

        /* Set up switches for input triggers */
        setup_switches();
        /* Set up hbridge for the motor running */
        set_hbridge();

        /* Set up the input capture module to detect SA pulses of the motors */
        setup_IC2();
        setup_IC3();

        /* Set I2C to read temperature from Pmod Tmp2 */
        setup_I2C();

        /* Configure corresponding interrupts */
        configure_interrupts();

	/* Configure the hardware for maximum performance. */
	vHardwareConfigurePerformance();

	/* Setup to use the external interrupt controller. */
	vHardwareUseMultiVectoredInterrupts();

	portDISABLE_INTERRUPTS();

}
int main (void)
{
	unsigned int pb_clock = 0;
	unsigned char message[] = "Ready to receive...", data = '\0';


	// extern inline unsigned int __attribute__((always_inline)) SYSTEMConfigPerformance(unsigned int sys_clock)
	pb_clock = SYSTEMConfigPerformance (SYSTEM_CLOCK);


	setup_ports ();


	//Uncomment if using an additional UART to receive from:
	//setup_UART1 (pb_clock);
	setup_UART2( pb_clock);


	
	initialize_CLS ();


	putsUART2 (message);


	while (1)
	{
		//To receive from another UART and display on PmodCLS: 
		//uncomment and setup receiving UART.
		/*
		if (DataRdyUART1 ()) //Checks if data is available to be read from UART
		{
			data = ReadUART1 (); //Reads one character from UART
			putcUART2 (data); //Displays character onto PmodCLS
		}
		*/
	}


	return 0;
}