How do I write directly to regiters in Mbed (set the GPIO voltage to 3.3V)

  1. I would like to set the output of my GPIOs in my nRF52840 to 3.3V instead of the default 1.8V.
  2. I have found a register called REGOUT0 that needs a value of 5 to be set.
  3. I also found a structure called NRF_UICR_Type containing the
    typedef struct {
    __IO uint32_t UNUSED0;
    __IO uint32_t UNUSED1;
    __IO uint32_t UNUSED2;
    __I uint32_t RESERVED0;
    __IO uint32_t UNUSED3;
    __IO uint32_t NRFFW[15];
    __IO uint32_t NRFHW[12];
    __IO uint32_t CUSTOMER[32];
    __I uint32_t RESERVED1[64];
    __IO uint32_t PSELRESET[2];
    __IO uint32_t APPROTECT;
    __IO uint32_t NFCPINS;

__IO uint32_t DEBUGCTRL;
__I uint32_t RESERVED2[59];
__IO uint32_t DCDCDRIVE0;

__IO uint32_t REGOUT0;

} NRF_UICR_Type;

I just don’t know where to read and write the structure!!!

Can anyone shed some light on this??

Hi,

Have you try to supply 3.3 V to VDD? GPIO pins output should be the same.
With mbedOS you can’t modify registers (at least easily) because it is very difficult to say what mbedOS is doing with the same register. At least from the application.

Regards,
Pekka