how to soft reset nrf51 in ble application??
If you are using a SoftDevice you can use sd_nvic_systemreset()
ret_code_t mma8452_I2C_register_read(uint8_t slave_addr, uint8_t reg_addr, uint8_t * pdata, uint32_t bytes)
{
ret_code_t ret_code;
ret_code = nrf_drv_twi_tx(p_twi_master,slave_addr, ®_addr,1,true);
if(ret_code != NRF_SUCCESS)
{
return ret_code;
}
ret_code = nrf_drv_twi_rx(p_twi_master,slave_addr, pdata, bytes, false);
return ret_code;
}
ret_code_t mma8452_I2C_register_read(uint8_t slave_addr, uint8_t reg_addr, uint8_t * pdata, uint32_t bytes)
{
ret_code_t ret_code;
ret_code = nrf_drv_twi_tx(p_twi_master,slave_addr, ®_addr,1,true);
if(ret_code != NRF_SUCCESS)
{
return ret_code;
}
ret_code = nrf_drv_twi_rx(p_twi_master,slave_addr, pdata, bytes, false);
return ret_code;
}