C MIP-SDK
Functions
mip_sdk_base.c File Reference
#include "mip_sdk_base.h"
#include "mip_sdk_user_functions.h"

Functions

u16 mip_base_cmd_ping (mip_interface *device_interface)
u16 mip_base_cmd_idle (mip_interface *device_interface)
u16 mip_base_cmd_get_device_info (mip_interface *device_interface, base_device_info_field *device_info)
u16 mip_base_cmd_get_device_supported_descriptors (mip_interface *device_interface, u8 *response_buffer, u16 *response_size)
u16 mip_base_cmd_built_in_test (mip_interface *device_interface, u32 *bit_result)
u16 mip_base_cmd_resume (mip_interface *device_interface)
u16 mip_base_cmd_reset_device (mip_interface *device_interface)

Detailed Description

Author:
Nathan Miller
Version:
1.1

Function Documentation

u16 mip_base_cmd_built_in_test ( mip_interface device_interface,
u32 *  bit_result 
)

DESCRIPTION

Perform the device's built-in test.

DETAILS

Parameters:
[in]mip_interface*device_interface - The device interface.
[out]u32*bit_result - The returned bitfield result.
Return values:
MIP_INTERFACE_ERRORWhen there is a problem with the command format or the
the device communications failed.
MIP_INTERFACE_OKThe command was successful.

NOTES

Please consult the device DCP for descriptions of BIT result values.
A value of 0x00000000 is always success, other values indicate an error.

u16 mip_base_cmd_get_device_info ( mip_interface device_interface,
base_device_info_field device_info 
)

DESCRIPTION

Get the device information structure.

DETAILS

Parameters:
[in]mip_interface*device_interface - The device interface.
[out]base_device_info_field*device_info - The returned device info structure.
Return values:
MIP_INTERFACE_ERRORWhen there is a problem with the command format or the
the device communications failed.
MIP_INTERFACE_OKThe command was successful.

NOTES

None

u16 mip_base_cmd_get_device_supported_descriptors ( mip_interface device_interface,
u8 *  response_buffer,
u16 *  response_size 
)

DESCRIPTION

Get the descriptors supported by the device.

DETAILS

Parameters:
[in]mip_interface*device_interface - The device interface.
[out]u8*response_buffer - The returned array of descriptors.
[in,out]u16*response_size - On entry, the size of the buffer; On exit, the size of the data returned.
Return values:
MIP_INTERFACE_ERRORWhen there is a problem with the command format or the
the device communications failed.
MIP_INTERFACE_OKThe command was successful.

NOTES

The provided buffer should be large enough to hold the maximum number of
supported descriptors from any device (currently 126.) This would be a
buffer of at least 252 bytes. The returned descriptors are in the format
of u16 = [descriptor set (MSB), descriptor (LSB)].

u16 mip_base_cmd_idle ( mip_interface device_interface)

DESCRIPTION

Put the device in idle mode.

DETAILS

Parameters:
[in]mip_interface*device_interface - The device interface.
Return values:
MIP_INTERFACE_ERRORWhen there is a problem with the command format or the
the device communications failed.
MIP_INTERFACE_OKThe command was successful.

NOTES

None

u16 mip_base_cmd_ping ( mip_interface device_interface)

DESCRIPTION

Ping the device.

DETAILS

Parameters:
[in]mip_interface*device_interface - The device interface.
Return values:
MIP_INTERFACE_ERRORWhen there is a problem with the command format or the
the device communications failed.
MIP_INTERFACE_OKThe command was successful.

NOTES

None

u16 mip_base_cmd_reset_device ( mip_interface device_interface)

DESCRIPTION

Reset the attached device.

DETAILS

Parameters:
[in]mip_interface*device_interface - The device interface.
Return values:
MIP_INTERFACE_ERRORWhen there is a problem with the command format or the
the device communications failed.
MIP_INTERFACE_OKThe command was successful.

NOTES

If communicating via USB, it is important to close the port immediately after
calling this function. Failure to do so may result in the designated port
hanging.

u16 mip_base_cmd_resume ( mip_interface device_interface)

DESCRIPTION

Resume any enabled continuous data streams. This is the reverse of idle.

DETAILS

Parameters:
[in]mip_interface*device_interface - The device interface.
Return values:
MIP_INTERFACE_ERRORWhen there is a problem with the command format or the
the device communications failed.
MIP_INTERFACE_OKThe command was successful.

NOTES

None

 All Data Structures Files Functions Defines