I use nrf51822qfaa,s110,v8.0. now i use the TWI master.the nrf_drv_twi_tx function always return 0x03(NRF_ERROR_INTERNAL),WHY?WHO can help me?
code: nrf_drv_twi_t twi_instance = NRF_DRV_TWI_INSTANCE(1); // Set up TWI instance 1 with default values nrf_drv_twi_config_t p_twi_config; p_twi_config.scl = 5; p_twi_config.sda = 6; p_twi_config.frequency = NRF_TWI_FREQ_400K; p_twi_config.interrupt_priority = APP_IRQ_PRIORITY_LOW;
ret_code = nrf_drv_twi_init(&twi_instance, &p_twi_config, NULL); // Initiate twi driver with instance and configuration values
APP_ERROR_CHECK(ret_code); // Check for errors in return value
nrf_drv_twi_enable(&twi_instance); // Enable the TWI instance
uint32_t ret_codex;
ret_codex = nrf_drv_twi_tx(p_twi_instance, pn532_address, tx_data, tx_len, false); APP_ERROR_CHECK(ret_codex); // Check for errors in return value nrf_delay_ms(5);