Esempio n. 1
0
void main(void)
{
/* USER CODE BEGIN (3) */
	gioInit();
	configure_initialize_node_a(FRAY1);
	Fr_StartCommunication(FRAY1);
	
	while(1)
	{
		transmit_check_node_a(FRAY1);

		/** - Call RUN LED routine that toggles NHET pin */
		run_LED_StartUp();

	}	
	
/* USER CODE END */
}
Esempio n. 2
0
/**
 * this is the functionality of the energia lib constructors
 */
void screenInit() {
    // LCD_screen::LCD_screen()
    _fontSize       = 0;
    _fontSolid      = true;
    _penSolid       = false;
    _flagRead       = false;
    _flagStorage    = false;

    // LCD_screen_font::LCD_screen_font()
    // empty

    // Screen_HX8353E::Screen_HX8353E()
    _portReset = gioPORTB;
    _pinReset = 3;
    _portDataCommand = gioPORTA;
    _pinDataCommand = 0;

    // I could move this to Begin(), because I'm doing more than initialising local variables
    gioInit();
}
Esempio n. 3
0
void main(void)
{
    /* USER CODE BEGIN (3) */
    int i;

    boolean retVal = true; //Execute 1Bit test
    //SL_SelfTest_Result flash_stResult;
    //retVal = SL_SelfTest_FEE(FEE_ECC_SYN_REPORT_MODE, TRUE, &flash_stResult);
    if(retVal)
    {
        gioInit();

        for (;;) {
            gioToggleBit(gioPORTB, 1);
            for (i = 0; i < DELAY_VALUE; i++);
        }
    }
    for (;;);
    /* USER CODE END */
}
Esempio n. 4
0
void main(void)
{
/* USER CODE BEGIN (3) */

	// Some declarations
	unsigned int vol_num, num_trigs, trig_time, m, n;
	FILE *TMS_data_file;

	// Initialize some variables used in ISRs and initialize hardware state.
	irq_count = 0;
	train_count = 0;
	trig_in_train_count = 0;
	TMS_trig_in_progress = 0;

	// Read data from a file containing all the TMS delivery information.
    TMS_data_file = fopen("C:\\Users\\BIC\\workspace_v6_0\\Blinky\\TMS_trig_files\\TMS_trig_data","r");
    if(TMS_data_file == NULL){
      printf("\n Can't open TMS_trig_data \n");
      fflush(stdout);
      exit (1);
    }

    m = 0;
    while(fscanf(TMS_data_file, "%u %u", &vol_num, &num_trigs) != EOF){
      // Read the volume number for trigger train and the number of triggers in the train.
      TMS[m].trig_image_vol = vol_num;
      TMS[m].num_trigs_in_train = num_trigs;
      for(n=0; n<num_trigs; n++){
        fscanf(TMS_data_file, "%u", &trig_time);
        TMS[m].trig_time[n] = trig_time - TRIG_TO_TMS_PULSE_DELAY;  // Account for TMS unit delays. See TMS_scanner_synch.h
                                                                    // for more detail about this delay.

      }
      m = m + 1;
    }
    fclose(TMS_data_file);
    printf ("Ready to send triggers to TMS unit. \n");
    fflush(stdout);

	// Initialize rti, gio and associated hardware interrupts.
	rtiInit();
	gioInit();
	gioSetDirection(hetPORT1, 0xFFFFFFFF);

	/* The following line sets pins A0 and A2 of GIO PORTA to output and pin A7 of
    GIO PORTA to input. A0 is used for output to the TMS unit. A7 is used for input
	from the MRI TTL pulse. A2 controls an LED, used for testing, on the board. */
	gioSetDirection(gioPORTA, 0x00000005);

	rtiEnableNotification(rtiNOTIFICATION_COMPARE0);
	_enable_interrupt_();
	_enable_IRQ();

	// Start the rti counter.
	rtiStartCounter(rtiCOUNTER_BLOCK0);  // !!!!! Wont need this since I will be starting the counter in the gioNotification ISR
	                                     // and since the counter must be stopped before the reset done in the gioNotification ISR.

	// Initialize hardware state.
	gioSetPort(hetPORT1, 0x00000000); // Set output to D11 LED initially to low.

	// Initialize prescaler so that time units will be microseconds. Using 99 sets
	// the base frequency to 100th of the 100MHz operating frequency. See above
	// lines which set pulse_length and scanner_irq_to_gio_out_delay times.
	rtiREG1->CNT[0U].CPUCx = 99;
	//printf ("RTICPUC0: %d \n", rtiREG1->CNT[0U].CPUCx);

	while(1);

/* USER CODE END */
}