當前位置: 首頁>>代碼示例>>C++>>正文


C++ ADCSequenceEnable函數代碼示例

本文整理匯總了C++中ADCSequenceEnable函數的典型用法代碼示例。如果您正苦於以下問題:C++ ADCSequenceEnable函數的具體用法?C++ ADCSequenceEnable怎麽用?C++ ADCSequenceEnable使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了ADCSequenceEnable函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: hardware_init

//---------------------------------------------------------------------------
// hardware_init()
//
// inits GPIO pins for toggling the LED
//---------------------------------------------------------------------------
void hardware_init(void)
{

	//Set CPU Clock to 40MHz. 400MHz PLL/2 = 200 DIV 5 = 40MHz
	SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);

		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);
		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
		SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);

		//Removing Locks From Switch
					LOCK_F=0x4C4F434B;
					CR_F=GPIO_PIN_0|GPIO_PIN_4;

	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOC);

	GPIOPinTypeADC(GPIO_PORTD_BASE, GPIO_PIN_0);            // Configuring PD0 as ADC input (channel 1)     CH7 ADC0
	GPIOPinTypeADC(GPIO_PORTD_BASE, GPIO_PIN_1);

	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC1);

	ADCSequenceConfigure(ADC0_BASE,	1, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceConfigure(ADC1_BASE,	1, ADC_TRIGGER_PROCESSOR, 0);

	ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_CH7);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_CH7);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_CH7);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 3, ADC_CTL_CH7 | ADC_CTL_IE | ADC_CTL_END);

	ADCSequenceStepConfigure(ADC1_BASE, 1, 0, ADC_CTL_CH6);
	ADCSequenceStepConfigure(ADC1_BASE, 1, 1, ADC_CTL_CH6);
	ADCSequenceStepConfigure(ADC1_BASE, 1, 2, ADC_CTL_CH6);
	ADCSequenceStepConfigure(ADC1_BASE, 1, 3, ADC_CTL_CH6 | ADC_CTL_IE | ADC_CTL_END);

	ADCSequenceEnable(ADC0_BASE, 1);
	ADCSequenceEnable(ADC1_BASE, 1);
	ADCIntClear(ADC0_BASE, 1);
	ADCIntClear(ADC1_BASE, 1);

	GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);
		GPIOPinTypeGPIOOutput(GPIO_PORTC_BASE, GPIO_PIN_4 | GPIO_PIN_6);
		GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_3);
		GPIOPinTypeGPIOOutput(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_5);
		GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0);
		//GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_4 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7);

		GPIOPinWrite(GPIO_PORTC_BASE, GPIO_PIN_4,0x10);

}
開發者ID:dealsndime,項目名稱:CS684--2016,代碼行數:57,代碼來源:main.c

示例2: initADCPorts

