Missing functions in API header files

Dear all,

When doing CIR reading in PDOA mode 3, several registers/sub-registers values need modification. But I cannot find a way to modify them. I tried using functions like dwt_modify32bitoffsetreg, but it seems they are not defined in the header files, and I get an undefined reference error. Indeed I cannot find them in deca_device_api.h.
Am I missing something? Or is there another way to modify the values in the registers/sub-registers?
I’m using QM33120WDK1 kit by the way.

Thank you!

Hi @BC0023 ,

Can you give more details? Which registers you want to modify?

Hi @Wassim_Qorvo ,

Thanks for the reply. I’m trying to modify the following registers marked in blue as in the snapshot.

Hi @BC0023 ,

If you’re using QM33120WDK1, I would suggest that you look to QM33100 User Manual since some registers may have different adress compared to DW3000.
For the register you’re looking for, the adress did not change:

uint32_t data = 0;
dw->dwt_driver->dwt_ops->ioctl(dw, DWT_READ_REG, 0x110004, (void *)&data);

Then change the bit you want, and write again to the same register
dw->dwt_driver->dwt_ops->ioctl(dw, DWT_WRITE_REG, 0x110004, (void *)data);

1 Like

Hi @Wassim_Qorvo

Many thanks! I will try.
Have a nice day!

Hi @Wassim_Qorvo,

Could you help me with the following issue

I need to use dwt_readaccdata() with STS mode and PDOA mode 3. In this case, since the offset is 1024 and 1536 for the two CIR sequences, I need to use an indirect SPI read. That is to say, set PTR_ADDR_A and PTR_ADDR_B to 0x15, set PTR_OFFSET_A to 1024, PTR_OFFSET_B to 1536, and INDIRECT_PRT_A, INDIRECT_PRT_B to normal (how to use it by the way?).
If that is correct, after all the settings, I need to call dwt_readaccdata(). But what is the sampleOffset now ?

Thanks in advance

Hi @Wassim_Qorvo!

Tried your example and the reading part works like a charm. Tried some different registers to verify the default values were correct. But when I try writing back new values nothing seems to happen? I do a second read just like the first after writing and then the original (default) values are back. Both ioctl(Read) / ioctl(Write) returns 0. Isn’t the last data parameter in your example missing a “&” (“void *)data” → “void *)&data”), still nothing happens just curious? Do I need to unlock writing somehow, or apply it for it to take effect?

Just to clarify, this is my code:

uint32_t clkCtrl;
int iResult = dw->dwt_driver->dwt_ops->ioctl(dw, DWT_READ_REG, 0x110004, (void *)&clkCtrl);

clkCtrl |= (0b1 << 18); //Enable GPIO_DCLK_EN
clkCtrl |= (0b1 << 16); //Enable GPIO_CLK_EN
clkCtrl |= (0b1 << 19); //Enable GPIO_DRST_N
iResult = dw->dwt_driver->dwt_ops->ioctl(dw, DWT_WRITE_REG, 0x110004, (void *)&clkCtrl);  //Tried without &

clkCtrl = 0;
iResult = dw->dwt_driver->dwt_ops->ioctl(dw, DWT_READ_REG, 0x110004, (void *)&clkCtrl);