6 years, 11 months ago.

How to write to MAX32630 registers?

I'm aware mbed provides us with a library that handles pretty much everything but I need to access certain registers in order to use the Bluetooth module. Do I need to establish a I2C,SERIAL or SPI communication? A little help please. The register I need to modify is the PWRSEQ_REG0.

Question relating to:

MAX32630 Rapid Development Platform

Hello Mariano,

Can you please elaborate on what you are trying to do? There may be code already developed that acomplishes what you are trying to do.

Thanks, Justin

posted by Justin Jordan 26 May 2017

I just want to use the PAN1326B module.

posted by Mariano Coromac 26 May 2017

1 Answer

6 years, 11 months ago.

The internal registers are included, but buried in the mbed library.

Add these includes:

Include register definitions:

#include "cmsis.h"          // register base address definitions
#include "pwrseq_regs.h"    // power sequence register definitions

Then you can access the registers like this:

Access internal registers:

    uint32_t myPwrseqReg0 = MXC_PWRSEQ->reg0;
    myPwrseqReg0 &= ~(MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN);
    myPwrseqReg0 |= myRtcEn << MXC_F_PWRSEQ_REG0_PWR_RTCEN_RUN_POS;
    MXC_PWRSEQ->reg0 = myPwrseqReg0;

Accepted Answer

Thank you! This is exactly what I was looking for.

posted by Mariano Coromac 26 May 2017