2.124.38 USARTx_LIN_IdentifierWrite Function

C

/* x = USART instance number */

/* Blocking and Ring buffer mode */

bool USARTx_LIN_IdentifierWrite( uint8_t id)

Summary

This API allows the application to set LIN Node ID which is part of LIN Header

Description

This API allows the application to set LIN Node ID which is part of LIN Header

Precondition

USARTx_Initialize must have been called for the associated USART instance.

Parameters

ParamDescription
idLIN ID to be set during transmission of LIN header

Returns

API returns True or False indicating success or fail to set the LIN Id

Example

uint8_t txBuffer[10];
void LIN_MasterTransmit(uint8_t pid, uint8_t* pData, uint8_t nBytes)
{
    nTxBytes = 0;       
    
    while (nBytes--)
    {
        txBuffer[nTxBytes++] = *pData++;
    }    
          
    USART0_LIN_ResponseDataLenSet(LIN_NUM_OF_BYTES_TRANSFER_FROM_HOST_TO_CLIENT);
    
    /* Transmit- PID */
    USART0_LIN_IdentifierWrite(pid);
    
    /* Transmit- DATA + CHECKSUM */ 
    USART0_Write(txBuffer, nTxBytes);
}

Remarks

None