meas_tasks.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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* pvEncoder;
  20. uint32_t initPinStates;
  21. osMessageQueueId_t dataQueue;
  22. };
  23. typedef struct _EncoderTaskArg EncoderTaskArg;
  24. extern osMessageQueueId_t adc1MeasDataQueue;
  25. extern osMessageQueueId_t adc2MeasDataQueue;
  26. extern osMessageQueueId_t adc3MeasDataQueue;
  27. extern osMessageQueueId_t limiterSwitchDataQueue;
  28. extern osMutexId_t resMeasurementsMutex;
  29. extern osMutexId_t sensorsInfoMutex;
  30. extern osThreadId_t encoderXTaskHandle;
  31. extern osThreadId_t encoderYTaskHandle;
  32. extern EncoderTaskArg encoderXTaskArg;
  33. extern EncoderTaskArg encoderYTaskArg;
  34. void MeasTasksInit (void);
  35. void ADC1MeasTask (void* arg);
  36. void ADC3MeasTask (void* arg);
  37. void LimiterSwitchTask (void* arg);
  38. void EncoderTask (void* arg);
  39. #endif /* INC_MEAS_TASKS_H_ */