Redefine NFC pins for GPIO in PlatformIO

I am trying to connect a NEO-6M GPS module to the XIAO BLE but the only pins that are free on my board are the I2C (SDA, SCL) and NFC pins. As far as I know its not possible to connect the neo-6m board to the I2C pins, so I was wondering if the NFC can be redefined as GPIO. Has anyone been successful in redefining these? If yes, please guide me on the changes that I would need to do in the PlatformIO IDE. Thanks

Hi there,
And Welcome… AFAIK if it’s on the pins spreadsheet on the Wiki as a GPIO , then it certainly can and if you have NO I2C devices then definitely can be used as GPIO. Standar tech applies i.e. define pin as I/O with or without pull-ups etc. and use digital.write to move it.
HTH
GL :slight_smile: PJ :v:

@PJ_Glasso Thanks PJ_Glasso. I have added this in my code since I am not using any I2C peripherals, would this disable SDA and SCL to the pins and convert them to GPIO, or do I need any additional code to enable GPIO on pins 4 & 5?

#define PIN_WIRE_SDA (-1)
#define PIN_WIRE_SCL (-1)

Sorry, I’m very new to programming and have no formal education in embedded systems.

Hi there,
Nope, Your good, just treat them like normal pins now.
Using INPUT and OUTPUT, PullUP ,etc.
HTH
GL :slight_smile: PJ :v:

1 Like