/**************************************************************************** * * Copyright © 2018-2019 STMicroelectronics - All Rights Reserved * * License terms: STMicroelectronics Proprietary in accordance with licensing * terms SLA0089 at www.st.com. * * THIS SOFTWARE IS DISTRIBUTED "AS IS," AND ALL WARRANTIES ARE DISCLAIMED, * INCLUDING MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * * EVALUATION ONLY – NOT FOR USE IN PRODUCTION *****************************************************************************/ /* Inclusion of the main header files of all the imported components in the order specified in the application wizard. The file is generated automatically.*/ #include "components.h" #include "serial_lld_cfg.h" #include uint8_t typedChar[1] = " "; void sddmatxcb(SerialDriver *sdp) { (void)sdp; pal_lld_togglepad(PORT_F, PF_LED1); } void sddmarxcb(SerialDriver *sdp) { (void)sdp; pal_lld_togglepad(PORT_F, PF_LED2); (void)sd_lld_read(&SD5, typedChar, 1); } /* * Application entry point. */ int main(void) { char message[64]; /* Initialization of all the imported components in the order specified in the application wizard. The function is generated automatically.*/ componentsInit(); /* Enable Interrupts */ irqIsrEnable(); /* * Activates the serial driver 1 using the driver default configuration. */ sd_lld_start(&SD5, &serial_config_sddmacfg); (void)sd_lld_read(&SD5, typedChar, 1); /* Application main loop.*/ for ( ; ; ) { strncpy (message, "Type a character - Last char typed was :", sizeof("Type a character - Last char typed was :"));//uint8_t message[]= "Hello World!\r\n"; strcat(message, (char *)typedChar); strcat(message, "\r\n"); (void)sd_lld_write(&SD5, (uint8_t *) message,(uint16_t)(sizeof(message)/sizeof(message[0]))); osalThreadDelayMilliseconds(1500); } }