//.........这里部分代码省略.........
BMP180AppCallback, &g_sBMP180Inst);
//
// Wait for initialization callback to indicate reset request is complete.
//
while(g_vui8DataFlag == 0)
{
//
// Wait for I2C Transactions to complete.
//
}
//
// Reset the data ready flag
//
g_vui8DataFlag = 0;
//
// Enable the system ticks at 10 hz.
//
MAP_SysTickPeriodSet(ui32SysClock / (10 * 3));
MAP_SysTickIntEnable();
MAP_SysTickEnable();
//
// Configure PQ4 to control the blue LED.
//
MAP_GPIOPinTypeGPIOOutput(GPIO_PORTQ_BASE, GPIO_PIN_4);
//
// Print temperature, pressure and altitude labels once on the LCD.
//
GrStringDraw(&sContext, "Temperature", 11,
((GrContextDpyWidthGet(&sContext) / 2) - 96),
((GrContextDpyHeightGet(&sContext) - 32) / 2) - 24, 1);
GrStringDraw(&sContext, "Pressure", 8,
((GrContextDpyWidthGet(&sContext) / 2) - 63),
(GrContextDpyHeightGet(&sContext) - 32) / 2, 1);
GrStringDraw(&sContext, "Altitude", 8,
((GrContextDpyWidthGet(&sContext) / 2) - 59),
((GrContextDpyHeightGet(&sContext) - 32) / 2) + 24, 1);
//
// Begin the data collection and printing. Loop Forever.
//
while(1)
{
//
// Read the data from the BMP180 over I2C. This command starts a
// temperature measurement. Then polls until temperature is ready.
// Then automatically starts a pressure measurement and polls for that
// to complete. When both measurement are complete and in the local
// buffer then the application callback is called from the I2C
// interrupt context. Polling is done on I2C interrupts allowing
// processor to continue doing other tasks as needed.
//
BMP180DataRead(&g_sBMP180Inst, BMP180AppCallback, &g_sBMP180Inst);
while(g_vui8DataFlag == 0)
{
//
// Wait for the new data set to be available.
//
}
//
// Reset the data ready flag.
//*****************************************************************************
//
// A simple demonstration of the features of the TivaWare Graphics Library.
//
//*****************************************************************************
int
main(void)
{
tContext sContext;
tRectangle sRect;
//
// The FPU should be enabled because some compilers will use floating-
// point registers, even for non-floating-point code. If the FPU is not
// enabled this will cause a fault. This also ensures that floating-
// point operations could be added to this application and would work
// correctly and use the hardware floating-point unit. Finally, lazy
// stacking is enabled for interrupt handlers. This allows floating-
// point instructions to be used within interrupt handlers, but at the
// expense of extra stack usage.
//
FPUEnable();
FPULazyStackingEnable();
//
// Run from the PLL at 120 MHz.
//
g_ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN |
SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
//
// Initialize the display driver.
//
Kentec320x240x16_SSD2119Init(g_ui32SysClock);
//
// Initialize the graphics context.
//
GrContextInit(&sContext, &g_sKentec320x240x16_SSD2119);
//
// Fill the top 24 rows of the screen with blue to create the banner.
//
sRect.i16XMin = 0;
sRect.i16YMin = 0;
sRect.i16XMax = GrContextDpyWidthGet(&sContext) - 1;
sRect.i16YMax = 23;
GrContextForegroundSet(&sContext, ClrDarkBlue);
GrRectFill(&sContext, &sRect);
//
// Put a white box around the banner.
//
GrContextForegroundSet(&sContext, ClrWhite);
GrRectDraw(&sContext, &sRect);
//
// Put the application name in the middle of the banner.
//
GrContextFontSet(&sContext, &g_sFontCm20);
GrStringDrawCentered(&sContext, "grlib demo", -1,
GrContextDpyWidthGet(&sContext) / 2, 8, 0);
//
// Configure and enable uDMA
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
SysCtlDelay(10);
uDMAControlBaseSet(&psDMAControlTable[0]);
uDMAEnable();
//
// Initialize the touch screen driver and have it route its messages to the
// widget tree.
//
TouchScreenInit(g_ui32SysClock);
TouchScreenCallbackSet(WidgetPointerMessage);
//
// Add the title block and the previous and next buttons to the widget
// tree.
//
WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sPrevious);
WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sTitle);
WidgetAdd(WIDGET_ROOT, (tWidget *)&g_sNext);
//
// Add the first panel to the widget tree.
//
g_ui32Panel = 0;
WidgetAdd(WIDGET_ROOT, (tWidget *)g_psPanels);
CanvasTextSet(&g_sTitle, g_pcPanei32Names[0]);
//
// Issue the initial paint request to the widgets.
//
WidgetPaint(WIDGET_ROOT);
//.........这里部分代码省略.........
//*****************************************************************************
//
// This is the main example program. It checks to see that the interrupts are
// processed in the correct order when they have identical priorities,
// increasing priorities, and decreasing priorities. This exercises interrupt
// preemption and tail chaining.
//
//*****************************************************************************
int
main(void)
{
uint_fast8_t ui8Error;
uint32_t ui32SysClock;
//
// Run from the PLL at 120 MHz.
//
ui32SysClock = MAP_SysCtlClockFreqSet((SYSCTL_XTAL_25MHZ |
SYSCTL_OSC_MAIN | SYSCTL_USE_PLL |
SYSCTL_CFG_VCO_480), 120000000);
//
// Configure the device pins.
//
PinoutSet();
//
// Initialize the display driver.
//
Kentec320x240x16_SSD2119Init(ui32SysClock);
//
// Initialize the graphics context.
//
GrContextInit(&g_sContext, &g_sKentec320x240x16_SSD2119);
//
// Draw the application frame.
//
FrameDraw(&g_sContext, "interrupts");
//
// Put the status header text on the display.
//
GrContextFontSet(&g_sContext, g_psFontCm20);
GrStringDrawCentered(&g_sContext, "Active: Pending: ", -1,
GrContextDpyWidthGet(&g_sContext) / 2, 150, 0);
//
// Configure the B3, L1 and L0 to be outputs to indicate entry/exit of one
// of the interrupt handlers.
//
GPIOPinTypeGPIOOutput(GPIO_A_BASE, GPIO_A_PIN);
GPIOPinTypeGPIOOutput(GPIO_B_BASE, GPIO_B_PIN);
GPIOPinTypeGPIOOutput(GPIO_C_BASE, GPIO_C_PIN);
GPIOPinWrite(GPIO_A_BASE, GPIO_A_PIN, 0);
GPIOPinWrite(GPIO_B_BASE, GPIO_B_PIN, 0);
GPIOPinWrite(GPIO_C_BASE, GPIO_C_PIN, 0);
//
// Set up and enable the SysTick timer. It will be used as a reference
// for delay loops in the interrupt handlers. The SysTick timer period
// will be set up for 100 times per second.
//
ROM_SysTickPeriodSet(ui32SysClock / 100);
ROM_SysTickEnable();
//
// Reset the error indicator.
//
ui8Error = 0;
//
// Enable interrupts to the processor.
//
ROM_IntMasterEnable();
//
// Enable the interrupts.
//
ROM_IntEnable(INT_GPIOA);
ROM_IntEnable(INT_GPIOB);
ROM_IntEnable(INT_GPIOC);
//
// Indicate that the equal interrupt priority test is beginning.
//
GrStringDrawCentered(&g_sContext, "Equal Priority", -1,
GrContextDpyWidthGet(&g_sContext) / 2, 60, 1);
//
// Set the interrupt priorities so they are all equal.
//
ROM_IntPrioritySet(INT_GPIOA, 0x00);
ROM_IntPrioritySet(INT_GPIOB, 0x00);
ROM_IntPrioritySet(INT_GPIOC, 0x00);
//
// Reset the interrupt flags.
//
//.........这里部分代码省略.........
//*****************************************************************************
//
// A simple application demonstrating use of the boot loader,
//
//*****************************************************************************
int
main(void)
{
tRectangle sRect;
tContext sContext;
unsigned long ulSysClock;
//
// 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.
//
ROM_FPULazyStackingEnable();
//
// Set the system clock to run at 50MHz from the PLL
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_XTAL_16MHZ |
SYSCTL_OSC_MAIN);
ulSysClock = ROM_SysCtlClockGet();
//
// Initialize the peripherals that each of the boot loader flavors
// supports. Since this example is intended for use with any of the
// boot loaders and we don't know which is actually in use, we cover all
// bases and initialize for serial, Ethernet and USB use here.
//
SetupForUART();
SetupForUSB();
//
// Initialize the buttons driver.
//
ButtonsInit();
//
// Initialize the display driver.
//
CFAL96x64x16Init();
//
// Initialize the graphics context.
//
GrContextInit(&sContext, &g_sCFAL96x64x16);
//
// Fill the top part of the screen with blue to create the banner.
//
sRect.sXMin = 0;
sRect.sYMin = 0;
sRect.sXMax = GrContextDpyWidthGet(&sContext) - 1;
sRect.sYMax = 9;
GrContextForegroundSet(&sContext, ClrDarkBlue);
GrRectFill(&sContext, &sRect);
//
// Change foreground for white text.
//
GrContextForegroundSet(&sContext, ClrWhite);
//
// Put the application name in the middle of the banner.
//
GrContextFontSet(&sContext, g_pFontFixed6x8);
GrStringDrawCentered(&sContext, "boot-demo2", -1,
GrContextDpyWidthGet(&sContext) / 2, 4, 0);
GrStringDrawCentered(&sContext, "Press select", -1,
GrContextDpyWidthGet(&sContext) / 2, 20, false);
GrStringDrawCentered(&sContext, "button to", -1,
GrContextDpyWidthGet(&sContext) / 2, 30, false);
GrStringDrawCentered(&sContext, "update.", -1,
GrContextDpyWidthGet(&sContext) / 2, 40, false);
//
// Wait for select button to be pressed.
//
while ((ButtonsPoll(0, 0) & SELECT_BUTTON) == 0)
{
ROM_SysCtlDelay(ulSysClock / 1000);
}
GrStringDrawCentered(&sContext, " ", -1,
GrContextDpyWidthGet(&sContext) / 2, 20, true);
GrStringDrawCentered(&sContext, " Updating... ", -1,
GrContextDpyWidthGet(&sContext) / 2, 30, true);
GrStringDrawCentered(&sContext, " ", -1,
GrContextDpyWidthGet(&sContext) / 2, 40, true);
//
// Transfer control to the boot loader.
//
JumpToBootLoader();
//
//.........这里部分代码省略.........
//*****************************************************************************
//
// This function updates the status area of the screen. It uses the current
// state of the application to print the status bar.
//
//*****************************************************************************
void
UpdateStatus(char *pcString, uint32_t ui32Buttons, bool bClrBackground)
{
tRectangle sRect;
//
// Fill the bottom rows of the screen with blue to create the status area.
//
sRect.i16XMin = 0;
sRect.i16YMin = GrContextDpyHeightGet(&g_sContext) -
DISPLAY_BANNER_HEIGHT - 1;
sRect.i16XMax = GrContextDpyWidthGet(&g_sContext) - 1;
sRect.i16YMax = sRect.i16YMin + DISPLAY_BANNER_HEIGHT;
//
// Were we asked to clear the background of the status area?
//
GrContextBackgroundSet(&g_sContext, DISPLAY_BANNER_BG);
if(bClrBackground)
{
//
// Draw the background of the banner.
//
GrContextForegroundSet(&g_sContext, DISPLAY_BANNER_BG);
GrRectFill(&g_sContext, &sRect);
//
// Put a white box around the banner.
//
GrContextForegroundSet(&g_sContext, DISPLAY_BANNER_FG);
GrRectDraw(&g_sContext, &sRect);
}
//
// Write the current state to the left of the status area.
//
GrContextFontSet(&g_sContext, g_psFontFixed6x8);
//
// Update the status on the screen.
//
if(pcString != 0)
{
UARTprintf(pcString);
UARTprintf("\n");
GrStringDraw(&g_sContext, pcString, -1, 10, sRect.i16YMin + 4, 1);
g_ui32Buttons = ui32Buttons;
}
else if(iUSBState == eStateNoDevice)
{
//
// Mouse is currently disconnected.
//
UARTprintf("no device\n");
GrStringDraw(&g_sContext, "no device ", -1, 10, sRect.i16YMin + 4,
1);
}
else if(iUSBState == eStateMouseConnected)
{
//
// Mouse is connected.
//
UARTprintf("connected\n");
GrStringDraw(&g_sContext, "connected ", -1, 10, sRect.i16YMin + 4,
1);
}
else if(iUSBState == eStateUnknownDevice)
{
//
// Some other (unknown) device is connected.
//
UARTprintf("unknown device\n");
GrStringDraw(&g_sContext, "unknown device", -1, 10, sRect.i16YMin + 4,
1);
}
else if(iUSBState == eStatePowerFault)
{
//
// Power fault.
//
UARTprintf("power fault\n");
GrStringDraw(&g_sContext, "power fault ", -1, 10, sRect.i16YMin + 4,
1);
}
UpdateButtons();
}
//*****************************************************************************
//
// Demonstrate the use of the USB stick update example.
//
//*****************************************************************************
int
main(void)
{
uint_fast32_t ui32Count;
tContext sContext;
tRectangle sRect;
//
// 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.
//
ROM_FPULazyStackingEnable();
//
// Set the system clock to run at 50MHz from the PLL.
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
//
// Initialize the display driver.
//
CFAL96x64x16Init();
//
// Initialize the graphics context.
//
GrContextInit(&sContext, &g_sCFAL96x64x16);
//
// Fill the top 24 rows of the screen with blue to create the banner.
//
sRect.i16XMin = 0;
sRect.i16YMin = 0;
sRect.i16XMax = GrContextDpyWidthGet(&sContext) - 1;
sRect.i16YMax = 9;
GrContextForegroundSet(&sContext, ClrDarkBlue);
GrRectFill(&sContext, &sRect);
//
// Put a white box around the banner.
//
GrContextForegroundSet(&sContext, ClrWhite);
GrRectDraw(&sContext, &sRect);
//
// Put the application name in the middle of the banner.
//
GrContextFontSet(&sContext, g_psFontFixed6x8);
GrStringDrawCentered(&sContext, "usb-stick-demo", -1,
GrContextDpyWidthGet(&sContext) / 2, 4, 0);
//
// Indicate what is happening.
//
GrStringDrawCentered(&sContext, "Press the", -1,
GrContextDpyWidthGet(&sContext) / 2, 20, 0);
GrStringDrawCentered(&sContext, "select button to", -1,
GrContextDpyWidthGet(&sContext) / 2, 30, 0);
GrStringDrawCentered(&sContext, "start the USB", -1,
GrContextDpyWidthGet(&sContext) / 2, 40, 0);
GrStringDrawCentered(&sContext, "stick updater.", -1,
GrContextDpyWidthGet(&sContext) / 2, 50, 0);
//
// Flush any cached drawing operations.
//
GrFlush(&sContext);
//
// Enable the GPIO module which the select button is attached to.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM);
//
// Enable the GPIO pin to read the user button.
//
ROM_GPIODirModeSet(GPIO_PORTM_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN);
MAP_GPIOPadConfigSet(GPIO_PORTM_BASE, GPIO_PIN_4, GPIO_STRENGTH_2MA,
GPIO_PIN_TYPE_STD_WPU);
//
// Wait for the pullup to take effect or the next loop will exist too soon.
//
SysCtlDelay(1000);
//
// Wait until the select button has been pressed for ~40ms (in order to
// debounce the press).
//
ui32Count = 0;
while(1) {
//
// See if the button is pressed.
//.........这里部分代码省略.........
//*****************************************************************************
//
// This is the main loop that runs the application.
//
//*****************************************************************************
int
main(void)
{
FRESULT FileResult;
tRectangle sRect;
//
// Initially wait for device connection.
//
g_eState = STATE_NO_DEVICE;
//
// Set the clocking to run directly from the crystal.
//
SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_8MHZ);
//
// Enable Clocking to the USB controller.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_USB0);
//
// Enable the peripherals used by this example.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOH);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
//
// Set the USB pins to be controlled by the USB controller.
//
GPIOPinTypeUSBDigital(GPIO_PORTH_BASE, GPIO_PIN_3 | GPIO_PIN_4);
//
// The LM3S3748 board uses a USB mux that must be switched to use the
// host connecter and not the device connecter.
//
GPIOPinTypeGPIOOutput(USB_MUX_GPIO_BASE, USB_MUX_GPIO_PIN);
GPIOPinWrite(USB_MUX_GPIO_BASE, USB_MUX_GPIO_PIN, USB_MUX_SEL_HOST);
//
// Turn on USB Phy clock.
//
SysCtlUSBPLLEnable();
//
// Set the system tick to fire 100 times per second.
//
SysTickPeriodSet(SysCtlClockGet()/100);
SysTickIntEnable();
SysTickEnable();
//
// Enable the uDMA controller and set up the control table base.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_UDMA);
uDMAEnable();
uDMAControlBaseSet(g_sDMAControlTable);
//
// Initialize the display driver.
//
Formike128x128x16Init();
//
// Turn on the backlight.
//
Formike128x128x16BacklightOn();
//
// Initialize the graphics context.
//
GrContextInit(&g_sContext, &g_sFormike128x128x16);
//
// Fill the top 15 rows of the screen with blue to create the banner.
//
sRect.sXMin = 0;
sRect.sYMin = 0;
sRect.sXMax = GrContextDpyWidthGet(&g_sContext) - 1;
sRect.sYMax = SPLASH_HEIGHT - 1;
GrContextForegroundSet(&g_sContext, ClrDarkBlue);
GrRectFill(&g_sContext, &sRect);
//
// Put a white box around the banner.
//
GrContextForegroundSet(&g_sContext, ClrWhite);
GrRectDraw(&g_sContext, &sRect);
//
// Put the application name in the middle of the banner.
//
GrContextFontSet(&g_sContext, &g_sFontFixed6x8);
//.........这里部分代码省略.........
//*****************************************************************************
//
// This example demonstrates how to send a string of data to the UART.
//
//*****************************************************************************
int
main(void)
{
tRectangle sRect;
tContext sContext;
//
// 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.
//
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 display driver.
//
CFAL96x64x16Init();
//
// Initialize the graphics context.
//
GrContextInit(&sContext, &g_sCFAL96x64x16);
//
// Fill the top part of the screen with blue to create the banner.
//
sRect.i16XMin = 0;
sRect.i16YMin = 0;
sRect.i16XMax = GrContextDpyWidthGet(&sContext) - 1;
sRect.i16YMax = 9;
GrContextForegroundSet(&sContext, ClrDarkBlue);
GrRectFill(&sContext, &sRect);
//
// Change foreground for white text.
//
GrContextForegroundSet(&sContext, ClrWhite);
//
// Put the application name in the middle of the banner.
//
GrContextFontSet(&sContext, g_psFontFixed6x8);
GrStringDrawCentered(&sContext, "uart-echo", -1,
GrContextDpyWidthGet(&sContext) / 2, 4, 0);
//
// Initialize the display and write some instructions.
//
GrStringDrawCentered(&sContext, "Connect a", -1,
GrContextDpyWidthGet(&sContext) / 2, 20, false);
GrStringDrawCentered(&sContext, "terminal", -1,
GrContextDpyWidthGet(&sContext) / 2, 30, false);
GrStringDrawCentered(&sContext, "to UART0.", -1,
GrContextDpyWidthGet(&sContext) / 2, 40, false);
GrStringDrawCentered(&sContext, "115000,N,8,1", -1,
GrContextDpyWidthGet(&sContext) / 2, 50, false);
//
// Enable the peripherals used by this example.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0);
//
// Enable processor interrupts.
//
ROM_IntMasterEnable();
//
// Set GPIO A0 and A1 as UART pins.
//
ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);
//
// Configure the UART for 115,200, 8-N-1 operation.
//
ROM_UARTConfigSetExpClk(UART0_BASE, ROM_SysCtlClockGet(), 115200,
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
UART_CONFIG_PAR_NONE));
//
// Enable the UART interrupt.
//
ROM_IntEnable(INT_UART0);
ROM_UARTIntEnable(UART0_BASE, UART_INT_RX | UART_INT_RT);
//
// Prompt for text to be entered.
//
//.........这里部分代码省略.........
//*****************************************************************************
//
// This example demonstrates the use of the watchdog timer.
//
//*****************************************************************************
int
main(void)
{
tRectangle sRect;
//
// Set the clocking to run directly from the crystal.
//
ROM_SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);
//
// Set the device pinout appropriately for this board.
//
PinoutSet();
//
// Initialize the touch screen driver.
//
TouchScreenInit();
TouchScreenCallbackSet(WatchdogTouchCallback);
//
// Initialize the display driver.
//
Kitronix320x240x16_SSD2119Init();
//
// Initialize the graphics context and find the middle X coordinate.
//
GrContextInit(&g_sContext, &g_sKitronix320x240x16_SSD2119);
//
// Fill the top 15 rows of the screen with blue to create the banner.
//
sRect.sXMin = 0;
sRect.sYMin = 0;
sRect.sXMax = GrContextDpyWidthGet(&g_sContext) - 1;
sRect.sYMax = 23;
GrContextForegroundSet(&g_sContext, ClrDarkBlue);
GrRectFill(&g_sContext, &sRect);
//
// Put a white box around the banner.
//
GrContextForegroundSet(&g_sContext, ClrWhite);
GrRectDraw(&g_sContext, &sRect);
//
// Put the application name in the middle of the banner.
//
GrContextFontSet(&g_sContext, g_pFontCm20);
GrStringDrawCentered(&g_sContext, "watchdog", -1,
GrContextDpyWidthGet(&g_sContext) / 2, 8, 0);
//
// Show the state and offer some instructions to the user.
//
GrContextFontSet(&g_sContext, g_pFontCmss20);
GrStringDrawCentered(&g_sContext, "Watchdog is being fed.", -1,
GrContextDpyWidthGet(&g_sContext) / 2 ,
(GrContextDpyHeightGet(&g_sContext) / 2), 1);
GrContextFontSet(&g_sContext, g_pFontCmss14);
GrStringDrawCentered(&g_sContext, "Tap the screen to starve the watchdog",
-1, GrContextDpyWidthGet(&g_sContext) / 2 ,
(GrContextDpyHeightGet(&g_sContext) / 2) + 20, 1);
//
// Enable the peripherals used by this example.
//
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_WDOG0);
//
// Enable processor interrupts.
//
ROM_IntMasterEnable();
//
// Set GPIO PF3 as an output. This drives an LED on the board that will
// toggle when a watchdog interrupt is processed.
//
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_3);
ROM_GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_3, 0);
//
// Enable the watchdog interrupt.
//
ROM_IntEnable(INT_WATCHDOG);
//
// Set the period of the watchdog timer.
//
ROM_WatchdogReloadSet(WATCHDOG0_BASE, ROM_SysCtlClockGet());
//
//.........这里部分代码省略.........
请发表评论