unsigned char getUserInputData(void) { unsigned char isCorrect = 0; unsigned char data; do { SIO_SendString("\r\nEnter data:", 13); data = SIO_GetChar(); SIO_SendString("\r\nIs the data \"", 15); SIO_SendChar(data); SIO_SendString("\" correct? [y/n]", 16); isCorrect = SIO_GetChar(); } while(isCorrect != 'y'); SIO_SendString("\r\n", 2); return data; }
unsigned int getUserInputAddress(void) { unsigned char isCorrect = 0; unsigned char addrl, addrh; //unsigned int address; do { SIO_SendString("\r\nEnter address [low, high]:", 28); addrl = SIO_GetChar(); addrh = SIO_GetChar(); SIO_SendString("\r\nIs the address \"", 18); SIO_SendChar(addrh); SIO_SendChar(addrl); SIO_SendString("\" correct? [y/n]", 16); isCorrect = SIO_GetChar(); } while(isCorrect != 'y'); SIO_SendString("\r\n", 2); return (unsigned int) (((unsigned int) addrh << 8) | addrl); }
int serial3_getc(void) { return SIO_GetChar (&gUart3Channel); }