Index: firmware/App/Services/FPGA.c =================================================================== diff -u -r8f5feed92f41a476d5656038bcdfe884e17bd593 -r73113d51d6ca20fd4e34d69d241fbb18bb70dc1e --- firmware/App/Services/FPGA.c (.../FPGA.c) (revision 8f5feed92f41a476d5656038bcdfe884e17bd593) +++ firmware/App/Services/FPGA.c (.../FPGA.c) (revision 73113d51d6ca20fd4e34d69d241fbb18bb70dc1e) @@ -1389,3 +1389,59 @@ { return fpgaSensorReadings.fpgaTrimmerHeaterIntJunctionTemp; } + +/*********************************************************************//** + * @brief + * The getFPGAAccelAxes function gets the accelerometer axis readings. \n + * Axis readings are in ADC counts. 0.004 g per LSB. + * @details + * Inputs : fpgaSensorReadings + * Outputs : none + * @param x : Populate this param with X axis reading + * @param y : Populate this param with Y axis reading + * @param z : Populate this param with Z axis reading + * @return none + *************************************************************************/ +void getFPGAAccelAxes( S16 *x, S16 *y, S16 *z ) +{ + *x = (S16)fpgaSensorReadings.accelX; + *y = (S16)fpgaSensorReadings.accelY; + *z = (S16)fpgaSensorReadings.accelZ; +} + +/*********************************************************************//** + * @brief + * The getFPGAAccelMaxes function gets the maximum accelerometer axis readings. \n + * from last FPGA read (every 10ms). \n + * Axis readings are in ADC counts. 0.004 g per LSB. + * @details + * Inputs : fpgaSensorReadings + * Outputs : none + * @param x : Populate this param with maximum X axis reading + * @param y : Populate this param with maximum Y axis reading + * @param z : Populate this param with maximum Z axis reading + * @return none + *************************************************************************/ +void getFPGAAccelMaxes( S16 *xmax, S16*ymax, S16*zmax ) +{ + *xmax = (S16)fpgaSensorReadings.accelXMax; + *ymax = (S16)fpgaSensorReadings.accelYMax; + *zmax = (S16)fpgaSensorReadings.accelZMax; +} + +/*********************************************************************//** + * @brief + * The getFPGAAccelStatus function gets the accelerometer reading count \n + * and error register values. + * @details + * Inputs : fpgaSensorReadings + * Outputs : none + * @param cnt : Populate this param with latest sample counter value + * @param err : Populate this param with latest error + * @return none + *************************************************************************/ +void getFPGAAccelStatus( U16 *cnt, U16 *err ) +{ + *cnt = fpgaSensorReadings.accelSampleCounter; + *err = fpgaSensorReadings.accelFaultRegister; +}