当前位置: 首页>>代码示例>>C++>>正文


C++ ROM_SysCtlClockGet函数代码示例

本文整理汇总了C++中ROM_SysCtlClockGet函数的典型用法代码示例。如果您正苦于以下问题:C++ ROM_SysCtlClockGet函数的具体用法?C++ ROM_SysCtlClockGet怎么用?C++ ROM_SysCtlClockGet使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ROM_SysCtlClockGet函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main

//*****************************************************************************
//
// This example application demonstrates the use of the timers to generate
// periodic interrupts.
//
//*****************************************************************************
int
main(void)
{
    //
    // Set the clocking to run directly from the crystal.
    //
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);

    //
    // Initialize the UART and write status.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    GPIOPinConfigure(GPIO_PA0_U0RX);
    GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);
    UARTprintf("\033[2JTimers example\n");
    UARTprintf("T1: 0  T2: 0");

    //
    // Enable the peripherals used by this example.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);

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

    //
    // Configure the two 32-bit periodic timers.
    //
    ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
    ROM_TimerConfigure(TIMER1_BASE, TIMER_CFG_PERIODIC);
    ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet());
    ROM_TimerLoadSet(TIMER1_BASE, TIMER_A, ROM_SysCtlClockGet() / 2);

    //
    // Setup the interrupts for the timer timeouts.
    //
    ROM_IntEnable(INT_TIMER0A);
    ROM_IntEnable(INT_TIMER1A);
    ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
    ROM_TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);

    //
    // Enable the timers.
    //
    ROM_TimerEnable(TIMER0_BASE, TIMER_A);
    ROM_TimerEnable(TIMER1_BASE, TIMER_A);

    //
    // Loop forever while the timers run.
    //
    while(1)
    {
    }
}
开发者ID:Razofiter,项目名称:Luminary-Micro-Library,代码行数:66,代码来源:timers.c

示例2: board_init

void board_init(void) {
	uint32_t clockfreq;
	ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
                       SYSCTL_XTAL_16MHZ);

	board_configure_led();
	console_init();
	board_spi_init();
	board_systick_init();
	board_watchdog_init();	
	timer_example_timer_init();	
	
	clockfreq = ROM_SysCtlClockGet();
	delayloopspermicrosecond = (ROM_SysCtlClockGet() / (uint32_t) 1e6) / 3;
	delayloopspermillisecond = (ROM_SysCtlClockGet() / (uint32_t) 1e3) / 3;

	console_printtext("\n\n\n***** TM4C   scheduler *****\n");
	console_printtext("**  System clock: %d MHz  **\n", ROM_SysCtlClockGet() / (uint32_t) 1e6);
	console_printtext("* Type 'help' for commands *\n");
	if (clockfreq < 3e6)
		console_printtext("WARNING: System clock is below 3 MHz, board timing might be inaccurate!\n");
	else 
		console_printtext("\n");
	
	ROM_IntMasterEnable();
}
开发者ID:sgergo,项目名称:projecttiva,代码行数:26,代码来源:board.c

示例3: timerInit

void timerInit()
{

#if F_CPU >= 80000000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#elif F_CPU >= 50000000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#elif F_CPU >= 40000000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#elif F_CPU >= 25000000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_8|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#elif F_CPU >= 16200000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_1|SYSCTL_USE_OSC|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);	//NOT PLL
#elif F_CPU >= 16100000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_1|SYSCTL_USE_OSC|SYSCTL_OSC_INT|
                SYSCTL_OSC_MAIN);	//NOT PLL, INT OSC
#elif F_CPU >= 16000000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_12_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#elif F_CPU >= 10000000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_20|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#elif F_CPU >= 8000000
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_25|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#else
    ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
                SYSCTL_OSC_MAIN);
#endif

    //
    //  SysTick is used for delay() and delayMicroseconds()
    //
//	ROM_SysTickPeriodSet(0x00FFFFFF);
    ROM_SysTickPeriodSet(ROM_SysCtlClockGet() / TICKS_PER_SECOND);
    ROM_SysTickEnable();

    //
    //Initialize Timer5 to be used as time-tracker since beginning of time
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER5); //not tied to launchpad pin
    ROM_TimerConfigure(TIMER5_BASE, TIMER_CFG_PERIODIC_UP);

    ROM_TimerLoadSet(TIMER5_BASE, TIMER_A, ROM_SysCtlClockGet()/1000);

    ROM_IntEnable(INT_TIMER5A);
    ROM_TimerIntEnable(TIMER5_BASE, TIMER_TIMA_TIMEOUT);

    ROM_TimerEnable(TIMER5_BASE, TIMER_A);

    ROM_IntMasterEnable();

}
开发者ID:Osuga,项目名称:TivaC,代码行数:58,代码来源:wiring.c

示例4: lcd_init

void lcd_init() {
	ROM_SysCtlPeripheralEnable(LCD_PORTENABLE);
	ROM_GPIOPinTypeGPIOOutput(LCD_PORT, (LCD_RS | LCD_E | LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7));

	// Please refer to the HLCD_D44780 datasheet for how these initializations work!
	ROM_SysCtlDelay(ROM_SysCtlClockGet()/3/2);

	ROM_GPIOPinWrite(LCD_PORT, LCD_RS,  0x00);

	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7,  0x30);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);

	ROM_SysCtlDelay((50e-3)*ROM_SysCtlClockGet()/3);

	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7,  0x30);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3);ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);

	ROM_SysCtlDelay((50e-3)*ROM_SysCtlClockGet()/3);

	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7,  0x30);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);

	ROM_SysCtlDelay((10e-3)*ROM_SysCtlClockGet()/3);

	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7,  0x20);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);

	ROM_SysCtlDelay((10e-3)*ROM_SysCtlClockGet()/3);

	lcd_command(LCD_CLEARDISPLAY);	// Clear the screen.
	lcd_command(0x06);	// Cursor moves right.
	lcd_command(LCD_DISPLAYCONTROL | LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF);	// Don't show any cursor, turn on LCD.
}
开发者ID:AkhilPiplani,项目名称:WakeUpLight,代码行数:33,代码来源:lcd44780_LP.c

示例5: lcd_command

void lcd_command(unsigned char command) {
	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, (command & 0xf0) );
	ROM_GPIOPinWrite(LCD_PORT, LCD_RS, 0x00);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);

	ROM_SysCtlDelay((100e-6)*ROM_SysCtlClockGet()/3);

	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, (command & 0x0f) << 4 );
	ROM_GPIOPinWrite(LCD_PORT, LCD_RS, 0x00);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3); ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);

	ROM_SysCtlDelay((5e-3)*ROM_SysCtlClockGet()/3);
}
开发者ID:AkhilPiplani,项目名称:WakeUpLight,代码行数:13,代码来源:lcd44780_LP.c

示例6: main

// Main ----------------------------------------------------------------------------------------------
int main(void){

	// Enable lazy stacking
	ROM_FPULazyStackingEnable();

	// Set the clocking to run directly from the crystal.
	ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_16MHZ);

	// Initialize the UART and write status.
	ConfigureUART();

	UARTprintf("Timers example\n");

	// Enable LEDs
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN);


	// Enable the peripherals used by this example.
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER2);

	// Enable processor interrupts.
	ROM_IntMasterEnable();

	// Configure the two 32-bit periodic timers.
	ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
	ROM_TimerConfigure(TIMER1_BASE, TIMER_CFG_PERIODIC);
	ROM_TimerConfigure(TIMER2_BASE, TIMER_CFG_PERIODIC);
	ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet());
	ROM_TimerLoadSet(TIMER1_BASE, TIMER_A, ROM_SysCtlClockGet()*2);	// Blue should blink 2 times as much as red
	ROM_TimerLoadSet(TIMER2_BASE, TIMER_A, ROM_SysCtlClockGet()*3);	// Green should blink 3 times as much as red

	// Setup the interrupts for the timer timeouts.
	ROM_IntEnable(INT_TIMER0A);
	ROM_IntEnable(INT_TIMER1A);
	ROM_IntEnable(INT_TIMER2A);
	ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);
	ROM_TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
	ROM_TimerIntEnable(TIMER2_BASE, TIMER_TIMA_TIMEOUT);

	// Enable the timers.
	ROM_TimerEnable(TIMER0_BASE, TIMER_A);
	ROM_TimerEnable(TIMER1_BASE, TIMER_A);
	ROM_TimerEnable(TIMER2_BASE, TIMER_A);

	// Loop forever while the timers run.
	while(1){}

}
开发者ID:chaitanya4b3,项目名称:Tiva-Test,代码行数:52,代码来源:timers.c

