Example_GPIO_Interrupts

所属分类:处理器开发
开发工具:C/C++
文件大小:310KB
下载次数:3
上传日期:2016-11-06 10:09:40
上 传 者动感小麦兜
说明:  LPC82X的GPIO操作,LPC82X的GPIO操作,
(The LPC82X s GPIO operation, the LPC82X s GPIO operation, )

文件列表:
Example_GPIO_Interrupts (0, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts (0, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\docs (0, 2016-10-07)
Example_GPIO_Interrupts\utilities_lib\src\utilities.c (12639, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src (0, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src\Example_GPIO_Interrupts.c (2879, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src\Example_GPIO_Interrupts_ISR.c (1550, 2016-07-22)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src\IAR_cstartup_M.s (6494, 2016-07-27)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src\Keil_startup_LPC8xx.s (9935, 2016-07-27)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src\LPCXpresso_cr_startup_lpc82x.c (15329, 2016-07-27)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src\Serial.c (3824, 2016-08-16)
Example_GPIO_Interrupts\Example_GPIO_Interrupts\src\system_LPC8xx.c (18810, 2016-07-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts.uvguix.Administrator (73172, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts.uvguix_Administrator.bak (73171, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts.uvoptx (18905, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts.uvprojx (31286, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts_flash.dep (6006, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts_uvoptx.bak (20600, 2016-10-07)
Example_GPIO_Interrupts\Example_GPIO_Interrupts_uvprojx.bak (32799, 2016-10-07)
Example_GPIO_Interrupts\Listings (0, 2016-10-07)
Example_GPIO_Interrupts\Listings\Example_GPIO_Interrupts.map (108339, 2016-10-07)
Example_GPIO_Interrupts\Listings\keil_startup_lpc8xx.lst (34691, 2016-10-07)
Example_GPIO_Interrupts\Objects (0, 2016-10-07)
Example_GPIO_Interrupts\Objects\Example_GPIO_Interrupts.axf (33620, 2016-10-07)
Example_GPIO_Interrupts\Objects\Example_GPIO_Interrupts.build_log.htm (926, 2016-10-07)
Example_GPIO_Interrupts\Objects\Example_GPIO_Interrupts.hex (3410, 2016-10-07)
Example_GPIO_Interrupts\Objects\Example_GPIO_Interrupts.htm (27775, 2016-10-07)
Example_GPIO_Interrupts\Objects\Example_GPIO_Interrupts.lnp (542, 2016-10-07)
Example_GPIO_Interrupts\Objects\Example_GPIO_Interrupts.sct (479, 2016-10-01)
Example_GPIO_Interrupts\Objects\example_gpio_interrupts.crf (43853, 2016-10-07)
Example_GPIO_Interrupts\Objects\example_gpio_interrupts.d (867, 2016-10-07)
Example_GPIO_Interrupts\Objects\example_gpio_interrupts.o (44476, 2016-10-07)
Example_GPIO_Interrupts\Objects\example_gpio_interrupts_isr.crf (37724, 2016-10-07)
Example_GPIO_Interrupts\Objects\example_gpio_interrupts_isr.d (753, 2016-10-07)
Example_GPIO_Interrupts\Objects\example_gpio_interrupts_isr.o (41604, 2016-10-07)
Example_GPIO_Interrupts\Objects\keil_retarget.crf (7504, 2016-10-01)
Example_GPIO_Interrupts\Objects\keil_retarget.d (305, 2016-10-01)
Example_GPIO_Interrupts\Objects\keil_retarget.o (18144, 2016-10-01)
Example_GPIO_Interrupts\Objects\keil_startup_lpc8xx.d (84, 2016-10-07)
... ...

/* ${ProjName}: Example_GPIO_Interrupts Intended purpose: * To demonstrate the configuration and use of the pin interrupts function. * User input is via the debug UART. * Connect a terminal emulator, set to 9600/8/N/1, to the debug UART COM port. * See Serial.c to setup the debug com port. // The pin interrupts can be activated in two ways: // // 1. By configuring the port bits as inputs, and driving the package pins high and low externally. // // 2. By configuring the port bits as outputs, and writing to their port bit registers via software. // The enabled GPIO pin interrupt logic will always monitor the state of the pins, // even when configured as outputs. // // We will use approach #2. Program Flow: * This example runs at 30 MHz (PLL, running from IRC, generating 60 MHz, divided by 2). See funtion SystemInit() in the startup code. * main() routine 1. Clock to the GPIO module is enabled and the module is configured for GPIO interrupts. 2. P0.15 and P0.14 are configured as outputs driving '0'. 3. P0.15 and P0.14 are configured as PINTSEL1 and PINTSEL0 4. Both PINTSELs are made rising and falling edge sensitive. 5. Both PIN interrupts are enabled, and code enters a while(1) loop. 6. Execution pauses while awaiting user input of one hex digit (with no prefix) via the terminal. 7. Bits 1 and 0 of the hex digit are written to P0.15 and P0.14, and the loop repeats. 8. A rising edge interrupt on PININT 0 turns on the red LED, and a falling edge turns it off. A rising edge interrupt on PININT 1 turns on the green LED, and a falling edge turns it off. * Note that when both the red and green LEDs are lit, the red LED is barely visible. * For example, the sequence '0' '1' '0' or 'C' 'D' 'C' will turn on, then off, the red LED. The sequence '2' '0' '2' or '6' '4' 'A' will turn on, then off, the green LED. To run this code: * Build, Debug, Run or * Download to flash, then reset Note: With IAR it may be necessary to power-cycle the board in order to regain control of the reset button after programming. */

近期下载者

相关文件


收藏者