#include "mip_sdk_user_functions.h"
#include <string>
#include <iostream>
#include <cstdio>
#include "serial/serial.h"
Go to the source code of this file.
Functions | |
u32 | mip_sdk_get_time_ms () |
u16 | mip_sdk_port_close (void *port_handle) |
u16 | mip_sdk_port_open (void **port_handle, int port_num, int baudrate) |
u16 | mip_sdk_port_read (void *port_handle, u8 *buffer, u32 num_bytes, u32 *bytes_read, u32 timeout_ms) |
u32 | mip_sdk_port_read_count (void *port_handle) |
u16 | mip_sdk_port_write (void *port_handle, u8 *buffer, u32 num_bytes, u32 *bytes_written, u32 timeout_ms) |
u32 mip_sdk_get_time_ms | ( | ) |
Target-Specific Call to get the current time in milliseconds.
[in] | void | *port_handle - target-specific port handle pointer (user needs to allocate memory for this) |
1) This value should no roll-over in short periods of time (e.g. minutes)
2) Most systems have a millisecond counter that rolls-over every 32 bits
(e.g. 49.71 days roll-over period, with 1 millisecond LSB)
3) An absolute reference is not required since this function is
used for relative time-outs.
4) The user should copy the mip_sdk_user_functions.c
file to their project directory and
edit it as needed to support their target operating system.
Definition at line 234 of file mip_sdk_user_functions.cpp.
u16 mip_sdk_port_close | ( | void * | port_handle | ) |
Target-Specific port close function
[in] | void | *port_handle - target-specific port handle pointer (user needs to allocate memory for this) |
MIP_USER_FUNCTION_ERROR | When there is a problem closing the port. |
MIP_USER_FUNCTION_OK | The close was successful. |
The user should copy the mip_sdk_user_functions.c
file to their project directory and
edit it as needed to support their target operating system.
Definition at line 102 of file mip_sdk_user_functions.cpp.
u16 mip_sdk_port_open | ( | void ** | port_handle, |
int | port_num, | ||
int | baudrate | ||
) |
Target-Specific communications port open.
[out] | void | *port_handle - target-specific port handle pointer (user needs to allocate memory for this) |
[in] | int | port_num - port number (as recognized by the operating system.) |
[in] | int | baudrate - baudrate of the com port. |
MIP_USER_FUNCTION_ERROR | When there is a problem opening the port. |
MIP_USER_FUNCTION_OK | The open was successful. |
The user should copy the mip_sdk_user_functions.c
file to their project directory and
edit it as needed to support their target operating system.
Definition at line 72 of file mip_sdk_user_functions.cpp.
u16 mip_sdk_port_read | ( | void * | port_handle, |
u8 * | buffer, | ||
u32 | num_bytes, | ||
u32 * | bytes_read, | ||
u32 | timeout_ms | ||
) |
Target-Specific Port Write Function.
[in] | void | *port_handle - target-specific port handle pointer (user needs to allocate memory for this) |
[in] | u8 | *buffer - buffer containing num_bytes of data |
[in] | u32 | num_bytes - the number of bytes to write to the port |
[out] | u32 | *bytes_read - the number of bytes actually read from the device |
[in] | u32 | timeout_ms - the read timeout |
MIP_USER_FUNCTION_ERROR | When there is a problem communicating with the port. |
MIP_USER_FUNCTION_OK | The read was successful. |
The user should copy the mip_sdk_user_functions.c
file to their project directory and
edit it as needed to support their target operating system.
Definition at line 170 of file mip_sdk_user_functions.cpp.
u32 mip_sdk_port_read_count | ( | void * | port_handle | ) |
Target-Specific Function to Get the Number of Bytes Waiting on the Port.
[in] | void | *port_handle - target-specific port handle pointer (user needs to allocate memory for this) |
The user should copy the mip_sdk_user_functions.c
file to their project directory and
edit it as needed to support their target operating system.
Definition at line 200 of file mip_sdk_user_functions.cpp.
u16 mip_sdk_port_write | ( | void * | port_handle, |
u8 * | buffer, | ||
u32 | num_bytes, | ||
u32 * | bytes_written, | ||
u32 | timeout_ms | ||
) |
Target-Specific Port Write Function.
[in] | void | *port_handle - target-specific port handle pointer (user needs to allocate memory for this) |
[in] | u8 | *buffer - buffer containing num_bytes of data |
[in] | u32 | num_bytes - the number of bytes to write to the port |
[out] | u32 | *bytes_written - the number of bytes actually written to the port |
[in] | u32 | timeout_ms - the write timeout |
MIP_USER_FUNCTION_ERROR | When there is a problem communicating with the port. |
MIP_USER_FUNCTION_OK | The write was successful. |
The user should copy the mip_sdk_user_functions.c
file to their project directory and
edit it as needed to support their target operating system.
Definition at line 136 of file mip_sdk_user_functions.cpp.