void initADCPorts(void) {
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC);
	ADCSequenceConfigure(ADC_BASE,0, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceConfigure(ADC_BASE,1, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceConfigure(ADC_BASE,2, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceConfigure(ADC_BASE,3, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceStepConfigure(ADC_BASE, 0, 0, ADC_CTL_CH0 | ADC_CTL_IE | ADC_CTL_END);
	ADCSequenceStepConfigure(ADC_BASE, 1, 0, ADC_CTL_CH1 | ADC_CTL_IE | ADC_CTL_END);
	ADCSequenceStepConfigure(ADC_BASE, 2, 0, ADC_CTL_CH2 | ADC_CTL_IE | ADC_CTL_END);
	ADCSequenceStepConfigure(ADC_BASE, 3, 0, ADC_CTL_CH3 | ADC_CTL_IE | ADC_CTL_END);
	ADCSequenceEnable(ADC_BASE, 0);
	ADCSequenceEnable(ADC_BASE, 1);
	ADCSequenceEnable(ADC_BASE, 2);
	ADCSequenceEnable(ADC_BASE, 3);
}
開發者ID:RAS-MoFos,項目名稱:Rasware2012,代碼行數:15,代碼來源:Nav.c

示例3: confADC

void confADC(){



	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);   // Habilita ADC0
	SysCtlPeripheralSleepEnable(SYSCTL_PERIPH_ADC0);
	ADCSequenceDisable(ADC0_BASE,0); // Deshabilita el secuenciador 1 del ADC0 para su configuracion


	HWREG(ADC0_BASE + ADC_O_PC) = (ADC_PC_SR_500K);	// usar en lugar de SysCtlADCSpeedSet
	ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_TIMER, 0);// Disparo de muestreo por instrucciones de Timer
	ADCHardwareOversampleConfigure(ADC0_BASE, 64); //SobreMuestreo de 64 muestras

	// Configuramos los 4 conversores del secuenciador 1 para muestreo del sensor de temperatura
	ADCSequenceStepConfigure(ADC0_BASE, 0, 0, ADC_CTL_CH0); //Sequencer Step 0: Samples Channel PE3
	ADCSequenceStepConfigure(ADC0_BASE, 0, 1, ADC_CTL_CH1); //Sequencer Step 1: Samples Channel PE2
	ADCSequenceStepConfigure(ADC0_BASE, 0, 2, ADC_CTL_CH2 | ADC_CTL_IE | ADC_CTL_END); //Sequencer Step 2: Samples Channel PE1

	IntPrioritySet(INT_ADC0SS0,5<<5);
	// Tras configurar el secuenciador, se vuelve a habilitar
	ADCSequenceEnable(ADC0_BASE, 0);
	//Asociamos la funcion a la interrupcion
	ADCIntRegister(ADC0_BASE, 0,ADCIntHandler);

	//Activamos las interrupciones
	ADCIntEnable(ADC0_BASE,0);


}
開發者ID:joseayebenes,項目名稱:TivaFly,代碼行數:29,代碼來源:main.c

示例4: SampleLightCO

void SampleLightCO(void){
	
	unsigned long ulADC0_Value[1];
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
	GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_3);
	ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH0 | ADC_CTL_IE |
	ADC_CTL_END);
	ADCSequenceEnable(ADC0_BASE, 3);
	ADCIntClear(ADC0_BASE, 3);

	while(1){
		ADCProcessorTrigger(ADC0_BASE, 3);
		while(!ADCIntStatus(ADC0_BASE, 3, false)){
		}
		ADCIntClear(ADC0_BASE, 3);
		ADCSequenceDataGet(ADC0_BASE, 3, ulADC0_Value);
		
		Log("Breath Level = ");
		LogD(ulADC0_Value[0]);
		Log("\r");

		SysCtlDelay(SysCtlClockGet() / 12);
	}
}
開發者ID:ThaiDoWave,項目名稱:seniordesign,代碼行數:26,代碼來源:piezo.c

示例5: Init_ADC

/*
 * 初始化ADC引腳和配置
 * 其中ADC0的輸入引腳配置為CH1,ADC1的輸入引腳配置為CH2
 */
void Init_ADC()
{
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
	GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_1);
	GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_2);

	ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
    ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH1 | ADC_CTL_IE | ADC_CTL_END);
    ADCSequenceEnable(ADC0_BASE, 3);
    ADCIntClear(ADC0_BASE, 3);

	ADCSequenceConfigure(ADC1_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);
    ADCSequenceStepConfigure(ADC1_BASE, 3, 0, ADC_CTL_CH2 | ADC_CTL_IE | ADC_CTL_END);
    ADCSequenceEnable(ADC1_BASE, 3);
    ADCIntClear(ADC1_BASE, 3);
}
開發者ID:authuir,項目名稱:TivaEthernet,代碼行數:20,代碼來源:ADC.c

示例6: main

int main(void) {
    SysCtlClockSet(
    SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

    UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC);
    UARTStdioConfig(0, 115200, 16000000);

    ADCSequenceDisable(ADC0_BASE, 1);
    ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS);
    ADCSequenceStepConfigure(ADC0_BASE, 1, 3,
    ADC_CTL_TS | ADC_CTL_IE | ADC_CTL_END);
    ADCSequenceEnable(ADC0_BASE, 1);

    UARTprintf("This is ADC examlpe");

    while (1) {
        UARTprintf("Temperature is: %d \210 C\n", ADC_getVal());
        SysCtlDelay(40000000 / 3);
    }
}
開發者ID:datho1801,項目名稱:TivaC_TUT,代碼行數:30,代碼來源:main.c

