TM STM32F4xx Libraries  v1.0.0
Libraries for STM32F4xx devices from Tilen Majerle
TM_STDIO_Functions

Library Functions. More...

Functions

void TM_STDIO_SetOutputFunction (FILE *f, int(*outputFuncPointer)(int, FILE *))
 Links file output stream with output put character function. More...
 
void TM_STDIO_SetInputFunction (FILE *f, int(*inputFuncPointer)(FILE *))
 Links file input stream with input get character function. More...
 
int TM_STDIO_StdoutHandler (int c, FILE *f)
 Default output handler for standard output (stdout) More...
 
int TM_STDIO_StdinHandler (FILE *f)
 Default input handler for standard input (stdin) More...
 

Detailed Description

Library Functions.

Function Documentation

void TM_STDIO_SetInputFunction ( FILE *  f,
int(*)(FILE *)  inputFuncPointer 
)

Links file input stream with input get character function.

Parameters
*fPointer to file stream
*inputFuncPointerPointer to function to be used for input data from stream
Return values
None
void TM_STDIO_SetOutputFunction ( FILE *  f,
int(*)(int, FILE *)  outputFuncPointer 
)

Links file output stream with output put character function.

Parameters
*fPointer to file stream
*outputFuncPointerPointer to function to be used to output data to stream
Return values
None
int TM_STDIO_StdinHandler ( FILE *  f)

Default input handler for standard input (stdin)

Note
Needs to be implemented by user if you want to use getc or gets functions
Parameters
*fPointer to file stream
Return values
Successstatus:
  • -1: No data available
  • character: Return character value
Note
With __weak parameter to prevent link errors if not defined by user
int TM_STDIO_StdoutHandler ( int  c,
FILE *  f 
)

Default output handler for standard output (stdout)

Note
Needs to be implemented by user if you want to use printf function
Parameters
ccharacter to output to stream
*fPointer to file stream
Return values
Successstatus:
  • -1: Stop writing any data
  • character: Return back the same character as was passed as parameter to continue with more characters if needed
Note
With __weak parameter to prevent link errors if not defined by user