This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

enable twim0

can somebody help me on how to enable twim0..

it was no problem in twi_sensor example...now i am integrating twi_sensor in ble_eddystone...and on built it give an error of "'NRF_DRV_TWI_INSTANCE_0' undeclared here (not in a function); did you mean 'NRF_DRV_TWI_INSTANCE_'?" i changed sdk
_config of eddystone too...  am i doing right..???

below is nrf_drv_twi.h file ...which shows that twim0 is not enabled..can you solve yhis problem..it would be great help..thank you.

Parents
  • Hi, 

    Could you try to enable TWI_ENABLED in the sdk_config.h?

    // <e> TWI_ENABLED - nrf_drv_twi - TWI/TWIM peripheral driver - legacy layer
    //==========================================================
    #ifndef TWI_ENABLED
    #define TWI_ENABLED 1
    #endif

    When you are integrating twi_sensor into ble_eddystone, you could refer to the sdk_config.h of twi_sensor.

    -Amanda H.

  • yes..i did all changes. ..now it is working...but the problem is that it reads the registers but all the valuse are getting in m_sample variable....i am returning *p_data from read function and have assigned a variable to catch values in..but they are not displaying in those variables....it is only remaining in m_sample..

    what could be the reason.??

    this is what i am doing 

    rslt_MSB = nrf_drv_vcnl4020_read_registers(0x87,&m_sample,1); // command to read result register 0x87 (MSB bits) of vcnl4020

    rslt_MSB = m_sample; //m_sample holds the values of result register..copy it to rslt_MSB variable.

    rslt_LSB = nrf_drv_vcnl4020_read_registers(0x88,&m_sample,1); //command to read result register 0x88 (LSB bits) of vcnl4020

    rslt_LSB = m_sample;

    am i doing it right ??

    and i have integrated twi_sensor into eddystone...can you halp..??

    Thank you.

Reply
  • yes..i did all changes. ..now it is working...but the problem is that it reads the registers but all the valuse are getting in m_sample variable....i am returning *p_data from read function and have assigned a variable to catch values in..but they are not displaying in those variables....it is only remaining in m_sample..

    what could be the reason.??

    this is what i am doing 

    rslt_MSB = nrf_drv_vcnl4020_read_registers(0x87,&m_sample,1); // command to read result register 0x87 (MSB bits) of vcnl4020

    rslt_MSB = m_sample; //m_sample holds the values of result register..copy it to rslt_MSB variable.

    rslt_LSB = nrf_drv_vcnl4020_read_registers(0x88,&m_sample,1); //command to read result register 0x88 (LSB bits) of vcnl4020

    rslt_LSB = m_sample;

    am i doing it right ??

    and i have integrated twi_sensor into eddystone...can you halp..??

    Thank you.

Children
No Data
Related