arduino / nina-fw

Firmware for u-blox NINA W102 WiFi/BT module
133 stars 116 forks source link

Pin numbering #96

Open davepruitt opened 3 months ago

davepruitt commented 3 months ago

In the setup function in sketch.ino.cpp we find the following code:

pinMode(5, INPUT);
if (digitalRead(5) == LOW) 
{
    setupBluetooth();
} 
else 
{
    setupWiFi();
}

I don't see anywhere in code where pin numbers are defined, nor is there a variant.cpp or variant.h file like in a typical Arduino sketch where these numbers would normally be defined. Are we to understand that pin 5 in this context is GPIO 5 as defined in the NINA-W102 datasheet? (page 15 of this PDF: https://content.u-blox.com/sites/default/files/NINA-W10_DataSheet_UBX-17065507.pdf)

Or is it GPIO28, which the Arduino Nano 33 IoT's schematic weirdly names as GPIO5 (seen here: https://content.arduino.cc/assets/NANO33IoTV2.0_sch.pdf)?

Or is it something else?

Where can these pin definitions be found?

JAndrassy commented 3 months ago

Are we to understand that pin 5 in this context is GPIO 5 as defined in the NINA-W102 datasheet?

yes

Where can these pin definitions be found?

there is no io remaping

io 5 is the slave select pin

the 28 is the 28th contact of of the NINA module, not an io number. as you can see reset is 19th and antenna 13th