示例7: buzzer_init

void buzzer_init(void)
{
    BUZZER_GPIO_PERIPHERAL_ENABLE();
    BUZZER_TIMER_PERIPHERAL_ENABLE();

    ROM_GPIOPinConfigure(BUZZER_TIMER_PIN_AF);
    ROM_GPIOPinTypeTimer(BUZZER_PORT, BUZZER_PIN);

    ROM_TimerConfigure(BUZZER_TIMER, TIMER_CFG_SPLIT_PAIR | TIMER_CFG_A_PWM);
//	ROM_TimerPrescaleSet(BUZZER_TIMER, BUZZER_TIMER_CHANNEL, 10);
    ROM_TimerLoadSet(BUZZER_TIMER, BUZZER_TIMER_CHANNEL, ROM_SysCtlClockGet());
    ROM_TimerMatchSet(BUZZER_TIMER, BUZZER_TIMER_CHANNEL, ROM_SysCtlClockGet()); // PWM
    ROM_TimerEnable(BUZZER_TIMER, BUZZER_TIMER_CHANNEL);
}
开发者ID:honghiep,项目名称:MicromouseDev,代码行数:14,代码来源:Buzzer.c

示例8: lcd_write

void lcd_write(unsigned char inputData) {
	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, (inputData & 0xf0) );
	ROM_GPIOPinWrite(LCD_PORT, LCD_RS, 0x01);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);
	ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);
	ROM_SysCtlDelay((100e-6)*ROM_SysCtlClockGet()/3);

	ROM_GPIOPinWrite(LCD_PORT, LCD_D4 | LCD_D5 | LCD_D6 | LCD_D7, (inputData & 0x0f) << 4 );
	ROM_GPIOPinWrite(LCD_PORT, LCD_RS, 0x01);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x02);
	ROM_SysCtlDelay((20e-6)*ROM_SysCtlClockGet()/3);
	ROM_GPIOPinWrite(LCD_PORT, LCD_E, 0x00);
	ROM_SysCtlDelay((5e-3)*ROM_SysCtlClockGet()/3);
}
开发者ID:AkhilPiplani,项目名称:WakeUpLight,代码行数:15,代码来源:lcd44780_LP.c

示例9: main

// Main ----------------------------------------------------------------------------------------------
int main(void){

	// Enable lazy stacking
	ROM_FPULazyStackingEnable();

	// Set the system clock to run at 40Mhz off PLL with external crystal as reference.
	ROM_SysCtlClockSet(SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);

	// Initialize the UART and write status.
	ConfigureUART();
	UARTprintf("ISL29023 Example\n");

	// Enable LEDs
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN);

	// Enable I2C3
	ConfigureI2C3();

	// Create struct
	tISL29023 islSensHub;

	// Create print variables
	uint32_t printValue[2];

	ISL29023ChangeSettings(ISL29023_COMMANDII_RANGE64k, ISL29023_COMMANDII_RES16, &islSensHub);

	while(1){
		// Get ALS
		ISL29023GetALS(&islSensHub);
		FloatToPrint(islSensHub.alsVal, printValue);
		UARTprintf("ALS: %d.%03d |.| ",printValue[0],printValue[1]);

		// Get IR
		ISL29023GetIR(&islSensHub);
		FloatToPrint(islSensHub.irVal, printValue);
		UARTprintf("IR: %d.%03d\n",printValue[0],printValue[1]);

		// Blink LED
		ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_GREEN|LED_BLUE, LED_GREEN);
		ROM_SysCtlDelay(ROM_SysCtlClockGet()/3/10);	// Delay for 100ms (1/10s) :: ClockGet()/3 = 1second
		ROM_GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_GREEN|LED_BLUE, 0);

		// Delay for second
		ROM_SysCtlDelay(ROM_SysCtlClockGet()/3);
	}

}
开发者ID:chaitanya4b3,项目名称:Tiva-Test,代码行数:49,代码来源:isl29023.c

