init_host.c

来自「完整的OFDM系统,含Matlab仿真代码和DSP源代码下载.平台Tms320C」· C语言 代码 · 共 67 行

C
67
字号
//init_host.c
//
// Project Red 2002: High Performance OFDM Modem 
// Against Channel Imperfections
// Auther: Linus Falk

#include "ofdm.h"
#include "put_data.h"
#include "channel_est.h"
#include "sync.h"


void wait_for_host(void);

#pragma CODE_SECTION(init_host,"SBSRAM_PROG_MEM");
void init_host(void){
	HOST_READY = FALSE;
	
	//send START_INIT MESSAGE
	//pci_message_sync_send(INIT_START_MM); //sync to be sure that the host gets the first message
	pci_message_send(INIT_START_MM);
	wait_for_host();
	
	//SEND HOST_BUFFER_1_ADDRESS
	pci_message_send(LoadHostBuffer1);
	wait_for_host();
	
	//SEND HOST_BUFFER_2_ADDRESS
	pci_message_send(LoadHostBuffer2);
	wait_for_host();
	
	//SEND BITLOAD_BUFFER_1_ADDRESS
	pci_message_send(BitLoadBuffer1);	//bitload struct
	wait_for_host();
	
	//SEND BITLOAD_BUFFER_2_ADDRESS
	pci_message_send(BitLoadBuffer2); //bitload struct
	wait_for_host();
	
	//SEND CHANNEL ESTIMATE ADDRESS
	pci_message_send(H_abs_sqr); //127 32-bit float
	wait_for_host();
	
	//SEND SYNC DIFF ADDRESS
	pci_message_send(&sync_diff); //32-bit int
	wait_for_host();
	
	//SEND SNR ADDRESS
	//pci_message_send(&snr); //32-bit float
	pci_message_send(&snr_int); //32-bit int
	
	
	//initiazlize done
	evm_led_enable(0);
}


#pragma CODE_SECTION(wait_for_host,"SBSRAM_PROG_MEM");
void wait_for_host(void){
	while(HOST_READY != TRUE){
		//wait
	}
	HOST_READY = FALSE;
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?