diff options
Diffstat (limited to 'Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/MDK-ARM/Serial.c')
-rw-r--r-- | Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/MDK-ARM/Serial.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/MDK-ARM/Serial.c b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/MDK-ARM/Serial.c new file mode 100644 index 000000000..8853ae218 --- /dev/null +++ b/Projects/P-NUCLEO-WB55.Nucleo/Examples_LL/I2C/I2C_OneBoard_AdvCommunication_DMAAndIT_Init/MDK-ARM/Serial.c @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------- + * Name: Serial.c + * Purpose: Low Level Serial Routines + * Note(s): possible defines select the used communication interface: + * __DBG_ITM - ITM SWO interface + *---------------------------------------------------------------------------- + * This file is part of the uVision/ARM development tools. + * This software may only be used under the terms of a valid, current, + * end user licence from KEIL for a compatible version of KEIL software + * development tools. Nothing else gives you the right to use this software. + * + * This software is supplied "AS IS" without warranties of any kind. + * + * Copyright (c) 2008-2011 Keil - An ARM Company. All rights reserved. + *----------------------------------------------------------------------------*/ + +#include <stm32wbxx.h> /* STM32wbxx Definitions */ +#include "Serial.h" + +#ifdef __DBG_ITM +volatile int ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* CMSIS Debug Input */ +#endif + + +/*---------------------------------------------------------------------------- + Write character to Serial Port + *----------------------------------------------------------------------------*/ +int SER_PutChar (int c) { + + ITM_SendChar(c); + return (c); +} + + +/*---------------------------------------------------------------------------- + Read character from Serial Port (blocking read) + *----------------------------------------------------------------------------*/ +int SER_GetChar (void) { + + while (ITM_CheckChar() != 1) __NOP(); + return (ITM_ReceiveChar()); + +} |