This message was posted on behalf of Intel Corporation
Thank you for contacting us.
There’s no mistake in the documentation, I believe the confusion is because of how the information is presented on the charts. Please allow us to explain. Whenever an expansion board is connected to the Edison, MRAA evaluates the expansion board connected as either an Arduino expansion board or a mini breakout board. If the Arduino expansion board is connected, then the MRAA mapping is just as the pin number. It goes from 0-13 for GPIOs and for 0-5 for analog pins. If you connect a mini breakout board to the Edison, then you’d have to check the Edison pin numbers from the MRAA docs here: https://iotdk.intel.com/docs/master/mraa/edison.html . You mentioned an example where you suspect MRAA number 37 might be inaccurate in the documentation. MRAA number 37, in this case is used in the mini breakout board and is mapped to the physical pin J19-10.
I hope this information is clear. Let me know if you have any questions, we’d be happy to clarify if needed.
thank you for your explanations!
Can I understand it in this way, for Arduino expansion board, GPIO 0 to 13 are mapped to the same number in MRAA, and A0 - A5 are mapped to 14 - 19 in MRAA, so I can use mraa_gpio_init() to initialize them for GPIO purpose. For analog usage, it's from number 0 to 5 in MRAA, so when I put number 0 - 5 in mraa_aio_init() function, MRAA knows now it's analog pin.