You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

36 lines
856 B

  1. #ifndef TASK_ACTUATORS_H
  2. #define TASK_ACTUATORS_H
  3. #include <Arduino.h>
  4. #include "App.h"
  5. #define PWM_FREQ_IO 40000 // 40 khz
  6. #define PWM_RESOLUTION_BITS 10
  7. #define PWM_MAX_RESOLUTION 1023
  8. // data container for PWM output
  9. struct ActuatorPWMAction
  10. {
  11. uint8_t channel;
  12. float percentage;
  13. uint32_t speed;
  14. };
  15. // Entry point
  16. TaskHandle_t InitActuators();
  17. // RTOS tasks
  18. void ActuatorTask(void *parameter);
  19. void Task_IO_A(void *parameter);
  20. void Task_IO_B(void *parameter);
  21. void Task_IO_C(void *parameter);
  22. void Task_IO_D(void *parameter);
  23. //void Task_Brightness(void *parameter);
  24. // Functions
  25. void ChannelTaskFunc(uint8_t channel, QueueHandle_t queue);
  26. void InitPWM(uint8_t channel, double frequency, uint8_t pin);
  27. void PWM_Write(uint8_t channel, uint16_t duty);
  28. void PWM_Fade(uint8_t channel, uint16_t from_duty, uint16_t to_duty, uint32_t ms);
  29. #endif