![]() |
AMS Advanced Air Mobility Sensors UG
|
This is class implements a driver for the Murata SCHA63T inertial sensor. More...
Classes | |
| struct | SCompensationParameters |
| A struct to store compensation parameters stored in the sensor's NVM. More... | |
Public Member Functions | |
| void | Init () override |
| bool | IsInitialized () override |
| void | PollSensor () |
| Poll the sensor. Puts batches of 30 measurements periodically into the queue of the FreeRTOS task. The function is called from the 6kHz interrupt triggered by the TIM7. | |
| void | ConvertRawDataset () |
| Converts batches of 30 raw measurements to IMU measurement, applies factory calibration and writes the result to the RTE port. The routine shall be called from FreeRTOS tasks. | |
Public Member Functions inherited from CSoftwareComponent< CScha63TDriver, 1U > | |
| CSoftwareComponent (CSoftwareComponent &)=delete | |
| CSoftwareComponent (CSoftwareComponent &&)=delete | |
| CSoftwareComponent & | operator= (const CSoftwareComponent &orOther)=delete |
| CSoftwareComponent & | operator= (CSoftwareComponent &&orOther)=delete |
| virtual void | Init ()=0 |
| virtual bool | IsInitialized ()=0 |
Private Types | |
| enum | EMeasurementFrames { eSpecificForceX = 0 , eSpecificForceY , eSpecificForceZ , eAngularRateX , eAngularRateY , eAngularRateZ , eTemperatureUno , eTemperatureDue , eFrameCount } |
| Enumeration of measurement frames for SPI communication. More... | |
Private Member Functions | |
| CScha63TDriver (CScha63TDriver &)=delete | |
| CScha63TDriver (CScha63TDriver &&)=delete | |
| CScha63TDriver & | operator= (const CScha63TDriver &orOther)=delete |
| CScha63TDriver & | operator= (CScha63TDriver &&orOther)=delete |
| CScha63TDriver (SPI_HandleTypeDef &korSpiHandle) | |
| ~CScha63TDriver ()=default | |
| bool | pollUnoStatus () |
| Poll the status of the UNO ASIC. | |
| bool | pollDueStatus () |
| Poll the status of the DUE ASIC. | |
| uint32_t | spiWriteReadUno (uint32_t uDataOut) |
| Read/write a 32-bit frame to/from the UNO ASIC. | |
| uint32_t | spiWriteReadDue (uint32_t uDataOut) |
| Read/write a 32-bit frame to/from the DUE ASIC. | |
| uint32_t | spiWriteRead (uint32_t uDataOut, GPIO_TypeDef *opGpioX, uint16_t uGpioPin) |
| SPI communication with the sensor. | |
Static Private Member Functions | |
| static CScha63TDriver & | getInstanceImpl (unsigned uInstanceIndex) |
| static SPI_HandleTypeDef & | getSpiHandle () |
| Get reference to a SPI handle object instantiated in the HAL library. Returns reference to hspi1 for BAHRS V2 and hspi2 for BAHRS V3. | |
| static bool | checkRsError (uint32_t uFrame) |
| Check for RS error bits in the frame. | |
| static bool | checkRsErrorInFrames (uint32_t *upFrames, unsigned uFrameCount) |
| Check for RS errors in an array of frames received from the ASIC: | |
| static int16_t | frameToInt16 (uint32_t uFrame) |
| Get a 16-bit integer from the frame received from the ASIC. | |
| static uint16_t | frameToUint16 (uint32_t uFrame) |
| Get a 16-bit unsigned integer from the frame received from the ASIC. | |
| static int8_t | lowerInt8FromFrame (uint32_t uFrame) |
| Get a 8-bit integer from the frame received from the ASIC using the lower bits. | |
| static int8_t | upperInt8FromFrame (uint32_t uFrame) |
| Get a 8-bit integer from the frame received from the ASIC using the upper bits. | |
Private Attributes | |
| bool | bIsInitialized_ { false } |
| Sensor initialization status: true – initialized, false otherwise. | |
| char | acSerialNumber_ [14] { "" } |
| ID of the sensor read from the sensor's NVM. | |
| SCompensationParameters | oCompensationParameters_ |
| Compensation parameters read from the sensor's NVM. | |
| SScha63TDataset | oLatestDataset_ |
| The latest 30 measurements that are transfered periodically to the queue of the dedicated FreeRTOS task. | |
| SScha63TDataset | oOutputDataset_ |
| bool | bErrorFlags_ { false } |
| The flag indicating errors during ASIC operation. | |
| SScha63TStatusUno | oStatusUno_ |
| The latest content of the UNO status registers. Valid only when bErrorFlags_ is true. | |
| SScha63TStatusDue | oStatusDue_ |
| The latest content of the DUE status registers. Valid only when bErrorFlags_ is true. | |
| volatile bool | bDatasetAvailable_ { false } |
| SPI_HandleTypeDef & | orSpiHandle_ |
Static Private Attributes | |
| static constexpr float | skfGravity_ { 9.8F } |
| Gravity constant, [m/s^2]. | |
| static constexpr float | skfDegreesToRadians_ { 0.017453292F } |
| Scale factor to convert degrees to radians, [rad/deg]. | |
| static constexpr float | skfAccelerometerSensitivity_ { 4905.0F } |
| Accelerometer sensitivity, [LSB/g]. | |
| static constexpr float | skfGyroscopeSensitivity_ { 80.0F } |
| Gyroscope sensitivity, [LSB/deg/s]. | |
| static constexpr int | skiMaxAttemptsToConfigure_ { 2 } |
| Number of attempts to configure the sensor. | |
Friends | |
| class | CSoftwareComponent< CScha63TDriver, 1U > |
Additional Inherited Members | |
Static Public Member Functions inherited from CSoftwareComponent< CScha63TDriver, 1U > | |
| static CScha63TDriver & | GetInstance (unsigned uInstanceIndex=0U) |
Static Public Attributes inherited from CSoftwareComponent< CScha63TDriver, 1U > | |
| static constexpr unsigned | skuInstanceCount_ |
Protected Member Functions inherited from CSoftwareComponent< CScha63TDriver, 1U > | |
| CSoftwareComponent ()=default | |
| ~CSoftwareComponent ()=default | |
This is class implements a driver for the Murata SCHA63T inertial sensor.
|
private |
|
privatedelete |
|
privatedelete |
|
explicitprivate |
|
privatedefault |
|
inlinestaticprivate |
Check for RS error bits in the frame.
| uFrame | 32-bit frame received from the ASIC. |
|
staticprivate |
Check for RS errors in an array of frames received from the ASIC:
| upFrames | A pointer to the first array element. |
| uFrameCount | Number of frames ín the array. |
| void CScha63TDriver::ConvertRawDataset | ( | ) |
Converts batches of 30 raw measurements to IMU measurement, applies factory calibration and writes the result to the RTE port. The routine shall be called from FreeRTOS tasks.
|
inlinestaticprivate |
Get a 16-bit integer from the frame received from the ASIC.
| uFrame | A 32-bit frame received from the ASIC: |
|
inlinestaticprivate |
Get a 16-bit unsigned integer from the frame received from the ASIC.
| uFrame | A 32-bit frame received from the ASIC: |
|
staticprivate |
|
staticprivate |
Get reference to a SPI handle object instantiated in the HAL library. Returns reference to hspi1 for BAHRS V2 and hspi2 for BAHRS V3.
|
overridevirtual |
Initialize the software component.
Implements CSoftwareComponent< CScha63TDriver, 1U >.
|
overridevirtual |
Get initialization status of the software component.
Implements CSoftwareComponent< CScha63TDriver, 1U >.
|
inlinestaticprivate |
Get a 8-bit integer from the frame received from the ASIC using the lower bits.
| uFrame | A 32-bit frame received from the ASIC. |
|
privatedelete |
|
privatedelete |
|
private |
Poll the status of the DUE ASIC.
| void CScha63TDriver::PollSensor | ( | ) |
Poll the sensor. Puts batches of 30 measurements periodically into the queue of the FreeRTOS task. The function is called from the 6kHz interrupt triggered by the TIM7.
|
private |
Poll the status of the UNO ASIC.
|
private |
SPI communication with the sensor.
| uDataOut | Data to be sent. |
| opGpioX | CSB GPIO group. |
| uGpioPin | CSB GPIO pin. |
|
private |
Read/write a 32-bit frame to/from the DUE ASIC.
| uDataOut | Data to be send on SPI (for example read address). |
|
private |
Read/write a 32-bit frame to/from the UNO ASIC.
| uDataOut | Data to be send on SPI (for example read address). |
|
inlinestaticprivate |
Get a 8-bit integer from the frame received from the ASIC using the upper bits.
| uFrame | A 32-bit frame received from the ASIC. |
|
friend |
|
private |
ID of the sensor read from the sensor's NVM.
|
private |
|
private |
The flag indicating errors during ASIC operation.
|
private |
Sensor initialization status: true – initialized, false otherwise.
|
private |
Compensation parameters read from the sensor's NVM.
|
private |
The latest 30 measurements that are transfered periodically to the queue of the dedicated FreeRTOS task.
|
private |
|
private |
|
private |
The latest content of the DUE status registers. Valid only when bErrorFlags_ is true.
|
private |
The latest content of the UNO status registers. Valid only when bErrorFlags_ is true.
|
staticconstexprprivate |
Accelerometer sensitivity, [LSB/g].
|
staticconstexprprivate |
Scale factor to convert degrees to radians, [rad/deg].
|
staticconstexprprivate |
Gravity constant, [m/s^2].
|
staticconstexprprivate |
Gyroscope sensitivity, [LSB/deg/s].
|
staticconstexprprivate |
Number of attempts to configure the sensor.