STM32F2xx_GPIO配置例程

所属分类:单片机开发
开发工具:C/C++
文件大小:23KB
下载次数:1
上传日期:2020-06-12 18:13:50
上 传 者KittyPatrick
说明:  本例简要描述了如何将JTAG/SWD IOs用作标准 并给出一个配置序列。 注意,一旦JTAG/SWD IOs被禁用,与主机调试器的连接就是 丢失,只要JTAG/SWD IOs保持禁用状态,就无法重新建立。 为了避免这种情况,按键按钮用于禁用或不禁用JTAG/SWD IOs: 一。复位时按键保持按下状态:JTAG/SWD IOs禁用,LED1开启 2。复位时未按下按键:JTAG/SWD IOs未改变,LED2开启 在开始这个例子之前,您应该断开JTAG/SWD探针并运行 独立模式中的示例。
(This example provides a short description of how to use the JTAG/SWD IOs as standard GPIOs and gives a configuration sequence. Note that once the JTAG/SWD IOs are disabled, the connection with the host debugger is lost and cannot be re-established as long as the JTAG/SWD IOs remain disabled. To avoid this situation, the Key push-button is used to disable or not the JTAG/SWD IOs: 1. Key push-button maintained pressed at reset: JTAG/SWD IOs disabled and LED1 turned ON 2. Key push-button not pressed at reset: JTAG/SWD IOs unchanged and LED2 turned ON Before starting this example, you should disconnect your JTAG/SWD probe and run the example in stand-alone mode.)

文件列表:
GPIO\IOToggle\main.c (5432, 2011-04-21)
GPIO\IOToggle\stm32f2xx_conf.h (3613, 2011-04-21)
GPIO\IOToggle\stm32f2xx_it.c (4447, 2011-04-21)
GPIO\IOToggle\stm32f2xx_it.h (2063, 2011-04-21)
GPIO\IOToggle\system_stm32f2xx.c (20783, 2011-04-21)
GPIO\JTAG_Remap\main.c (5345, 2011-04-21)
GPIO\JTAG_Remap\stm32f2xx_conf.h (3615, 2011-04-21)
GPIO\JTAG_Remap\stm32f2xx_it.c (4456, 2011-04-21)
GPIO\JTAG_Remap\stm32f2xx_it.h (2065, 2011-04-21)
GPIO\JTAG_Remap\system_stm32f2xx.c (20783, 2011-04-21)
GPIO\IOToggle (0, 2011-04-21)
GPIO\JTAG_Remap (0, 2011-04-21)
GPIO (0, 2011-04-21)

/** @page GPIO_IOToggle GPIO IO Toggle example @verbatim ******************** (C) COPYRIGHT 2011 STMicroelectronics ******************* * @file GPIO/IOToggle/readme.txt * @author MCD Application Team * @version V1.0.0 * @date 18-April-2011 * @brief Description of the GPIO IO Toggle example. ****************************************************************************** * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. ****************************************************************************** @endverbatim @par Example Description GPIO ports are connected on AHB bus, using BSRRH and BSRRL registers one cycle is required to set a pin and another cycle to reset it. So GPIO pins can toggle at AHB clock divided by 2. This example describes how to use BSRRH and BSRRL (Port Bit Set/Reset Register High and Low) for maximum IO toggling. PG6 and PG8 (configured in output pushpull mode) toggles in a forever loop: - Set PG6 and PG8 by setting corresponding bits in BSRRL register - Reset PG6 and PG8 by setting corresponding bits in BSRRH register In this example, HCLK is configured at 120 MHz so PG6 and PG8 toggles at 60MHz. To achieve the maximum IO toggling frequency, you have to configure your compiler options for high speed optimization. @par Directory contents - GPIO/IOToggle/stm32f2xx_conf.h Library Configuration file - GPIO/IOToggle/stm32f2xx_it.c Interrupt handlers - GPIO/IOToggle/stm32f2xx_it.h Interrupt handlers header file - GPIO/IOToggle/main.c Main program - GPIO/IOToggle/system_stm32f2xx.c STM32F2xx system source file @note The "system_stm32f2xx.c" is generated by an automatic clock configuration tool and can be easily customized to your own configuration. To select different clock setup, use the "STM32F2xx_Clock_Configuration_V1.0.0.xls" tool. @par Hardware and Software environment - This example runs on STM32F2xx Devices. - This example has been tested with STM322xG-EVAL RevB and can be easily tailored to any other development board - STM322xG-EVAL Set-up - Use LED1 and LED2 connected respectively to PG.06 and PG.08 @par How to use it ? In order to make the program work, you must do the following : - Copy all source files from this example folder to the template folder under Project\STM32F2xx_StdPeriph_Template - Open your preferred toolchain - Rebuild all files and load your image into target memory - Run the example *

© COPYRIGHT 2011 STMicroelectronics

*/

近期下载者

相关文件


收藏者