On Tue, Dec 07, 2010 at 10:13:18PM +1300, Philip Court wrote:
> I have attached a diff with changes to gpio.h and gpio.c. The changes
> define the remap IO for TIM1 and also provides an implementation for
> gpio_port_configuration_lock.
Thanks, merged in slightly different form. The #defines look OK, but I
changed gpio_port_config_lock() a bit (and renamed it).
> +void gpio_port_configuration_lock(u32 gpioport, u16 gpios)
> +{
> + u32 set = GPIO_LCKK | gpios; //used to set LCKK
> + u32 reset = ~GPIO_LCKK & gpios; //used to reset LCKK
> +
> + GPIOE_LCKR = set;
> + GPIOE_LCKR = reset;
> + GPIOE_LCKR = set;
Changed the hardcoded use of GPIOE here to GPIO_LCKR(gpioport) so it's
usable for all GPIO ports. Let me know if the code still works OK.
Thanks, Uwe.
--
http://hermann-uwe.de | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org
|