KW40Z_Connectivity_Software_1.0.1 serial interface type

cancel
Showing results for 
Search instead for 
Did you mean: 

KW40Z_Connectivity_Software_1.0.1 serial interface type

526 Views
seanwu
Contributor III

Dear Sir,

I use hid_host example in KW40Z_Connectivity_Software_1.0.1

(C:\Freescale\KW40Z_Connectivity_Software_1.0.1\ConnSw\examples\bluetooth\hid_host).

I change the serial interface type from UART to I2C.

I find some the code in the function void shell_writeN(); in shell.c(Line237).

    if( SHELL_IO_TYPE == gSerialMgrIICSlave_c ||

       SHELL_IO_TYPE == gSerialMgrSPISlave_c )

    {

        uint8_t *pHdr = MEM_BufferAlloc(n+5);

        if(pHdr)

        {

           pHdr[0] = 0x02;

            pHdr[1] = 0x77;

            pHdr[2] = 0x77;

            pHdr[3] = n;

            FLib_MemCpy(&pHdr[4], pBuff, n);

            pHdr[4+n] = 0;

            Serial_SyncWrite( gShellSerMgrIf, pHdr, n+5 );

            MEM_BufferFree(pHdr);

        }

    }

    else

    {

        Serial_SyncWrite(gShellSerMgrIf, (uint8_t*)pBuff, n);

    }

If the type is I2C or SPI, there are 0x02, 0x77, 0x77, n(length) at the beginning , and 0 at the end of the message.

Why to define the value 0x02, 0x77,0x77, length? Could you explain it?

Thanks.

BR,

Sean Wu

0 Kudos
1 Reply

98 Views
jorge_a_vazquez
NXP Employee
NXP Employee

Hi seanwu

Sorry for the late reply, that configuration is related with the FSCI framework. You can check the CONNFWKRM.pdf located in the path {Path_KW40Z_Connectivity_Software}\ConnSw\doc In “3.10. FSCI” they explain this framework.

The next image show the packet structure.

ss.png

Hope this can help you.

Best regards

Jorge Alcala

0 Kudos