[En-Nut-Discussion] What is the best way to deal with different I/O pin configuration on different boards
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Thu Oct 11 19:14:27 CEST 2012
>>>>> "Ole" == Ole Reinhardt <ole.reinhardt at embedded-it.de> writes:
<snip : Description on the present configuration situation >
Ole> So I'm thinking about a better way to do the configuration.
Ole> Sorry for taking the linux example again:
Ole> On the arm architecture pin setup is mostly done by defining a list
Ole> of I/O pin settings and to initially set them up during boot time
Ole> in the board init file.
Ole> Beside of that, some platform drivers provide a so called "plaform
Ole> data" struct which is initialised and assigned to the device struct
Ole> right before initialising the driver. This platform data is set at
Ole> a reference in the DBC struct of the driver and the driver can
Ole> access this struct later at any time it needs the informations.
Ole> In other words:
Ole> I would prefer to leave the I/O pin configuration up to the user
Ole> and it should be done in the board init file.
Ole> Further I find the concept of the platform data which could hold
Ole> driver specific default configurations for each board quite
Ole> appealing.
Ole> They could hold for example the default baud rate etc. for a UART
Ole> or the MAC address for the network interface and the default ID of
Ole> a I2C device.
Ole> This way we could move lots of configuration settings out of the
Ole> configurator and move it into the board startup code.
Ole> This way we would likely end up in cleaner configurator scripts and
Ole> more flexible configurations for the end-user. Last but not least
Ole> it would became easy to have only one .conf file that is usable for
Ole> several boards.
Ole> I'd like to hear your comments
Anything that doesn't need to rerun the configurator is a good thing. That
way hardware can be ditributed with Ethernut library source only and no need
for the configuation to compile on the user PC.
It all depends on the Flash and RAM requirements. And AVR with it's special
data in flash handling requirements needs also to be considdered.
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