meas_tasks.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 _LimiterSwitchData {
  16. uint16_t gpioPin;
  17. GPIO_PinState pinState;
  18. };
  19. typedef struct _LimiterSwitchData LimiterSwitchData;
  20. enum _EncoderDirection { encoderCW, encoderCCW };
  21. typedef enum _EncoderDirection EncoderDirection;
  22. enum _EncoderAxe { encoderAxeX, encoderAxeY };
  23. typedef enum _EncoderAxe EncoderAxe;
  24. struct _EncoderData {
  25. EncoderAxe axe;
  26. EncoderDirection direction;
  27. };
  28. typedef struct _EncoderData EncoderData;
  29. extern osMessageQueueId_t adc1MeasDataQueue;
  30. extern osMessageQueueId_t adc2MeasDataQueue;
  31. extern osMessageQueueId_t adc3MeasDataQueue;
  32. extern osMessageQueueId_t limiterSwitchDataQueue;
  33. extern osMessageQueueId_t encoderDataQueue;
  34. extern osMutexId_t resMeasurementsMutex;
  35. extern osMutexId_t sensorsInfoMutex;
  36. void MeasTasksInit (void);
  37. void ADC1MeasTask (void* arg);
  38. void ADC2MeasTask (void* arg);
  39. void ADC3MeasTask (void* arg);
  40. void LimiterSwitchTask (void* arg);
  41. void EncoderTask (void* arg);
  42. #endif /* INC_MEAS_TASKS_H_ */