SMART_COMPONENTS_Accel/Accel.h

42 lines
846 B
C

//
// Created by ilya on 25.03.24.
//
#ifndef SMART_COMPONENTS_ACCEL_H
#define SMART_COMPONENTS_ACCEL_H
#include <cmsis_os.h>
#include "AccelDataFlowInterface.h"
#include "Accel_QMA6100P.h"
typedef struct {
tAccelQma6100P accel;
tAccelDataFlowInterface accelDataFlow;
osMessageQueueId_t dataQueue;
volatile bool errorDataFlag;
vector3 current;
// struct {
// osThreadId_t id;
// uint32_t stack[256];
// StaticTask_t controlBlock;
// osThreadAttr_t attr;
// } thread;
} tAccel;
extern tAccel ACCEL;
void Accel_Init(tAccel *env, tSpiPortIO *accelIO);
void Accel_StartDevice(tAccel *env);
void Accel_StartThread(tAccel *env);
void Accel_Clear(tAccel *env);
void TMR1_Accel_TmrStart(tAccel *env);
bool Accel_WaitReady(tAccel *env, uint32_t timeout);
#endif //SMART_COMPONENTS_ACCEL_H