'NRFX_TWIM1_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_TWI0_INST_IDX'?

Hello, sir.

I used to work on twi0 and twi1, but now I'd want to shift both twim0 and twim1. However, I'm getting an error saying that 'NRFX TWIM1 INST IDX' is undeclared here (not in a function); did you mean 'NRFX TWI0 INST IDX'?
I checked the NRFX TWIM1 ENABLED macro in the nrfx spim.h file, and it's disabled in apply old config.h, but it's enabled in the sdk config.h file.
Why is apply old config.h being used instead of sdk config.h? What is the best way to solve this issue?
Please take a look at the sdk config.h file I've sent.

2133.sdk_config.txt

  • mahi354 said:
    In this code, I broadcast the register address I want to read first, then I call the receive function.
    Could you perhaps clarify my doubt about the receiving function just being the correct way to perform what I'm doing?

    Usually, the difference between read register and write register in TWI communication is the last bit of the address byte. Thus, you should not need to 'broadcast' the address of the register which you want to read before trying to read it.
    You should however always read through the device's datasheet to see how it expects the communication to go, so that you can make sure that your TWI master device is behaving as expected by the slave.

    Best regards,
    Karl

Related