Hi,
I have enabled the clock for LPUART0 and tried the same.
But not able to send any bytes.
Before enabling the clock the Uart_Init(NULL_PTR); itself getting failed to enable uart peripheral.
Now uart peripheral is successfully initiated and when trying to send am getting result as follows.
Send_Data(&char_a,1); // transmit n number of bytes to terminal
Uart_AsyncSend return with E_OK
and
Uart_GetStatus return ONgoing.
please check the attached LPuart transmit function for sending.
_nikhil
#include "Mcal.h"
#include "CDD_Uart.h"
#define UART_LPUART_CHANNEL 0 //LPUART Channel 0 for LTE Module.
Std_ReturnType Send_Data(const uint8* pBuffer, uint32 length);
Std_ReturnType Send_Data(const uint8* pBuffer, uint32 length) {
volatile Std_ReturnType T_Uart_Status;
volatile Uart_StatusType Uart_TransmitStatus = UART_STATUS_TIMEOUT;
uint32 T_bytesRemaining;
uint32 T_timeout = 0xFFFFFF;
/* Uart_AsyncSend transmit data */
T_Uart_Status = Uart_AsyncSend(UART_LPUART_CHANNEL, pBuffer, length);
if (E_OK != T_Uart_Status)
{
return E_NOT_OK;
}
/* Check for no on-going transmission */
do
{
Uart_TransmitStatus = Uart_GetStatus(UART_LPUART_CHANNEL, &T_bytesRemaining, UART_SEND);
} while (UART_STATUS_NO_ERROR != Uart_TransmitStatus && 0 < T_timeout--);
if ((UART_STATUS_NO_ERROR != Uart_TransmitStatus))
{
return E_NOT_OK;
}
return E_OK;
}