hv_drv_Gpio.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. * @file hv_drv_Gpio.h
  3. * @brief Header file of GPIO module.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. * (+) Use ()
  10. *
  11. * @endverbatim
  12. * @author HiView SoC Software Team
  13. * @version 1.0.0
  14. * @date 2023-05-30
  15. */
  16. #ifndef _HV_DRV_GPIO_H
  17. #define _HV_DRV_GPIO_H
  18. #include "hv_cal_Gpio.h"
  19. /** @defgroup DRV_GPIO DRV_GPIO
  20. * drv gpio functions
  21. * @{
  22. */
  23. /**@brief Enable the designated gpio interrupt
  24. * @param[in] ucPinIdx Specified GPIO pin
  25. */
  26. VOID Hv_Drv_Gpio_EnableInt(UCHAR8 ucPinIdx);
  27. /**@brief Disable the designated gpio interrupt
  28. * @param[in] ucPinIdx Specified GPIO pin
  29. */
  30. VOID Hv_Drv_Gpio_DisableInt(UCHAR8 ucPinIdx);
  31. /**@brief Set gpio pin interrupt trigger type
  32. * @param[in] ucPinIdx Specified GPIO pin, enPull Specified pull acion @ref GpioIntTrigMode
  33. */
  34. VOID Hv_Drv_Gpio_SetIntTriggerMode(UCHAR8 ucPinIdx, GpioIntTrigMode enIntTrigMode);
  35. /**@brief Set gpio pin interrupt callback
  36. * @param ucPinIdx Specified GPIO pin, pfCallBack Specified callback @ref GpioIntCallBack
  37. */
  38. VOID Hv_Drv_Gpio_SetIntCallBack(UCHAR8 ucPinIdx, GpioIntCallBack pfCallBack);
  39. /**
  40. @brief De-initializes the gpio module interrupts
  41. */
  42. VOID Hv_Drv_Gpio_CleanupInt(VOID);
  43. /**@brief Get interrupt state of designated gpio
  44. * @param[in] ucPinIdx Specified GPIO pin
  45. */
  46. BOOL Hv_Drv_Gpio_GetIntState(UCHAR8 ucPinIdx);
  47. /**@brief Clear the gpio interrupt status
  48. * @param[in]: ucPinIdx Specified GPIO pin
  49. */
  50. VOID Hv_Drv_Gpio_ClrIntState(UCHAR8 ucPinIdx);
  51. /**@brief Set gpio pin direction
  52. * @param[in] ucPinIdx Specified GPIO pin, enPull Specified pull acion @ref GpioDir
  53. */
  54. VOID Hv_Drv_Gpio_SetDirection(UCHAR8 ucPinIdx, GpioDir enDir);
  55. /**@brief Get gpio pin direction
  56. * @param[in] ucPinIdx Specified GPIO pin
  57. * @param[out] @ref GpioDir
  58. */
  59. GpioDir Hv_Drv_Gpio_GetDirection(UCHAR8 ucPinIdx);
  60. /**@brief Set gpio pin level
  61. * @param ucPinIdx Specified GPIO pin, enPull Specified pull acion @ref enLevel
  62. * @param enLevel high(1) or low(0) level
  63. */
  64. VOID Hv_Drv_Gpio_SetPinLevel(UCHAR8 ucPinIdx, GpioLevel enLevel);
  65. /**@brief Get gpio pin out level
  66. * @param[in] :ucPinIdx Specified GPIO pin
  67. * @param[out]: state high(1)/low(0)/invalid(2)
  68. */
  69. GpioLevel Hv_Drv_Gpio_GetPinLevel(UCHAR8 ucPinIdx);
  70. /** @} */
  71. #endif