VectorNav C Library
Functions
SPI Generate Write Functions

This set of functions will generate command strings for writing to registers on VectorNav sensors using the SPI protocol. More...

Functions

VnError VnSpi_genWriteUserTag (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, char *tag)
 Generates a command to write the User Tag register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteSerialBaudRate (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint32_t baudrate)
 Generates a command to write the Serial Baud Rate register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteSerialBaudRateWithOptions (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint32_t baudrate)
 Generates a command to write the Serial Baud Rate register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteAsyncDataOutputType (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint32_t ador)
 Generates a command to write the Async Data Output Type register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteAsyncDataOutputTypeWithOptions (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint32_t ador)
 Generates a command to write the Async Data Output Type register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteAsyncDataOutputFrequency (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint32_t adof)
 Generates a command to write the Async Data Output Frequency register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteAsyncDataOutputFrequencyWithOptions (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint32_t adof)
 Generates a command to write the Async Data Output Frequency register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteMagneticAndGravityReferenceVectors (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, vec3f magRef, vec3f accRef)
 Generates a command to write the Magnetic and Gravity Reference Vectors register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteMagnetometerCompensation (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, mat3f c, vec3f b)
 Generates a command to write the Magnetometer Compensation register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteAccelerationCompensation (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, mat3f c, vec3f b)
 Generates a command to write the Acceleration Compensation register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteReferenceFrameRotation (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, mat3f c)
 Generates a command to write the Reference Frame Rotation register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteCommunicationProtocolControl (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t serialCount, uint8_t serialStatus, uint8_t spiCount, uint8_t spiStatus, uint8_t serialChecksum, uint8_t spiChecksum, uint8_t errorMode)
 Generates a command to write the Communication Protocol Control register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteSynchronizationControl (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t syncInMode, uint8_t syncInEdge, uint16_t syncInSkipFactor, uint32_t reserved1, uint8_t syncOutMode, uint8_t syncOutPolarity, uint16_t syncOutSkipFactor, uint32_t syncOutPulseWidth, uint32_t reserved2)
 Generates a command to write the Synchronization Control register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteSynchronizationStatus (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint32_t syncInCount, uint32_t syncInTime, uint32_t syncOutCount)
 Generates a command to write the Synchronization Status register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteVpeBasicControl (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t enable, uint8_t headingMode, uint8_t filteringMode, uint8_t tuningMode)
 Generates a command to write the VPE Basic Control register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteVpeMagnetometerBasicTuning (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, vec3f baseTuning, vec3f adaptiveTuning, vec3f adaptiveFiltering)
 Generates a command to write the VPE Magnetometer Basic Tuning register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteVpeAccelerometerBasicTuning (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, vec3f baseTuning, vec3f adaptiveTuning, vec3f adaptiveFiltering)
 Generates a command to write the VPE Accelerometer Basic Tuning register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteMagnetometerCalibrationControl (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t hsiMode, uint8_t hsiOutput, uint8_t convergeRate)
 Generates a command to write the Magnetometer Calibration Control register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteVelocityCompensationMeasurement (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, vec3f velocity)
 Generates a command to write the Velocity Compensation Measurement register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteVelocityCompensationControl (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t mode, float velocityTuning, float rateTuning)
 Generates a command to write the Velocity Compensation Control register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteGpsConfiguration (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t mode, uint8_t ppsSource, uint8_t reserved1, uint8_t reserved2, uint8_t reserved3)
 Generates a command to write the GPS Configuration register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteGpsAntennaOffset (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, vec3f position)
 Generates a command to write the GPS Antenna Offset register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteInsBasicConfiguration (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t scenario, uint8_t ahrsAiding, uint8_t estBaseline, uint8_t resv2)
 Generates a command to write the INS Basic Configuration register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteStartupFilterBiasEstimate (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, vec3f gyroBias, vec3f accelBias, float pressureBias)
 Generates a command to write the Startup Filter Bias Estimate register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteDeltaThetaAndDeltaVelocityConfiguration (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t integrationFrame, uint8_t gyroCompensation, uint8_t accelCompensation, uint8_t reserved1, uint16_t reserved2)
 Generates a command to write the Delta Theta and Delta Velocity Configuration register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteReferenceVectorConfiguration (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint8_t useMagModel, uint8_t useGravityModel, uint8_t resv1, uint8_t resv2, uint32_t recalcThreshold, float year, vec3d position)
 Generates a command to write the Reference Vector Configuration register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteGyroCompensation (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, mat3f c, vec3f b)
 Generates a command to write the Gyro Compensation register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteImuFilteringConfiguration (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, uint16_t magWindowSize, uint16_t accelWindowSize, uint16_t gyroWindowSize, uint16_t tempWindowSize, uint16_t presWindowSize, uint8_t magFilterMode, uint8_t accelFilterMode, uint8_t gyroFilterMode, uint8_t tempFilterMode, uint8_t presFilterMode)
 Generates a command to write the IMU Filtering Configuration register on a VectorNav sensor. More...
 
VnError VnSpi_genWriteGpsCompassBaseline (char *buffer, size_t *size, size_t desiredLength, size_t *responseSize, vec3f position, vec3f uncertainty)
 Generates a command to write the GPS Compass Baseline register on a VectorNav sensor. More...
 

Detailed Description

This set of functions will generate command strings for writing to registers on VectorNav sensors using the SPI protocol.

These functions take the form shown below. XXX is replaced by the name of the register, buffer is provided by the user to be filled with the generated command, size is the number of bytes available in the provided buffer and will contain the number of bytes of the command to send, desiredLength is the total number of bytes to pad with 0x00 should the total constructed length of the command be less than the desired length, and [Variable argument list] varies with the specified register being written to.