示例7: initADC

//******************************************************************************
void initADC (void)
{
  // The ADC0 peripheral must be enabled for configuration and use.
  SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);

  // Enable sample sequence 3 with a processor signal trigger.  Sequence 3
  // will do a single sample when the processor sends a signal to start the
  // conversion.
  ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);

  // Configure step 0 on sequence 3.  Sample channel 0 (ADC_CTL_CH0) in
  // single-ended mode (default) and configure the interrupt flag
  // (ADC_CTL_IE) to be set when the sample is done.  Tell the ADC logic
  // that this is the last conversion on sequence 3 (ADC_CTL_END).  Sequence
  // 3 has only one programmable step.  Sequence 1 and 2 have 4 steps, and
  // sequence 0 has 8 programmable steps.  Since we are only doing a single
  // conversion using sequence 3 we will only configure step 0.  For more
  // on the ADC sequences and steps, refer to the LM3S1968 datasheet.
  ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH0 | ADC_CTL_IE |
                             ADC_CTL_END);

  // Since sample sequence 3 is now configured, it must be enabled.
  ADCSequenceEnable(ADC0_BASE, 3);

  // Register the interrupt handler
  ADCIntRegister (ADC0_BASE, 3, HeightIntHandler);

  // Enable interrupts for ADC0 sequence 3 (clears any outstanding interrupts)
  ADCIntEnable(ADC0_BASE, 3);
}
開發者ID:Yamoahs,項目名稱:ENCE361_Helicopter_project,代碼行數:31,代碼來源:Copy+of+milestone2_MotorControl(PID)4.c

示例8: main

int main(void) {
	SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_SYSDIV_5| SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	GPIOPinConfigure(GPIO_PA0_U0RX);
	GPIOPinConfigure(GPIO_PA1_U0TX);
	GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
	ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE,1,3,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END);
	ADCSequenceEnable(ADC0_BASE, 1);
	UARTConfigSetExpClk(UART0_BASE, SysCtlClockGet(), 115200,
			(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE));

	ledPinConfig();
	while (1)
	{
		Test2();
		//print_temc();
		SysCtlDelay(SysCtlClockGet()/3);

	}
}
開發者ID:CS308-2016,項目名稱:BinC,代碼行數:27,代碼來源:main.c

示例9: adc_init_and_run

void adc_init_and_run(void){
	// Тактирование выбранного модуля АЦП.
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADCx);

	// Ожидание готовности выбранного модуля АЦП к настройке.
	while(!SysCtlPeripheralReady(SYSCTL_PERIPH_ADCx)) { }

	ADCHardwareOversampleConfigure(ADCx_BASE, 4);

	// Установка триггера выбранного буфера АЦП.
	ADCSequenceConfigure(ADCx_BASE, SSy, ADC_TRIGGER, 0);

	ADCSequenceStepConfigure(ADCx_BASE, SSy, 0, ADC_CTL_CH0);
	ADCSequenceStepConfigure(
		ADCx_BASE, SSy, 1, ADC_CTL_CH1|ADC_CTL_IE|ADC_CTL_END
	);

	ADCIntClear(ADCx_BASE, SSy);

	IntEnable(INT_ADCxSSy);
	IntPrioritySet(INT_ADCxSSy, 1);

	ADCSequenceEnable(ADCx_BASE, SSy);
	ADCProcessorTrigger(ADCx_BASE, SSy);
}
開發者ID:andrew-merzlaikov,項目名稱:smart_house,代碼行數:25,代碼來源:adc_setup.c

示例10: ADC_In

