Part Number: F28M35H52C
Tool/software: TI C/C++ Compiler
I'm trying to use FatFs on the m3 core but need to map FatFs' xdev_in and xdev_out functions to the m3's get_char and put_char functions respectively. The instruction for using FatFs here say ...
"The low-level output function is a user provided call-back function to send a byte to the device. Its address should be set to the pointer 'xfunc_out' to set the default output device prior to use it. e.g. xdev_out(uart2_putc); The output function will be called-back from the xputc function. Typically, this function puts the byte to UART, LCD or any output device. xsprintf/xfprintf function override the default output device with its argument.
The low-level input function is a user provided call-back function to read a byte from the device. Its address must be set to the pointer 'xfunc_in' to swich the input device prior to use it. e.g. xdev_in(uart2_getc); The input function will be called-back from the xgets function. Typically, this function reads a byte from input device or file. However when the device reported end of stream, the input function should return a zero. The xgets function aborts with zero on end of stream and the application will able to detect it. The xfgets function override the default input device with its argument."
But I'm struggling to find a get_char and put_char function that simply return or pass a char as their argument. It's been suggested that I use these commands in my main routine...
xdev_out(UARTCharPut);// set output pipe to uart char put function xdev_in(UARTCharGet); // set input pipe to uart char get function
But they don't work because the arguments are wrong.
Is there simple put_char and get_char commands that will work and what library are they in? Also, if I'm using UART0 for text i/o like this...
UARTStdioInit(0);
IntRegister(INT_UART0, UARTStdioIntHandler);
Will that co-exist with the simple get_char / put_char commands?
Thanks in advance.
PS, the xprintf.h library file supplied with FatFs v013b defines the xdev_out and xdev_in functions as follows...
#define xdev_out(func) xfunc_out = (void(*)(unsigned char))(func)
#define xdev_in(func) xfunc_in = (unsigned char(*)(void))(func)
If that helps at all