Functions | |
| s32 | MIOS32_COM_Init (u32 mode) |
| s32 | MIOS32_COM_CheckAvailable (mios32_com_port_t port) |
| s32 | MIOS32_COM_SendBuffer_NonBlocking (mios32_com_port_t port, u8 *buffer, u16 len) |
| s32 | MIOS32_COM_SendBuffer (mios32_com_port_t port, u8 *buffer, u16 len) |
| s32 | MIOS32_COM_SendChar_NonBlocking (mios32_com_port_t port, char c) |
| s32 | MIOS32_COM_SendChar (mios32_com_port_t port, char c) |
| s32 | MIOS32_COM_SendString_NonBlocking (mios32_com_port_t port, char *str) |
| s32 | MIOS32_COM_SendString (mios32_com_port_t port, char *str) |
| s32 | MIOS32_COM_SendFormattedString_NonBlocking (mios32_com_port_t port, char *format,...) |
| s32 | MIOS32_COM_SendFormattedString (mios32_com_port_t port, char *format,...) |
| s32 | MIOS32_COM_Receive_Handler (void) |
| s32 | MIOS32_COM_ReceiveCallback_Init (void *callback_receive) |
| s32 | MIOS32_COM_DefaultPortSet (mios32_com_port_t port) |
| mios32_com_port_t | MIOS32_COM_DefaultPortGet (void) |
| s32 | MIOS32_COM_DebugPortSet (mios32_com_port_t port) |
| mios32_com_port_t | MIOS32_COM_DebugPortGet (void) |
| s32 MIOS32_COM_CheckAvailable | ( | mios32_com_port_t | port | ) |
This function checks the availability of a COM port
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
0: port not available
| mios32_com_port_t MIOS32_COM_DebugPortGet | ( | void | ) |
This function returns the COM_DEBUG port
| s32 MIOS32_COM_DebugPortSet | ( | mios32_com_port_t | port | ) |
This function allows to change the COM_DEBUG port.
The preset which will be used after application reset can be set in mios32_config.h via "#define MIOS32_COM_DEBUG_PORT <port>".
It's set to USB0 as long as not overruled in mios32_config.h
| [in] | port | COM port (USB0..USB7, UART0..UART1, IIC0..IIC7) |
| mios32_com_port_t MIOS32_COM_DefaultPortGet | ( | void | ) |
This function returns the DEFAULT port
| s32 MIOS32_COM_DefaultPortSet | ( | mios32_com_port_t | port | ) |
This function allows to change the DEFAULT port.
The preset which will be used after application reset can be set in mios32_config.h via "#define MIOS32_COM_DEFAULT_PORT <port>".
It's set to USB0 as long as not overruled in mios32_config.h
| [in] | port | COM port (USB0..USB7, UART0..UART1, IIC0..IIC7) |
Initializes COM layer
| [in] | mode | currently only mode 0 supported |
| s32 MIOS32_COM_Receive_Handler | ( | void | ) |
Checks for incoming COM messages, calls the callback function which has been installed via MIOS32_COM_ReceiveCallback_Init()
Not for use in an application - this function is called by by a task in the programming model!
| s32 MIOS32_COM_ReceiveCallback_Init | ( | void * | callback_receive | ) |
Installs the callback function which is executed on incoming characters from a COM interface.
Example:
s32 CONSOLE_Parse(mios32_com_port_t port, char c) { // see $MIOS32_PATH/apps/examples/com_console/ return 0; // no error }
The callback function has been installed in an Init() function with:
MIOS32_COM_ReceiveCallback_Init(CONSOLE_Parse);
| [in] | callback_debug_command | the callback function (NULL disables the callback) |
| s32 MIOS32_COM_SendBuffer | ( | mios32_com_port_t | port, | |
| u8 * | buffer, | |||
| u16 | len | |||
| ) |
Sends a package over given port (blocking function)
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | buffer | character buffer |
| [in] | len | buffer length |
0 on success
| s32 MIOS32_COM_SendBuffer_NonBlocking | ( | mios32_com_port_t | port, | |
| u8 * | buffer, | |||
| u16 | len | |||
| ) |
Sends a package over given port
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | buffer | character buffer |
| [in] | len | buffer length |
-2 if non-blocking mode activated: buffer is full caller should retry until buffer is free again
0 on success
| s32 MIOS32_COM_SendChar | ( | mios32_com_port_t | port, | |
| char | c | |||
| ) |
Sends a single character over given port (blocking function)
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | c | character |
0 on success
| s32 MIOS32_COM_SendChar_NonBlocking | ( | mios32_com_port_t | port, | |
| char | c | |||
| ) |
Sends a single character over given port
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | c | character |
-2 buffer is full caller should retry until buffer is free again
0 on success
| s32 MIOS32_COM_SendFormattedString | ( | mios32_com_port_t | port, | |
| char * | format, | |||
| ... | ||||
| ) |
Sends a formatted string (-> printf) over given port (blocking function)
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | *format | zero-terminated format string - 128 characters supported maximum! |
| [in] | ... | optional arguments, |
0 on success
| s32 MIOS32_COM_SendFormattedString_NonBlocking | ( | mios32_com_port_t | port, | |
| char * | format, | |||
| ... | ||||
| ) |
Sends a formatted string (-> printf) over given port
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | *format | zero-terminated format string - 128 characters supported maximum! |
| [in] | ... | optional arguments, 128 characters supported maximum! |
0 on success
| s32 MIOS32_COM_SendString | ( | mios32_com_port_t | port, | |
| char * | str | |||
| ) |
Sends a string over given port (blocking function)
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | str | zero-terminated string |
0 on success
| s32 MIOS32_COM_SendString_NonBlocking | ( | mios32_com_port_t | port, | |
| char * | str | |||
| ) |
Sends a string over given port
| [in] | port | COM port (DEFAULT, USB0..USB7, UART0..UART1, IIC0..IIC7) |
| [in] | str | zero-terminated string |
-2 buffer is full caller should retry until buffer is free again
0 on success
1.4.7