[En-Nut-Discussion] Bit banging drivers broken?

Harald Kipp harald.kipp at egnite.de
Sat Oct 6 13:13:38 CEST 2012

Hi Uwe,

On 05.10.2012 18:12, Uwe Bonnes wrote:

>     Harald> OK, I understood that.
> Is this a "go" for the incomplete_gpio/<driver_name.c> approach?

Yes, I do not have any objections.

> Does app/tcps.c work reliable on any architecture that has the need to
> enable a port clock, like at91sam7, STM32 or LPC? There is no call to
> GpioPinConfig, so the port clock is not switched on. _Maybe_ something else
> did the initialization before, but no guarantee.

You are right. This example had been originally written for the 8-bit
AVR and possibly works on the other platforms by accident, having clocks
enabled by some other drivers. Needs to be corrected.

> app/portdio.c carries the arch/board specific cruft that should be
> avoided. board.h should define generic values like LEDX_PORT ans LEDX_PIN
> It also carries hard coded values, as
> #if defined(ETHERNUT1) || defined(ETHERNUT2)
> #define INBANK      2    /* PORTB */
> which should be
> #define INBANK      NUTGPIO_PORTB    /* PORTB */
> on platforms with "incomplete" Gpio API.

You misunderstood my point. I did not demand to make app/portdio.c
working on all platforms. I demand not to break its current working
state. Furthermore, tcps and portdio are meant as test cases. If they
break, many existing applications we are not aware of, will break too.
This should be avoided.

>     Harald> http://www.ethernut.de/nutwiki/Generic_Port_Access
>     Harald> then existing applications should survive this change.
> Why does http://www.ethernut.de/nutwiki/Generic_Port_Access do board
> specific stuff. The example only works on Ethernut1-3.

This example does not claim to work on other boards. It's meant as a
template. You probably overlook, that many boards exists, which are not
officially supported. We should not break applications on custom boards
as well, even if they are not part of board.h.

>     Harald> http://www.ethernut.de/nutwiki/Unified_GPIO_Implementation
>     Harald> This had been done by Ulrich Prinz (and partly by Thiago Correa)
>     Harald> more than 2 years ago.
> How can I write access the document?  There are flaw that I want to point
> out and maybe introduce more considerations.

That would be appreciated.

Somehow spambots managed to bypass any login procedure I tried. I
finally gave up and generally disabled logins for unregistered users.
Please send a private email with your desired user name and I'll
register that user.



More information about the En-Nut-Discussion mailing list