示例10: system_SystickConfig

static void system_SystickConfig(uint32_t ui32_msInterval)
{
	ROM_SysTickPeriodSet(ROM_SysCtlClockGet() * ui32_msInterval / 1000);
	SysTickIntRegister(&SysTickIntHandle);
	ROM_SysTickIntEnable();
	ROM_SysTickEnable();
}
开发者ID:honghiep,项目名称:MicromouseDev,代码行数:7,代码来源:SystemConfig.c

示例11: PWMWrite

void PWMWrite(uint8_t pin, uint32_t analog_res, uint32_t duty, unsigned int freq)
{

    if (duty == 0) {
    	pinMode(pin, OUTPUT);
        digitalWrite(pin, LOW);
    }
    else if (duty >= analog_res) {
    	pinMode(pin, OUTPUT);
    	digitalWrite(pin, HIGH);
    }
    else {

        uint8_t bit = digitalPinToBitMask(pin); // get pin bit
        uint8_t port = digitalPinToPort(pin);   // get pin port
        uint8_t timer = digitalPinToTimer(pin);
        uint32_t portBase = (uint32_t) portBASERegister(port);
        uint32_t offset = timerToOffset(timer);
        uint32_t timerBase = getTimerBase(offset);
        uint32_t timerAB = TIMER_A << timerToAB(timer);

        if (port == NOT_A_PORT) return; 	// pin on timer?

        uint32_t periodPWM = ROM_SysCtlClockGet()/freq;

        enableTimerPeriph(offset);
        ROM_GPIOPinConfigure(timerToPinConfig(timer));
        ROM_GPIOPinTypeTimer((long unsigned int) portBase, bit);

        //
        // Configure for half-width mode, allowing timers A and B to
        // operate independently
        //
        HWREG(timerBase + TIMER_O_CFG) = 0x04;

        if(timerAB == TIMER_A) {
        	HWREG(timerBase + TIMER_O_CTL) &= ~TIMER_CTL_TAEN;
        	HWREG(timerBase + TIMER_O_TAMR) = PWM_MODE;
        }
        else {
        	HWREG(timerBase + TIMER_O_CTL) &= ~TIMER_CTL_TBEN;
        	HWREG(timerBase + TIMER_O_TBMR) = PWM_MODE;
        }
        ROM_TimerLoadSet(timerBase, timerAB, periodPWM);
        ROM_TimerMatchSet(timerBase, timerAB,
                (analog_res-duty)*periodPWM/analog_res);

        //
        // If using a 16-bit timer, with a periodPWM > 0xFFFF,
        // need to use a prescaler
        //
        if((offset < WTIMER0) && (periodPWM > 0xFFFF)) {
            ROM_TimerPrescaleSet(timerBase, timerAB,
                (periodPWM & 0xFFFF0000) >> 16);
            ROM_TimerPrescaleMatchSet(timerBase, timerAB,
                (((analog_res-duty)*periodPWM/analog_res) & 0xFFFF0000) >> 16);
        }
        ROM_TimerEnable(timerBase, timerAB);

    }
开发者ID:14Ohm,项目名称:Energia,代码行数:60,代码来源:wiring_analog.c

示例12: UART_setup_gps

void UART_setup_gps(void)
{
  //
  // Enable the peripherals used by gps.
  //
  ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART1);
  ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

  //
  // Set GPIO B0 and B1 as UART pins for the gps.
  //
  ROM_GPIOPinConfigure(GPIO_PB0_U1RX);
  ROM_GPIOPinConfigure(GPIO_PB1_U1TX);
  ROM_GPIOPinTypeUART(GPIO_PORTB_BASE, GPIO_PIN_0 | GPIO_PIN_1);

  //
  // Configure the GPS for 9600, 8-N-1 operation.
  //
  ROM_UARTConfigSetExpClk(UART1_BASE, ROM_SysCtlClockGet(), 9600,
                          (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
                           UART_CONFIG_PAR_NONE));

  //
  // Enable the UART interrupt.
  //
  ROM_IntEnable(INT_UART1);
  ROM_UARTIntEnable(UART1_BASE, UART_INT_RX | UART_INT_RT);
}
开发者ID:krishnamannem,项目名称:spacegoldfish---IEEE-project---Google-Space-Balloon-Challenge,代码行数:28,代码来源:gpsParser.c

