meas_tasks.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * meas_tasks.h
  3. *
  4. * Created on: Sep 5, 2024
  5. * Author: jakubski
  6. */
  7. #ifndef INC_MEAS_TASKS_H_
  8. #define INC_MEAS_TASKS_H_
  9. #include "FreeRTOS.h"
  10. #include "FreeRTOSConfig.h"
  11. #include "cmsis_os.h"
  12. #include "stm32h7xx_hal.h"
  13. #include "task.h"
  14. #define GAIN_AUTO_CORRECTION
  15. struct _EncoderTaskArg
  16. {
  17. uint16_t dbgLed;
  18. float* currentPosition;
  19. float* positionOffset;
  20. int32_t* pvEncoder;
  21. float maxAngle;
  22. uint32_t initPinStates;
  23. osMessageQueueId_t dataQueue;
  24. };
  25. typedef struct _EncoderTaskArg EncoderTaskArg;
  26. extern osMessageQueueId_t adc1MeasDataQueue;
  27. extern osMessageQueueId_t adc2MeasDataQueue;
  28. extern osMessageQueueId_t adc3MeasDataQueue;
  29. extern osMessageQueueId_t limiterSwitchDataQueue;
  30. extern osMutexId_t resMeasurementsMutex;
  31. extern osMutexId_t sensorsInfoMutex;
  32. extern osThreadId_t encoderXTaskHandle;
  33. extern osThreadId_t encoderYTaskHandle;
  34. extern EncoderTaskArg encoderXTaskArg;
  35. extern EncoderTaskArg encoderYTaskArg;
  36. void MeasTasksInit (void);
  37. void ADC1MeasTask (void* arg);
  38. void ADC3MeasTask (void* arg);
  39. void LimiterSwitchTask (void* arg);
  40. void EncoderTask (void* arg);
  41. #endif /* INC_MEAS_TASKS_H_ */