ramp_ctrl.h 776 B

123456789101112131415161718192021222324252627
  1. #ifndef _RAMP_CTRL_H__
  2. #define _RAMP_CTRL_H__
  3. #include "os/os_task.h"
  4. typedef struct {
  5. shark_timer_t timer;
  6. float start_point;
  7. float final_point;
  8. float interpolation;
  9. u32 duration_ms;
  10. u32 step_ms;
  11. float step_val;
  12. }ramp_t;
  13. void ramp_ctrl_init(ramp_t *ramp);
  14. void ramp_clear(ramp_t *ramp);
  15. void ramp_exc(ramp_t *ramp);
  16. float ramp_get_target(ramp_t *ramp);
  17. bool ramp_complete(ramp_t *ramp);
  18. void ramp_set_target_duration(ramp_t *ramp, float start, float final, u32 duration_ms);
  19. void ramp_set_points(ramp_t *ramp, float start, float target);
  20. void ramp_set_target(ramp_t *ramp, float target) ;
  21. void ramp_set_step_value(ramp_t *ramp, float step);
  22. void ramp_set_step_time(ramp_t *ramp, u32 ms) ;
  23. float ramp_get_interpolation(ramp_t *ramp);
  24. #endif /* _RAMP_CTRL_H__ */