unsigned long ADC_In(unsigned int channelNum){

  unsigned long config;
  unsigned long data;

  // Configuring ADC to start by processor call instead of interrupt
  ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);

  // Determine input channel
  switch(channelNum){
    case 0: config = ADC_CTL_CH0; break;
	case 1: config = ADC_CTL_CH1; break;
	case 2: config = ADC_CTL_CH2; break;
	case 3: config = ADC_CTL_CH3; break;
  } 

  // Enable ADC interrupt and last step of sequence
  config |= ADC_CTL_IE | ADC_CTL_END;
  ADCSequenceStepConfigure(ADC0_BASE, 3, 0, config);

  ADCSequenceEnable(ADC0_BASE, 3);
  ADCIntClear(ADC0_BASE, 3);

  // Start ADC conversion
  ADCProcessorTrigger(ADC0_BASE, 3);

  // Wait for ADC conversion to finish
  while(!ADCIntStatus(ADC0_BASE, 3, false)){}

  // Clear interrupt flag and read conversion data
  ADCIntClear(ADC0_BASE, 3);
  ADCSequenceDataGet(ADC0_BASE, 3, &data);

  return data;
}
開發者ID:tach4455,項目名稱:EE345M,代碼行數:35,代碼來源:ADC.c

示例11: main

int main(void)
{

    SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
    GPIOPinTypeADC(GPIO_PORTB_BASE, GPIO_PIN_5);
    GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_5);

    ADCSequenceConfigure(ADC0_BASE, 2, ADC_TRIGGER_PROCESSOR, 0);
    ADCSequenceStepConfigure(ADC0_BASE, 2, 0, ADC_CTL_CH8);
    ADCSequenceStepConfigure(ADC0_BASE, 2, 1, ADC_CTL_CH11 | ADC_CTL_IE | ADC_CTL_END);
    ADCSequenceEnable(ADC0_BASE, 2);
    ADCIntClear(ADC0_BASE, 2);

    while(1)
    {
        ADCProcessorTrigger(ADC0_BASE, 2);
        while(!ADCIntStatus(ADC0_BASE, 2, false));
        ADCIntClear(ADC0_BASE, 2);
        ADCSequenceDataGet(ADC0_BASE, 2, adcValue);
        SysCtlDelay(SysCtlClockGet() / 12);
    }
}
開發者ID:anshuman94,項目名稱:StarShipXP,代碼行數:26,代碼來源:main.c

示例12: adc_init

//   ADC初始化
void
adc_init(void)
{
    SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC); //使能ADC模塊
    SysCtlADCSpeedSet(SYSCTL_ADCSPEED_500KSPS); //設置ADC采樣速率
    ADCSequenceDisable(ADC_BASE, 0); // 配置前先禁止采樣序列

    ADCSequenceConfigure(ADC_BASE, 0, ADC_TRIGGER_PROCESSOR, 0);
    //配置ADC采樣序列的觸發事件和優先級:ADC基址,采樣序列編號,觸發事件,采樣優先級
    ADCSequenceStepConfigure(ADC_BASE, 0, 0,
            ADC_CTL_END | ADC_CTL_CH0 | ADC_CTL_IE);

    //配置ADC采樣序列發生器的步進 :ADC基址,采樣序列編號,步值,通道設置

    intConnect(INT_ADC0, ADC_Sequence_0_ISR, 0u);
    ADCIntEnable(ADC_BASE, 0); //使能ADC采樣序列的中斷
//    IntEnable(INT_ADC0); // 使能ADC采樣序列中斷
    intEnable(INT_ADC0);
    IntMasterEnable(); // 使能處理器中斷

    ADCSequenceEnable(ADC_BASE, 0); // 使能一個ADC采樣序列
    the_lock = semBCreate(0);
//    printf("%x\n", the_lock);

}
開發者ID:liuning587,項目名稱:rtos_811,代碼行數:26,代碼來源:bsp.c

示例13: main

int main(void)
{
	uint32_t ui32ADC0Value[4];
	volatile uint32_t ui32TempAvg;
	volatile uint32_t ui32TempValueC;
	volatile uint32_t ui32TempValueF;

	setup();

	ADCSequenceConfigure(ADC0_BASE, 1, ADC_TRIGGER_PROCESSOR, 0);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 0, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 1, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE, 1, 2, ADC_CTL_TS);
	ADCSequenceStepConfigure(ADC0_BASE,1,3,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END);
	ADCSequenceEnable(ADC0_BASE, 1);

	while(1)
	{
		ADCIntClear(ADC0_BASE, 1);
		ADCProcessorTrigger(ADC0_BASE, 1);

		while(!ADCIntStatus(ADC0_BASE, 1, false))
		{
		}
		ADCSequenceDataGet(ADC0_BASE, 1, ui32ADC0Value);
		ui32TempAvg = (ui32ADC0Value[0] + ui32ADC0Value[1] + ui32ADC0Value[2] + ui32ADC0Value[3] + 2)/4;
		ui32TempValueC = (1475 - ((2475 * ui32TempAvg)) / 4096)/10;
		ui32TempValueF = ((ui32TempValueC * 9) + 160) / 5;


	}

}
開發者ID:dipteshkanojia,項目名稱:CS684-2016,代碼行數:33,代碼來源:example.c

示例14: Init_ADC0

//模數轉換初始化
void Init_ADC0(void)
{
	//使能ADC0模塊
	SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);

	//配置前先關閉序列0
	//ADCSequenceDisable (unsigned long ulBase, unsigned long ulSequenceNum) 
	ADCSequenceDisable(ADC0_BASE,0);

	//配置SS0:由CPU軟件觸發,優先級0(最高)
	//ADCSequenceConfigure(unsigned long ulBase,unsigned long ulSequenceNum, unsigned long ulTrigger, unsigned long ulPriority)
	ADCSequenceConfigure(ADC0_BASE,0,ADC_TRIGGER_PROCESSOR,0);

	//配置序列裏麵的每一個成員配置輸入通道,是否中斷,是否最後采樣.本例序列中隻有一個采樣:ulstep=0,來自內置溫度傳感器TS
	//ADCSequenceStepConfigure(unsigned long ulBase,unsigned long ulSequenceNum,unsigned long ulStep,unsigned long ulConfig)
	ADCSequenceStepConfigure(ADC0_BASE,0,0,ADC_CTL_TS|ADC_CTL_IE|ADC_CTL_END);

	//使能模塊中斷
	//ADCIntEnable (unsigned long ulBase, unsigned long ulSequenceNum)
	ADCIntEnable(ADC0_BASE,0);

	//在NVIC中使能ADC中斷
	IntEnable(INT_ADC0);

	//使能序列0
	//ADCSequenceEnable (unsigned long ulBase, unsigned long ulSequenceNum)
	ADCSequenceEnable(ADC0_BASE,0);
}
開發者ID:mybays,項目名稱:lm3s,代碼行數:29,代碼來源:main.c

示例15: ADCInit

//*****************************************************************************
//
//! Initializes the ADC control routines.
//!
//! This function initializes the ADC module and the control routines,
//! preparing them to monitor currents and voltages on the motor drive.
//!
//! \return None.
//
//*****************************************************************************
void
ADCInit(void)
{
    //
    // Set the speed of the ADC to 1 million samples per second.
    //
    SysCtlADCSpeedSet(SYSCTL_ADCSPEED_1MSPS);

    //
    // Configure sample sequence zero to capture all three motor phase
    // currents, the DC bus voltage, and the internal junction temperature.
    // The sample sequence is triggered by the signal from the PWM module.
    //
    ADCSequenceConfigure(ADC0_BASE, 0, ADC_TRIGGER_PWM0, 0);
    ADCSequenceStepConfigure(ADC0_BASE, 0, 0, PIN_I_PHASEU);
    ADCSequenceStepConfigure(ADC0_BASE, 0, 1, PIN_I_PHASEV);
    ADCSequenceStepConfigure(ADC0_BASE, 0, 2, PIN_I_PHASEW);
    ADCSequenceStepConfigure(ADC0_BASE, 0, 3, PIN_VSENSE);
    ADCSequenceStepConfigure(ADC0_BASE, 0, 4,
                             ADC_CTL_END | ADC_CTL_IE | ADC_CTL_TS);

    //
    // Enable sample sequence zero and its interrupt.
    //
    ADCSequenceEnable(ADC0_BASE,0);
    ADCIntEnable(ADC0_BASE, 0);
    IntEnable(INT_ADC0SS0);
}
開發者ID:VENGEL,項目名稱:StellarisWare,代碼行數:38,代碼來源:adc_ctrl.c


注:本文中的ADCSequenceEnable函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。