/*
 * user_io.h
 *
 * Input/Output functions used mostly by console port.
 *
 *  Created on: Jan 23, 2014
 *      Author: rob
 */

#ifndef PHFETSOS_USER_IO_H_
#define PHFETSOS_USER_IO_H_

#define YES				  		1
#define NO				  		0
#define TIMELIMITPASSED  		-1

void ConfigureUART(void);

time_t getDateAndTime();
void printCurrentTime(void);
void printCurrentEpochTime(void);
void print_time_t_Time(time_t time);

int yesOrNoMenuChoice(char *prompt, int default_response);
int yesOrNoMenuChoiceTimeLimit(char *prompt, int timeLimit);

int getUserInput(char *userInputBuffer,  int userInputBufferSize);
int getUserInputTimeLimit(char *userInputBuffer, int userInputBufferSize, int timeLimit);

void printSysDataParameters();

int32_t getLong(char *prompt);
uint32_t getUnsignedLong (char* prompt);
float getFloat(char *prompt);
void ftoa(long double f,char *buf,int dplaces);

bool kbhit(void);
int getchar_timed(int timeout);
int getChar(void);
char get_key(void);

uint8_t get_key_m2m(void);

int uprintf(const char *format, ...);
int dbg_printf(const char *format, ...);




#endif /* PHFETSOS_USER_IO_H_ */
