コード例 #1
0
void Usual_Routine() {
	InitializeStack();
	OSChangePrio (MAIN_PRIO);
	EnableAutoUpdate();
	EnableTaskMonitor();
	EnableSmartTraps();
	initPINS();
	DSPIInit(3, 2000000, 16, 0x00, 1, 1, 1, 0, 0, 0); //Initializing the Hardware to talk to IMU
}
コード例 #2
0
void Usual_Routine() {
	InitializeStack();
	OSChangePrio(MAIN_PRIO);
	EnableAutoUpdate();
	EnableTaskMonitor();
	EnableSmartTraps();
	initPINS();

	J2[32] = 1; //Resets the OSD

	OSTimeDly(2);

	DSPIInit(3, 2000000, 16, 0x00, 1, 1, 1, 0, 0, 0); //Initializing the Hardware to talk to IMU
	DSPIInit(1, 2000000, 16, 0x00, 0x01, 0, 0, 0, 0, 0); //Initializing the Hardware to talk to OSD

	/***********************************Initializing Initial Artificial Horizon*****************************************************************/

	uint16_t x = 2834; //Center Position of the Center Circle
	Display_Center(x); //Displaying the Center, argument center address
	Display_Data(); //Initializing Pitch and Roll value Display
}
コード例 #3
0
ADC::ADC(int dspiChannelInput) {



	int SPIPins[12] = { 33, 35, 15, 31,  //SPI1
						24, 26, 28, 30,  //SPI2
						32, 34, 36, 38}; //SPI3
	Pins[SPIPins[(dspiChannelInput - 1) * 4 + 0]].function(1); //SPI Input
	Pins[SPIPins[(dspiChannelInput - 1) * 4 + 1]].function(1); //SPI Out
	Pins[SPIPins[(dspiChannelInput - 1) * 4 + 2]].function(1); //SPI chip select 0
	Pins[SPIPins[(dspiChannelInput - 1) * 4 + 3]].function(1); //SPI clock

	dspiChannel = dspiChannelInput;
	/*
	for (int i = 0; i < size; i++)
		table[i] = 0;
	*/

	OSSemInit(&SPISEM, 0);

	DSPIInit(dspiChannel, ADCdspiBaudRate, ADCtransferSizeBits, ADCChipSelects,
			 ADCCSPolarityIdle, ADCClockPolarity, 1, 1, 100, 0, false);

}
コード例 #4
0
void initDSPI(){
	DSPIInit(3,2000000,16,0x01,1,1,1,0,0,0);//initializing SPI IMU4
	DSPIInit(1,2000000,16,0x01,1,1,1,0,0,0);//initializing SPI IMU3
}