[En-Nut-Discussion] Where to define PIN mapping

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Feb 18 13:01:44 CET 2013


most recent controller allow to select the pin location for internal
devices. So ethernut needs a way to know about the pin setting. Pin Setting
can be announced to the driver in two ways:
- at compile time with #defines
- at run time with a driver control block(dcb)
While e.g. the dcb solution for a I2C bus with two(SDA/SCK) or three pins
(SMB)pin is most flexible, for a full fledged uart solution with RX, Tx and
all the controll lines the dcb get tedious and will use some or maybe on a
AVR lot of RAM.

Furthermore when the pin setup is done with defines, pin setup can be made
in the configurator, as most stm32 drivers do or in the board.h file.

Is there some policy or consense what solution to choose?

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