示例13: BPMTimerSetUp

void BPMTimerSetUp()
{
	ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0); // timer 0
	SysCtlDelay(3);
	 //
	// Enable processor interrupts.
	//

	//IntPrioritySet(INT_TIMER0A_TM4C123, 2);
	//
	// Configure the two 32-bit periodic timers.
	//
	ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_PERIODIC);
	ROM_TimerLoadSet(TIMER0_BASE, TIMER_A, ROM_SysCtlClockGet()/500);
	//ROM_SysCtlClockGet()/100000
	//ROM_SysCtlClockGet()/500

	// Setup the interrupts for the timer timeouts.
    ROM_IntEnable(INT_TIMER0A);
    ROM_TimerIntEnable(TIMER0_BASE, TIMER_TIMA_TIMEOUT);

    //
	// Enable the timers.
	//
	ROM_TimerEnable(TIMER0_BASE, TIMER_A);
	
}
开发者ID:andrade824,项目名称:Fear-Tracker,代码行数:27,代码来源:BPM_UPDATED.c

示例14: initTimer1

void initTimer1(int interval){
    //
    // 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.
    //
    volatile int tick = 0;

    tick = (ROM_SysCtlClockGet() / 1000) * interval; //100 sono i ms
    //
    // Enable the peripherals used by this example.
    //
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER1);

    //
    // Configure the two 32-bit periodic timers.
    //
    TimerConfigure(TIMER1_BASE, TIMER_CFG_PERIODIC);
    /// imposta il time_out
    TimerLoadSet(TIMER1_BASE, TIMER_A, tick);

    //
    // Setup the interrupts for the timer timeouts.
    //
    IntEnable(INT_TIMER1A);
    //ROM_IntEnable(INT_TIMER1A);
    TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);
    //ROM_TimerIntEnable(TIMER1_BASE, TIMER_TIMA_TIMEOUT);


}
开发者ID:itismattei,项目名称:controlPid,代码行数:31,代码来源:tiva_timer.c

示例15: init

void init()
{
    ROM_FPUEnable();
    ROM_FPULazyStackingEnable();

    ROM_SysCtlClockSet(SYSCTL_SYSDIV_2_5 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ | SYSCTL_OSC_MAIN);

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
    GPIO_PORTB_DIR_R = 0x00;
    GPIO_PORTB_DEN_R = 0xff;

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
    ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_GREEN|LED_BLUE);

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
    ROM_GPIOPinConfigure(GPIO_PA0_U0RX);
    ROM_GPIOPinConfigure(GPIO_PA1_U0TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
    UARTStdioInit(0);

    ROM_SysTickPeriodSet(ROM_SysCtlClockGet() / 1000000);
    ROM_SysTickEnable();
    ROM_SysTickIntEnable();

    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_TIMER0);
    ROM_TimerConfigure(TIMER0_BASE, TIMER_CFG_32_BIT_PER);

    reset();
}
开发者ID:kred,项目名称:stellaris-logic-analyzer,代码行数:29,代码来源:main.c


注:本文中的ROM_SysCtlClockGet函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。