PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
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.

39 lines
1004B

  1. #ifndef SnoozeSleepPWM_h
  2. #define SnoozeSleepPWM_h
  3. #include "SnoozeBlock.h"
  4. #include "Arduino.h"
  5. class SnoozeSleepPWM : public SnoozeBlock {
  6. private:
  7. virtual void disableDriver( void );
  8. virtual void enableDriver( void );
  9. virtual void clearIsrFlags( void );
  10. uint32_t cval;
  11. uint32_t rval;
  12. uint32_t max;
  13. uint32_t mod;
  14. uint8_t pwm_pin;
  15. uint8_t pwm_value;
  16. uint8_t pwm_resloution;
  17. volatile uint32_t *FTMx_CxV;
  18. volatile uint32_t *TPMx_CxV;
  19. volatile uint32_t *FTMx_MOD;
  20. volatile uint32_t *TPMx_MOD;
  21. volatile uint32_t *FTMx_SC;
  22. volatile uint32_t *TPMx_SC;
  23. volatile uint32_t *FTMx_CNT;
  24. uint32_t SIM_SOPT2_VALUE;
  25. uint32_t FTMx_CxV_VALUE;
  26. uint32_t TPMx_CxV_VALUE;
  27. uint32_t FTMx_MOD_VALUE;
  28. uint32_t TPMx_MOD_VALUE;
  29. uint32_t FTMx_SC_VALUE;
  30. uint32_t TPMx_SC_VALUE;
  31. public:
  32. SnoozeSleepPWM(void) { isDriver = true; }
  33. void configure( uint8_t pin, int value, uint8_t res );
  34. };
  35. #endif /* defined(SnoozeSleepPWM_h) */