询问一个GPIO的例程//英倍德的板子

[复制链接]
3201|2
 楼主| johnnyqyun 发表于 2008-5-28 10:59 | 显示全部楼层 |阅读模式
 * Name:    Gpio.c
 * Purpose: GPIO usage for STM32
 * Version: V1.00

The 'GPIO' project is a simple program for the STM32F103RBT6 
using Keil 'MCBSTM32' Evaluation Board and demonstrating 
the use of the GPIO ports.

 - Pressing buttons S2, S3 move the lit LED.
   press S2 to move the lit LED to the right
   press S3 to move the lit LED to the left
 
The Gpio program is available in different targets:
  Simulator:   - configured for software Simulator
  MCBSTM32:    - runs from Internal Flash located on chip
                 (used for production or target debugging)
==================================
这个例子不知道大家有没有。
最早的GPIO在RAM里面调试的例子。
我现在能够把S2 S3在GPIO.C的程序中修改对应的GPIO管脚。
A口和C口对换,TAMPER和WAKEUP对换没问题。
但是,如果把JOYSTICK加入的话,因为在E口,但是发现一直没找到办法使得GPIO的E口使能。

能否指点一下?

我现在是这样。 对应的S2 S3下面的GPIOX都会修改。GPIOA和GPIOC这样对换了做没问题。
 楼主| johnnyqyun 发表于 2008-5-28 11:06 | 显示全部楼层

RT

#define __GPIO_SETUP              1
#define __GPIO_USED               0x07
#define __GPIOA_CRL               0x00000004
#define __GPIOA_CRH               0x00000000
#define __GPIOB_CRL               0x00000004
#define __GPIOB_CRH               0x33333333
#define __GPIOC_CRL               0x33000000
#define __GPIOC_CRH               0x00400033
#define __GPIOD_CRL               0x00000000
#define __GPIOD_CRH               0x00000000
#define __GPIOE_CRL               0x00000000
#define __GPIOE_CRH               0x00000000

是不是这一段  INIT_C里面,把 D口E口的CRL CRH都要修改?
 楼主| johnnyqyun 发表于 2008-5-28 18:18 | 显示全部楼层

#define __GPIO_USED 0x07

搞定一个问题。 这个要修改。
后面的问题是。。。 左按键右按键。。。
改的有问题
-_-iiii
继续改。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

13

主题

115

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部