Hi Markus,

On Mon, Feb 26, 2018 at 11:36:41AM -0800, markus wrote:
> Is there some documentation about the numbers, meanings and relationship (if 
> any) of the 3 different device numbers?
> 
>  -) syscfg, eg UART_0
>  -) device name, eg "uart0"
>  -) mcu HW device, eg "USART2"

The short answer is: unfortunately no, there isn't any documentation
about how devices should be numbered.  I think the device numbering
scheme is something that evolved without any concrete plan, so a
conversation might be a good idea.

For the first two (syscfg and os_dev name): these should always
correspond to the same device.  I.e., `UART_0` syscfg settings should
configure the device called "uart0".

The third item (name that the MCU datasheet assigned to a peripheral) is
not so straightforward.  I think there is some tension due to two
conflicting goals:
    1. Make setting names consistent with names in MCU documentation.
    2. Make setting names consistent among all BSPs.

The second goal seems to have won out over the first.  The reason the
second goal is important is that it allows for BSP-agnostic libraries
and apps.  For example, a library that requires a UART can be configured
to use a UART number without worrying about whether the MCU
documentation calls the device "UART 0" or "USART 0".

If you have any thoughts on how this could be improved, please don't
hesitate to share them.  The same goes for other readers!

Chris

Reply via email to