yc_drv_common.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright 2016, yichip Semiconductor(shenzhen office)
  3. * All Rights Reserved.
  4. *
  5. * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Yichip Semiconductor;
  6. * the contents of this file may not be disclosed to third parties, copied
  7. * or duplicated in any form, in whole or in part, without the prior
  8. * written permission of Yichip Semiconductor.
  9. */
  10. /**
  11. *@file common.h
  12. *@brief common support for application.
  13. */
  14. #ifndef YC_DRV_COMMON_H
  15. #define YC_DRV_COMMON_H
  16. #include <stdbool.h>
  17. #include <string.h>
  18. #include "yc11xx.h"
  19. #include "ycdef.h"
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /**
  24. *@brief Writing hardware register.
  25. *@param reg register.
  26. *@param word value.
  27. *@return None.
  28. */
  29. void HW_REG_16BIT(uint32_t reg, uint16_t word);
  30. /**
  31. *@brief Reading hardware register.
  32. *@param reg register.
  33. *@return The register 16-bit value.
  34. */
  35. uint16_t HR_REG_16BIT(uint32_t reg);
  36. /**
  37. *@brief Reading hardware register.
  38. *@param reg register.
  39. *@return The register 24_bit value.
  40. */
  41. uint32_t HR_REG_24BIT(uint32_t reg);
  42. void error_handle();
  43. void whileDelay(int delayValue);
  44. void whileDelayshort(int delayValue);
  45. #ifdef __cplusplus
  46. }
  47. #endif
  48. #endif