[En-Nut-Discussion] nutgpio_port_t nutgpio_pin_t

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Feb 11 13:04:39 CET 2013


>>>>> "Harald" == Harald Kipp <harald.kipp at egnite.de> writes:

    Harald> Hi all, I noticed, that 2 new types nutgpio_port_t and
    Harald> nutgpio_pin_t had been introduced. However, it looks to me that
    Harald> these types are not available for all platforms. As a result, I
    Harald> get

    Harald> ../../nut/dev/i2cbus_gpio.c:78:5: error: unknown type name
    Harald> 'nutgpio_port_t' ../../nut/dev/i2cbus_gpio.c:80:5: error:
    Harald> unknown type name 'nutgpio_pin_t'
    Harald> ../../nut/dev/i2cbus_gpio.c:82:5: error: unknown type name
    Harald> 'nutgpio_port_t' ../../nut/dev/i2cbus_gpio.c:84:5: error:
    Harald> unknown type name 'nutgpio_pin_t'
    Harald> ../../nut/dev/i2cbus_gpio.c:389:6: error: 'nutgpio_port_t'
    Harald> undeclared here (not in a function)
    Harald> ../../nut/dev/i2cbus_gpio.c:390:6: error: 'nutgpio_pin_t'
    Harald> undeclared here (not in a function)

    Harald> when building for the AT91SAM7SE. I assume, that AVR32 is
    Harald> missing as well. Not sure about Luminary (branch), GameBoy (old
    Harald> but still funny) ... may be more.

    Harald> For Freescale I see

    Harald>  typedef uint_fast8_t nutgpio_port_t; typedef uint_fast8_t
    Harald> nutgpio_pin_t;

    Harald> instead of

    Harald>  typedef uint32_t nutgpio_port_t; typedef uint32_t
    Harald> nutgpio_pin_t;

    Harald> Is that intentional?

Yes, it is intentional:
>From looking at mcf5225x_gpio.h

#define MCF_GPIO_PORT(bank)  (*(volatile uint8_t *)(0x40100000 + (bank)))
#define MCF_GPIO_DDR(bank)   (*(volatile uint8_t *)(0x40100018 + (bank)))

using anything greater 0x17 as bank will cause havok.

So banks go from 0...0x17 and only uint_fast8_t is needed.

Bye
-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------


More information about the En-Nut-Discussion mailing list