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

Get TWI event address ( TWI + PPI)

Hello all.

I need to detect when  data is received on RX. I am planning to use it with PPI channel so i could instantiate a task to it. 

I tried to use  nrf_twi_event_address_get to get the address of event so i could assign to a PPI channel. But Kiel warns me that  Implicit declaration of function is invalid, and give me the error:  #20: identifier "nrf_drv_twi_event_address_get" is undefined, even though I have nrf_drv_twi, /hal/nrf_twi added in the path. 

So how can i get the address of TWI events and use it with PPI? 

Thank you

Parents
  • I tried both commands 

         uint32_t *twi_evt = nrf_twi_event_address_get(&m_twi,NRF_TWI_EVENT_BB);
    
         uint32_t twi_event_addr = nrf_drv_twi_event_address_get(&m_twi,NRF_TWI_EVENT_RXDREADY);



    In both i got warnings. 

        ..\..\..\main.c(499): error:  #167: argument of type "const nrf_drv_twi_t *" is incompatible with parameter of type "NRF_TWI_Type *"  ->  first line

    Implicity declaration of nrf_drv_twi_event_address_get  is invalid in c99 -> second line

  • You're trying to mix driver and HAL layers - nrf_twi_event_address_get expects an address of TWI peripheral, not an instance structure. It's possible to use an address of TWI peripheral directly (NRF_TWI0 for instance 0 and  so on), but the right way is to work only with HAL functions if you need a low-level access to twi registers.

Reply Children
No Data
Related