VnError VnSpi_genWriteXXX(
char *buffer,
size_t* size,
size_t desiredLength,
size_t* responseSize,
[Variable argument list]);

Function Documentation

VnError VnSpi_genWriteAccelerationCompensation ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
mat3f  c,
vec3f  b 
)

Generates a command to write the Acceleration Compensation register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteAsyncDataOutputFrequency ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint32_t  adof 
)

Generates a command to write the Async Data Output Frequency register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteAsyncDataOutputFrequencyWithOptions ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint32_t  adof 
)

Generates a command to write the Async Data Output Frequency register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteAsyncDataOutputType ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint32_t  ador 
)

Generates a command to write the Async Data Output Type register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
Examples:
spi/main.c.
VnError VnSpi_genWriteAsyncDataOutputTypeWithOptions ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint32_t  ador 
)

Generates a command to write the Async Data Output Type register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteCommunicationProtocolControl ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  serialCount,
uint8_t  serialStatus,
uint8_t  spiCount,
uint8_t  spiStatus,
uint8_t  serialChecksum,
uint8_t  spiChecksum,
uint8_t  errorMode 
)

Generates a command to write the Communication Protocol Control register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteDeltaThetaAndDeltaVelocityConfiguration ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  integrationFrame,
uint8_t  gyroCompensation,
uint8_t  accelCompensation,
uint8_t  reserved1,
uint16_t  reserved2 
)

Generates a command to write the Delta Theta and Delta Velocity Configuration register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteGpsAntennaOffset ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
vec3f  position 
)

Generates a command to write the GPS Antenna Offset register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteGpsCompassBaseline ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
vec3f  position,
vec3f  uncertainty 
)

Generates a command to write the GPS Compass Baseline register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteGpsConfiguration ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  mode,
uint8_t  ppsSource,
uint8_t  reserved1,
uint8_t  reserved2,
uint8_t  reserved3 
)

Generates a command to write the GPS Configuration register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteGyroCompensation ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
mat3f  c,
vec3f  b 
)

Generates a command to write the Gyro Compensation register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteImuFilteringConfiguration ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint16_t  magWindowSize,
uint16_t  accelWindowSize,
uint16_t  gyroWindowSize,
uint16_t  tempWindowSize,
uint16_t  presWindowSize,
uint8_t  magFilterMode,
uint8_t  accelFilterMode,
uint8_t  gyroFilterMode,
uint8_t  tempFilterMode,
uint8_t  presFilterMode 
)

Generates a command to write the IMU Filtering Configuration register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteInsBasicConfiguration ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  scenario,
uint8_t  ahrsAiding,
uint8_t  estBaseline,
uint8_t  resv2 
)

Generates a command to write the INS Basic Configuration register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteMagneticAndGravityReferenceVectors ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
vec3f  magRef,
vec3f  accRef 
)

Generates a command to write the Magnetic and Gravity Reference Vectors register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteMagnetometerCalibrationControl ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  hsiMode,
uint8_t  hsiOutput,
uint8_t  convergeRate 
)

Generates a command to write the Magnetometer Calibration Control register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteMagnetometerCompensation ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
mat3f  c,
vec3f  b 
)

Generates a command to write the Magnetometer Compensation register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteReferenceFrameRotation ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
mat3f  c 
)

Generates a command to write the Reference Frame Rotation register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteReferenceVectorConfiguration ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  useMagModel,
uint8_t  useGravityModel,
uint8_t  resv1,
uint8_t  resv2,
uint32_t  recalcThreshold,
float  year,
vec3d  position 
)

Generates a command to write the Reference Vector Configuration register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteSerialBaudRate ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint32_t  baudrate 
)

Generates a command to write the Serial Baud Rate register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteSerialBaudRateWithOptions ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint32_t  baudrate 
)

Generates a command to write the Serial Baud Rate register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteStartupFilterBiasEstimate ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
vec3f  gyroBias,
vec3f  accelBias,
float  pressureBias 
)

Generates a command to write the Startup Filter Bias Estimate register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteSynchronizationControl ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  syncInMode,
uint8_t  syncInEdge,
uint16_t  syncInSkipFactor,
uint32_t  reserved1,
uint8_t  syncOutMode,
uint8_t  syncOutPolarity,
uint16_t  syncOutSkipFactor,
uint32_t  syncOutPulseWidth,
uint32_t  reserved2 
)

Generates a command to write the Synchronization Control register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteSynchronizationStatus ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint32_t  syncInCount,
uint32_t  syncInTime,
uint32_t  syncOutCount 
)

Generates a command to write the Synchronization Status register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteUserTag ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
char *  tag 
)

Generates a command to write the User Tag register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteVelocityCompensationControl ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  mode,
float  velocityTuning,
float  rateTuning 
)

Generates a command to write the Velocity Compensation Control register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteVelocityCompensationMeasurement ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
vec3f  velocity 
)

Generates a command to write the Velocity Compensation Measurement register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteVpeAccelerometerBasicTuning ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
vec3f  baseTuning,
vec3f  adaptiveTuning,
vec3f  adaptiveFiltering 
)

Generates a command to write the VPE Accelerometer Basic Tuning register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteVpeBasicControl ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
uint8_t  enable,
uint8_t  headingMode,
uint8_t  filteringMode,
uint8_t  tuningMode 
)

Generates a command to write the VPE Basic Control register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.
VnError VnSpi_genWriteVpeMagnetometerBasicTuning ( char *  buffer,
size_t *  size,
size_t  desiredLength,
size_t *  responseSize,
vec3f  baseTuning,
vec3f  adaptiveTuning,
vec3f  adaptiveFiltering 
)

Generates a command to write the VPE Magnetometer Basic Tuning register on a VectorNav sensor.

Parameters
[in]bufferCaller provided buffer to place the generated command.