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

BLE with spi interrupt

Hi!!

I'm adding spi functionality to S132 and SDK 14.0.0 ble_app_uart now.

The communication which added the function of UART to SPI and the sample code of ble_app_uart are successful.

    for (;;)
    {
		if(0 == nrf_gpio_pin_read(30)){
			SPITxDummy(0x00); //Dummy_Data LOFFSTAT
			SPITxDummy(0x00); //Dummy_Data LOFFSTAT
			SPITxDummy1(0x00); //Dummy_Data CH1
			SPITxDummy(0x00); //Dummy_Data CH2
			SPITxDummy(0x00); //Dummy_Data CH2
			}
        power_manage();
    }

          code1:External interrupt handling


void SPITxDummy1(unsigned char Data)
{
	//uint8_t * p_data;
	nrf_gpio_pin_clear(22);  //CS pin low
	static uint8_t       m_rx_buf[2];
m_rx_buf[0] = 0;
	nrf_drv_spi_transfer(&spi, &Data, 1, m_rx_buf, 2);
//	p_data = *m_rx_buf;
	m_rx_buf[0] = *m_rx_buf;
	nrf_delay_us(100);
	//app_uart_put(m_rx_buf[0]);

}

  code2:ExternalDummy data output




I would like to output five dummy data when the pin 30 goes down, I want to transmit the data wirelessly and see it on the smartphone.

I have 2 questions.

When the 30th pin goes down, should 5 dummy data output instructions be placed in the for statement here?

I want to receive data with Dummy 1 and transfer the data over wireless,I want to receive data with Dummy 1, want to transfer data by radio, but how do I store the data received by SPI in p_data on nus_data_handler??

I sincerely wish to achieve this project from the bottom of my heart.

If you have something to know, please tell me!!!

thank you in advanced!!!

Related