RCInput_ZYNQ.h 713 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. /*
  3. This class implements RCInput on the ZYNQ / ZyboPilot platform with custom
  4. logic doing the edge detection of the PPM sum input
  5. */
  6. #include "RCInput.h"
  7. namespace Linux {
  8. class RCInput_ZYNQ : public RCInput {
  9. public:
  10. void init() override;
  11. void _timer_tick(void) override;
  12. private:
  13. #if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_OCPOC_ZYNQ
  14. static const int TICK_PER_US=50;
  15. static const int TICK_PER_S=50000000;
  16. #else
  17. static const int TICK_PER_US=100;
  18. static const int TICK_PER_S=100000000;
  19. #endif
  20. // Memory mapped keyhole register to pulse input FIFO
  21. volatile uint32_t *pulse_input;
  22. // time spent in the low state
  23. uint32_t _s0_time;
  24. };
  25. }