Description of functions
AN3954
20/47
Doc ID022016 Rev 4
With X:
0: Communication in UART mode
1: Communication in SPI Mode
Returned value
:
iresult:
0: No error
5: CR95HF demonstration board not connected
Source code example
int Get_Interface_Pin_State (void)
{
int iresult;
char strAnswer[50]="";
char entry3;
printf("\n\n\n\n");
iresult = CR95HFDLL_getInterfacePinState(strAnswer);
printf("\nGet Interface Pin State CR95HFDLL_getInterfacePinState
function:\n");
printf("\n --> request :
CR95HFDLL_getInterfacePinState(strAnswer)");
printf("\n <-- answer : ");
if (iresult == 0)
{
printf("%s = Get Interface Pin State successfully\n\n\r",
strAnswer);
if (strAnswer[5] == '0')
printf("\n %c = communication in UART
mode",strAnswer[3]);
else
printf("\n %c = communication in SPI
mode",strAnswer[3]);
}
else
printf("\n %s = No answer from CR95HF demonstration board
\n\n\r", strAnswer);
printf("\n\n\n\n");
printf("\npress any key to continue");
printf("\n");
scanf("%s", &entry3);
return iresult;
}
2.3
Functions to communicate with the CR95HF IC
2.3.1 CR95HFDll_Idn
This function sends a USB request to the STM32 MCU that requests the IDN of the
CR95HF IC. The STM32 MCU sends back the answer of the CR95HF containing the IDN
value (ASCII codes), if possible, or returns an error code ‘1’ if there is no answer.