用DSP的UART传输数据时候选择是非FIFO模式,可以每次传输8位。我通过AD采集的数据是Int16位的数组(Int16 A [1000];),所以需要把16位int转成高8位和低8位组合的数组(char B [2000]),例如假设数组中其中一个数int A[1]=999;要拆成char B[2]={09,99},然后要将charB数组转成十六进制char B[2]={0x09,0x63};
请问这样的过程应该如何编程?谢谢!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
因为我看csl API上的宏CSLBool UART_write(char *pBuf, Uint16 length, Uint32 timeout);
例子是
Uint16 length = 4;
char pbuf[4] = {0x74, 0x65, 0x73, 0x74};
CSLBool returnFlag;
ReturnFlag = UART_write(&pbuf[0],length,0);
它是这样写的,我可以实现。
现在实际情况是ad出的数据想通过串口出来检测烧写的程序能否采出正确的数据,所以需要将int16 A[1000]转成char*pBuf