sp804_delay_timer.h 662 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (c) 2015, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef SP804_DELAY_TIMER_H
  7. #define SP804_DELAY_TIMER_H
  8. #include <stdint.h>
  9. #include <drivers/delay_timer.h>
  10. uint32_t sp804_get_timer_value(void);
  11. void sp804_timer_ops_init(uintptr_t base_addr, const timer_ops_t *ops);
  12. #define sp804_timer_init(base_addr, clk_mult, clk_div) \
  13. do { \
  14. static const timer_ops_t sp804_timer_ops = { \
  15. sp804_get_timer_value, \
  16. (clk_mult), \
  17. (clk_div) \
  18. }; \
  19. sp804_timer_ops_init((base_addr), &sp804_timer_ops); \
  20. } while (0)
  21. #endif /* SP804_DELAY_TIMER_H */