Dear Joakim,

> On 30 Nov 2014, at 18:02, Joakim Gebart <joakim.geb...@eistec.se> wrote:
> I would like to have a separate driver for setting up the CPU pin mux.
> That is, separate the CPU logic module drivers (such as SPI, I2C, UART
> etc.) from the actual hardware ports and pins. 

You mean introducing a central point to handle all the PIN initialisation for
the other peripherals? “Mux-driver, initialise pins for UART3!”

> By improving the separation/abstraction it may make it easier use the
> same board directory for multiple variations of the same board, where
> the on board peripherals are the same, or almost the same, and only
> some minor additions.

I see your point here, but couldn’t it be realised by using some different
configuration in periph_conf.h separated by preprocessor guards? Like:

```C
#ifdef MULLE_v1
  #define SPI0_MISO_PIN PA12
  ...
#elif MULLE_v1.2
  #define SPI0_MISO_PIN PB09
  ...
#endif
```

> Because of the hardware function muxing capabilities in advanced MCUs
> is usually in a separate module it is only logical that the driver for
> a CPU module does not need to know anything about which pin numbers on
> the IC is connected to its signals, the driver should only control the
> logic within its own module.

The peripheral interface currently tries to exploit the greatest possible
common set of functionality while minimising overhead. Since such a mux-driver
would mainly be used in the other peripheral drivers it could be optional.
Also it would need evaluation of the impact on more constraint platforms
(cortex-M0 etc.) in terms of memory and clock rate.

I like the idea in general but could you elaborate a little bit more on the
concrete use case and implementation so we can discuss this in more detail.

Best, Thomas



_______________________________________________
devel mailing list
devel@riot-os.org
http://lists.riot-os.org/mailman/listinfo/devel

Reply via email to