Example #1
0
/**********************************************************
Prototype	void spi_send_msg ( void )
Type			function
Description	Dequeue a spi data from spi_data_queue_XXX_rx
			Unpack the spi data for ipc, raw or rfs data
			Send msg to other task until that all queues are empty
			CP use this functions for other task as below
			IPC : ipc_cmd_send_queue
			RAW : data_send_queue
			RFS : rfs_send_queue
Param input	(none)
Return value	(none)
***********************************************************/
void spi_send_msg_to_app(void)
{
	u32 int_cmd = 0;
	struct ipc_spi *od_spi = NULL;

	#define MB_VALID					0x0080
	#define MB_DATA(x)				(MB_VALID | x)
	#define MBD_SEND_FMT			0x0002
	#define MBD_SEND_RAW			0x0001
	#define MBD_SEND_RFS			0x0100


	od_spi = ipc_spi;


	if (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_IPC_RX) == 0) {
		int_cmd = MB_DATA(MBD_SEND_FMT);
		ipc_spi_make_data_interrupt(int_cmd, od_spi);
	}

	if (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_RAW_RX) == 0) {
		int_cmd = MB_DATA(MBD_SEND_RAW);
		ipc_spi_make_data_interrupt(int_cmd, od_spi);
	}

	if (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_RFS_RX) == 0) {
		int_cmd = MB_DATA(MBD_SEND_RFS);
		ipc_spi_make_data_interrupt(int_cmd, od_spi);
	}
}
int spi_data_check_tx_queue(void)
{
	if ((spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_IPC_TX) == 0)
		|| (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_RAW_TX) == 0)
		|| (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_RFS_TX) == 0))
		return 1; /* has data */
	else if ((spi_data_div_buf_is_empty(SPI_DATA_QUEUE_TYPE_IPC_TX) == 0)
		|| (spi_data_div_buf_is_empty(SPI_DATA_QUEUE_TYPE_RAW_TX) == 0)
		|| (spi_data_div_buf_is_empty(SPI_DATA_QUEUE_TYPE_RFS_TX) == 0))
		return 1; /* has data */
	else
		return 0; /* empty */
}
Example #3
0
/**********************************************************
Prototype	void spi_send_msg ( void )
Type			function
Description	Dequeue a spi data from spi_data_queue_XXX_rx
			Unpack the spi data for ipc, raw or rfs data
			Send msg to other task until that all queues are empty
			CP use this functions for other task as below
			IPC : ipc_cmd_send_queue
			RAW : data_send_queue
			RFS : rfs_send_queue
Param input	(none)
Return value	(none)
***********************************************************/
void spi_send_msg_to_app(void)
{
	u32 int_cmd;
	struct ipc_spi *od_spi;

	od_spi = ipc_spi;

	if (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_IPC_RX) == 0) {
		int_cmd = MB_DATA(MBD_SEND_FMT);
		ipc_spi_make_data_interrupt(int_cmd, od_spi);
	}

	if (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_RAW_RX) == 0) {
		int_cmd = MB_DATA(MBD_SEND_RAW);
		ipc_spi_make_data_interrupt(int_cmd, od_spi);
	}

	if (spi_data_queue_is_empty(SPI_DATA_QUEUE_TYPE_RFS_RX) == 0) {
		int_cmd = MB_DATA(MBD_SEND_RFS);
		ipc_spi_make_data_interrupt(int_cmd, od_spi);
	}
}