uTrack
Loading...
Searching...
No Matches
Functions | Variables
utIMUCommandPool.c File Reference

Helper class for utIMU.c poll commands. More...

#include "uTrack.h"
#include "utIMUCommandPool.h"

Functions

int utIMUCommandPool_GetIndexFromCommand (UT_IMU_PollCmd cmd)
 
UT_IMU_PollCmd utIMUCommandPool_GetCommandFromString (const char *name)
 
const char * utIMUCommandPool_GetStringFromCommand (UT_IMU_PollCmd cmd)
 
bool utIMUCommandPool_IsEnabled (UT_IMU_PollCmd command)
 
bool utIMUCommandPool_GetLogStatus (UT_IMU_PollCmd command)
 
bool utIMUCommandPool_GetLiveStatus (UT_IMU_PollCmd command)
 
bool utIMUCommandPool_GetLogStatusById (u8 id)
 
bool utIMUCommandPool_GetLiveStatusById (u8 id)
 
u8 utIMUCommandPool_GetLogDivider (UT_IMU_PollCmd command)
 
u8 utIMUCommandPool_GetLiveDivider (UT_IMU_PollCmd command)
 
void utIMUCommandPool_EnableMessage (UT_IMU_PollCmd command, int logDivider, bool log, int liveDivider, bool live, UT_IMU_CmdFieldDetails flags)
 
void utIMUCommandPool_DisableMessage (UT_IMU_PollCmd command)
 

Variables

UT_IMU_CmdFieldDetails fieldDetailsList [UT_IMU_POLL_MAX]
 
volatile UT_IMU_PollCmdDetails ** activeList = enabledList
 Externally available access to the list of enabled poll messages.
 
const u8 * activeListLength = &enabledCount
 Externally available access to the length of the enabled list (without a method call - IRQ usage).
 

Detailed Description

Helper class for utIMU.c poll commands.

Author
Oscar Key
Date
19/08/2013

Function Documentation

◆ utIMUCommandPool_DisableMessage()

void utIMUCommandPool_DisableMessage ( UT_IMU_PollCmd  command)

g1 Disables a given command for polling.

Parameters
commandThe command to disable.

◆ utIMUCommandPool_EnableMessage()

void utIMUCommandPool_EnableMessage ( UT_IMU_PollCmd  command,
int  logDivider,
bool  log,
int  liveDivider,
bool  live,
UT_IMU_CmdFieldDetails  flags 
)

Enables and configures a given command for polling.

Parameters
commandThe command to enable.
dividerThe message rate divider, to allow for slow poll rates. Must be an integer in [1,128] or it will be ignored. The initial value is 1.
logWhether to log the command results.

◆ utIMUCommandPool_GetCommandFromString()

UT_IMU_PollCmd utIMUCommandPool_GetCommandFromString ( const char *  name)

Gets the appropriate IMU poll command type given a name.

Parameters
nameThe null terminated string containing the name of a valid supported IMU message.
Returns
The command type associated with name, or UT_IMU_POLL_MAX.

◆ utIMUCommandPool_GetLiveDivider()

u8 utIMUCommandPool_GetLiveDivider ( UT_IMU_PollCmd  command)

Returns the Live poll rate divider for a given command.

Parameters
commandThe command to check.
Returns
The Live poll rate divider for a command if it is valid and supported, else 0.

◆ utIMUCommandPool_GetLiveStatus()

bool utIMUCommandPool_GetLiveStatus ( UT_IMU_PollCmd  command)

Tests to see if a poll command is configured to send live responses.

Parameters
commandThe command to check.
Returns
True if the command is valid, supported, and configured to send live responses.

◆ utIMUCommandPool_GetLiveStatusById()

bool utIMUCommandPool_GetLiveStatusById ( u8  id)

Tests to see if a poll command is configured for live responses, using the command id byte value.

Parameters
idThe command id to check.
Returns
True if the command is valid, supported, and configured to send live responses.

◆ utIMUCommandPool_GetLogDivider()

u8 utIMUCommandPool_GetLogDivider ( UT_IMU_PollCmd  command)

Returns the Log poll rate divider for a given command.

Parameters
commandThe command to check.
Returns
The Log poll rate divider for a command if it is valid and supported, else 0.

◆ utIMUCommandPool_GetLogStatus()

bool utIMUCommandPool_GetLogStatus ( UT_IMU_PollCmd  command)

Tests to see if a poll command is configured to log responses.

Parameters
commandThe command to check.
Returns
True if the command is valid, supported, and configured to log responses.

◆ utIMUCommandPool_GetLogStatusById()

bool utIMUCommandPool_GetLogStatusById ( u8  id)

Tests to see if a poll command is configured to log responses, using the command id byte value.

Parameters
idThe command id to check.
Returns
True if the command is valid, supported, and configured to log responses.

◆ utIMUCommandPool_GetStringFromCommand()

const char * utIMUCommandPool_GetStringFromCommand ( UT_IMU_PollCmd  cmd)

Gets the appropriate IMU poll command type given a name.

Parameters
nameThe null terminated string containing the name of a valid supported IMU message.
Returns
The command type associated with name, or UT_IMU_POLL_MAX.

◆ utIMUCommandPool_IsEnabled()

bool utIMUCommandPool_IsEnabled ( UT_IMU_PollCmd  command)

Tests to see if a command is in the enabled poll list.

Parameters
commandThe command to check.
Returns
True if the command is supported and in the enabled list.

Variable Documentation

◆ fieldDetailsList

UT_IMU_CmdFieldDetails fieldDetailsList[UT_IMU_POLL_MAX]
Initial value:
=
{
{ UT_IMU_POLL_ORIENTATION_QUAT, true, true, true, true, true, true, true, true },
{ UT_IMU_POLL_ORIENTATION_EULER, true, true, true, false, true, true, true, false },
{ UT_IMU_POLL_GYRO, true, true, true, false, true, true, true, false },
{ UT_IMU_POLL_LINACCG, true, true, true, false, true, true, true, false },
{ UT_IMU_POLL_LINACC, true, true, true, false, true, true, true, false },
{ UT_IMU_POLL_MAG, true, true, true, false, true, true, true, false },
{ UT_IMU_POLL_MAG_RAW, true, true, true, false, true, true, true, false }
}