1
0

reset-simple.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-11-26 GuEe-GUI first version
  9. */
  10. #ifndef __RESET_SIMPLE_H__
  11. #define __RESET_SIMPLE_H__
  12. #include <rtthread.h>
  13. #include <rtdevice.h>
  14. struct reset_simple
  15. {
  16. struct rt_reset_controller parent;
  17. void *mmio_base;
  18. /*
  19. * If true, bits are cleared to assert the reset.
  20. * Otherwise, bits are set to assert the reset.
  21. */
  22. rt_bool_t active_low;
  23. /*
  24. * If true, bits read back as cleared while the reset is asserted.
  25. * Otherwise, bits read back as set while the reset is asserted.
  26. */
  27. rt_bool_t status_active_low;
  28. /*
  29. * Minimum delay in microseconds needed that needs to be
  30. * waited for between an assert and a deassert to reset the device.
  31. * If multiple consumers with different delay
  32. * requirements are connected to this controller, it must
  33. * be the largest minimum delay. 0 means that such a delay is
  34. * unknown and the reset operation is unsupported.
  35. */
  36. rt_uint32_t reset_us;
  37. /* protect registers during read-modify-write cycles */
  38. struct rt_spinlock lock;
  39. };
  40. extern const struct rt_reset_control_ops reset_simple_ops;
  41. #endif /* __RESET_SIMPLE_H__ */