LPUART SENDING VALUES

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

LPUART SENDING VALUES

ソリューションへジャンプ
1,102件の閲覧回数
sushma
Contributor III

Hello 

I want to send int values using LPUART , I'm using the example code lpuart_echo_s32k144 and modified the main accordingly:



#include "Cpu.h"
#include "pin_mux.h"
#include "dmaController1.h"
#include "clockMan1.h"
#include "lpuart1.h"

volatile int exit_code = 0;
/* User includes (#include below this line is not maintained by Processor Expert) */
#include <string.h>
#include <stdint.h>
#include <stdbool.h>


int main(void)
{
int CURRENT = 123;
int buffer[5] = {CURRENT};
CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT,
g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);


PINS_DRV_Init(NUM_OF_CONFIGURED_PINS, g_pin_mux_InitConfigArr);


LPUART_DRV_Init(INST_LPUART1, &lpuart1_State, &lpuart1_InitConfig0);

while (1)
{
LPUART_DRV_SendData(INST_LPUART1, (int *)buffer, strlen((int *)buffer));
}

All I recieve on PuTTyis the ASCII equivalent of 123 i.e '{' . What changes must be done in the function call of LPUART_DRV_SendData; so that I get the value I have sent ( i.e as 123 on PuTTy)

Kindly help 

Thank you 

Sushma Mantagani

pastedImage_8.png

ラベル(1)
タグ(2)
0 件の賞賛
1 解決策
978件の閲覧回数
sushma
Contributor III

  Using this function , solved my issue

itoa(CURRENT, buffer, 10);

元の投稿で解決策を見る

0 件の賞賛
1 返信
979件の閲覧回数
sushma
Contributor III

  Using this function , solved my issue

itoa(CURRENT, buffer, 10);

0 件の賞賛