Stima V4 Slave RAIN  4.2
AccelerometerTask Class Reference

ACCELEROMETER TASK cpp_freertos class. More...

#include <accelerometer_task.h>

Inheritance diagram for AccelerometerTask:

Public Member Functions

 AccelerometerTask (const char *taskName, uint16_t stackSize, uint8_t priority, AccelerometerParam_t AccelerometerParam)
 Construct the Accelerometer Task::AccelerometerTask object. More...
 

Protected Member Functions

virtual void Run ()
 RUN Task. More...
 

Private Types

enum  AccelerometerState_t {
  ACCELEROMETER_STATE_CREATE , ACCELEROMETER_STATE_INIT , ACCELEROMETER_STATE_CHECK_HARDWARE , ACCELEROMETER_STATE_LOAD_CONFIGURATION ,
  ACCELEROMETER_STATE_SETUP_MODULE , ACCELEROMETER_STATE_CHECK_OPERATION , ACCELEROMETER_STATE_WAIT_RESUME , ACCELEROMETER_STATE_HARDWARE_FAIL
}
 Enum for state switch of running method. More...
 

Private Member Functions

void TaskWatchDog (uint32_t millis_standby)
 local watchDog and Sleep flag Task (optional) More...
 
void TaskState (uint8_t state_position, uint8_t state_subposition, task_flag state_operation)
 local suspend flag and positor running state Task (optional) More...
 
void printConfiguration (void)
 Print configuration Accelerometer. More...
 
void loadConfiguration (void)
 Load configuration accelleration module. More...
 
void saveConfiguration (bool is_default)
 Init/Save configuration param Accelerometer. More...
 
void calibrate (bool is_default, bool save_register)
 Calibrate accelereometer position X-Y-Z to actual value (set offset from 0) More...
 
bool checkModule (void)
 Check hardware module. More...
 
void setupModule (void)
 Setup hardware configuration. More...
 
bool readModule (void)
 Read data from module accelerometer. More...
 
void powerDownModule (void)
 Activate power saving hardware module. More...
 

Private Attributes

STM32RTC & rtc = STM32RTC::getInstance()
 
AccelerometerState_t state
 
AccelerometerParam_t param
 
Accelerometer accelerometer
 
accelerometer_t accelerometer_configuration
 
float value_x
 
float value_y
 
float value_z
 

Detailed Description

ACCELEROMETER TASK cpp_freertos class.

Definition at line 79 of file accelerometer_task.h.

Member Enumeration Documentation

◆ AccelerometerState_t

Enum for state switch of running method.

Enumerator
ACCELEROMETER_STATE_CREATE 
ACCELEROMETER_STATE_INIT 
ACCELEROMETER_STATE_CHECK_HARDWARE 
ACCELEROMETER_STATE_LOAD_CONFIGURATION 
ACCELEROMETER_STATE_SETUP_MODULE 
ACCELEROMETER_STATE_CHECK_OPERATION 
ACCELEROMETER_STATE_WAIT_RESUME 
ACCELEROMETER_STATE_HARDWARE_FAIL 

Definition at line 82 of file accelerometer_task.h.

Constructor & Destructor Documentation

◆ AccelerometerTask()

AccelerometerTask::AccelerometerTask ( const char *  taskName,
uint16_t  stackSize,
uint8_t  priority,
AccelerometerParam_t  accelerometerParam 
)

Construct the Accelerometer Task::AccelerometerTask object.

Parameters
taskNamename of the task
stackSizesize of the stack
prioritypriority of the task
accelerometerParamparameters for the task

Definition at line 41 of file accelerometer_task.cpp.

Member Function Documentation

◆ calibrate()

void AccelerometerTask::calibrate ( bool  is_default,
bool  save_register 
)
private

Calibrate accelereometer position X-Y-Z to actual value (set offset from 0)

Parameters
is_defaultrequire default value data
save_registerrequest to save calibration in register

Definition at line 410 of file accelerometer_task.cpp.

◆ checkModule()

bool AccelerometerTask::checkModule ( void  )
private

Check hardware module.

Returns
True is module ready and OK

Definition at line 448 of file accelerometer_task.cpp.

◆ loadConfiguration()

void AccelerometerTask::loadConfiguration ( void  )
private

Load configuration accelleration module.

read configuration from register

Definition at line 285 of file accelerometer_task.cpp.

◆ powerDownModule()

void AccelerometerTask::powerDownModule ( void  )
private

Activate power saving hardware module.

Definition at line 502 of file accelerometer_task.cpp.

◆ printConfiguration()

void AccelerometerTask::printConfiguration ( void  )
private

Print configuration Accelerometer.

Definition at line 350 of file accelerometer_task.cpp.

◆ readModule()

bool AccelerometerTask::readModule ( void  )
private

Read data from module accelerometer.

Returns
true if data is ready from module

Definition at line 479 of file accelerometer_task.cpp.

◆ Run()

void AccelerometerTask::Run ( )
protectedvirtual

RUN Task.

Definition at line 112 of file accelerometer_task.cpp.

◆ saveConfiguration()

void AccelerometerTask::saveConfiguration ( bool  is_default)
private

Init/Save configuration param Accelerometer.

Parameters
is_defaulttrue if need to reset register configuration value default

Definition at line 362 of file accelerometer_task.cpp.

◆ setupModule()

void AccelerometerTask::setupModule ( void  )
private

Setup hardware configuration.

Definition at line 463 of file accelerometer_task.cpp.

◆ TaskState()

void AccelerometerTask::TaskState ( uint8_t  state_position,
uint8_t  state_subposition,
task_flag  state_operation 
)
private

local suspend flag and positor running state Task (optional)

Parameters
state_positionSw_Position (Local STATE)
state_subpositionSw_SubPosition (Optional Local SUB_STATE Position Monitor)
state_operationoperative mode flag status for this task

Definition at line 97 of file accelerometer_task.cpp.

◆ TaskWatchDog()

void AccelerometerTask::TaskWatchDog ( uint32_t  millis_standby)
private

local watchDog and Sleep flag Task (optional)

Parameters
millis_standbytime in ms to perfor check of WDT. If longer than WDT Reset, WDT is temporanly suspend

Definition at line 72 of file accelerometer_task.cpp.

Member Data Documentation

◆ accelerometer

Accelerometer AccelerometerTask::accelerometer
private

Definition at line 122 of file accelerometer_task.h.

◆ accelerometer_configuration

accelerometer_t AccelerometerTask::accelerometer_configuration
private

Definition at line 123 of file accelerometer_task.h.

◆ param

AccelerometerParam_t AccelerometerTask::param
private

Definition at line 121 of file accelerometer_task.h.

◆ rtc

STM32RTC& AccelerometerTask::rtc = STM32RTC::getInstance()
private

Definition at line 118 of file accelerometer_task.h.

◆ state

AccelerometerState_t AccelerometerTask::state
private

Definition at line 120 of file accelerometer_task.h.

◆ value_x

float AccelerometerTask::value_x
private

Definition at line 126 of file accelerometer_task.h.

◆ value_y

float AccelerometerTask::value_y
private

Definition at line 127 of file accelerometer_task.h.

◆ value_z

float AccelerometerTask::value_z
private

Definition at line 128 of file accelerometer_task.h.


The documentation for this class was generated from the following files: