[En-Nut-Discussion] devnut_m3n/STM32F1: GPIO Speed definition

Ulrich Prinz uprinz2 at netscape.net
Thu Jul 21 15:17:46 CEST 2011


As compaitbility served first at the beginning of my port, GPIO system 
did not implement all extras.
Configurable extra features provided by STM32 was simply mapped to 
existing features.

Together with Thiago I planned a new GPIO definition that makes 
upscaling more easy and provides very simple Value->GPIO code.
But I had no time to implement this till today.
Planning is:
Standard is to switch port to input.
Defining GPIO as output means open_drain/open_collector as push/pull 
can damage hardware.
Input support with multiple options like Schmidttrigger or 
PullUp/PullDown
IO-Speed like you mentioned.

As there will be prepared #defines that provide all those options, the 
numeric value can be optimized for the architecture.

So instead of
switch (option)
  case 0x000001: do_intput(pin);...
  case ...

you can simply GPIOn->CTRL = option;

This will reduce code in all architectures and will reduce performance 
issues on bitbang interfaces enormously.

Best Regards
Ulrich


-----Original Message-----
From: Uwe Bonnes <bon at elektron.ikp.physik.tu-darmstadt.de>
To: en-nut-discussion at egnite.de
Sent: Thu, Jul 21, 2011 12:22 pm
Subject: [En-Nut-Discussion] devnut_m3n/STM32F1: GPIO Speed definition


Hello,rm0008.pdf/V13/page 156/1093 says:Table 21. Output MODE bits      
         MODE[1:0]            Meaning                 00                
Reserved                 01        Max. output speed 10 MHz             
     10        Max. output speed 2 MHz                 11        Max. 
output speed 50 MHzwhile include/dev/gpio_stm32.h defines/*! * \brief 
GPIO output direction enabled. * * If set, the pin is configured as an 
output. Otherwise it is in * input mode or z-state. * For STM32F it is 
configured as output 50MHz. */#define GPIO_CFG_OUTPUT     
0x00000002Shouldn't this be #define GPIO_CFG_OUTPUT     0x00000003and 
perhaps #define GPIO_CFG_OUTPUT_2MHZ   0x00000002#define 
GPIO_CFG_OUTPUT_10MHZ  0x00000001And Args!The STM32F2 GPIO register 
definition is different!Bye-- Uwe Bonnes                
bon at elektron.ikp.physik.tu-darmstadt.deInstitut fuer Kernphysik  
Schlossgartenstrasse 9  64289 Darmstadt--------- Tel. 06151 162516 
-------- Fax. 06151 164321 
----------_______________________________________________http://lists.egn
ite.de/mailman/listinfo/en-nut-discussion
  



More information about the En-Nut-Discussion mailing list