clock_control_litex.h 970 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2020 Antmicro <www.antmicro.com>
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. /**
  7. * @file
  8. * @brief LiteX Clock Control driver interface
  9. */
  10. #ifndef CLK_CTRL_LITEX_H
  11. #define CLK_CTRL_LITEX_H
  12. /**
  13. * @brief LiteX Clock Control driver interface
  14. * @defgroup clock_control_litex_interface LiteX Clock Control driver interface
  15. * @brief LiteX Clock Control driver interface
  16. * @ingroup clock_control_interface
  17. * @{
  18. */
  19. #include <zephyr/types.h>
  20. #define MMCM DT_NODELABEL(clock0)
  21. #define NCLKOUT DT_PROP_LEN(MMCM, clock_output_names)
  22. /**
  23. * @brief Structure for interfacing with clock control API
  24. *
  25. * @param clkout_nr Number of clock output to be changed
  26. * @param rate Frequency to set given in Hz
  27. * @param phase Phase offset in degrees
  28. * @param duty Duty cycle of clock signal in percent
  29. *
  30. */
  31. struct litex_clk_setup {
  32. uint8_t clkout_nr;
  33. uint32_t rate;
  34. uint16_t phase;
  35. uint8_t duty;
  36. };
  37. /**
  38. * @}
  39. */
  40. #endif /* CLK_CTRL_LITEX_H */