HAL.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : HAL.h
  3. * Author : WCH
  4. * Version : V1.0
  5. * Date : 2016/05/05
  6. * Description :
  7. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  8. * SPDX-License-Identifier: Apache-2.0
  9. *******************************************************************************/
  10. /******************************************************************************/
  11. #ifndef __HAL_H
  12. #define __HAL_H
  13. #ifdef __cplusplus
  14. extern "C" {
  15. #endif
  16. #include "config.h"
  17. #include "RTC.h"
  18. #include "SLEEP.h"
  19. #include "LED.h"
  20. #include "KEY.h"
  21. /* hal task Event */
  22. #define LED_BLINK_EVENT 0x0001
  23. #define HAL_KEY_EVENT 0x0002
  24. #define HAL_REG_INIT_EVENT 0x2000
  25. #define HAL_TEST_EVENT 0x4000
  26. /*********************************************************************
  27. * GLOBAL VARIABLES
  28. */
  29. extern tmosTaskID halTaskID;
  30. /*********************************************************************
  31. * GLOBAL FUNCTIONS
  32. */
  33. /**
  34. * @brief 硬件初始化
  35. */
  36. extern void HAL_Init(void);
  37. /**
  38. * @brief 硬件层事务处理
  39. *
  40. * @param task_id - The TMOS assigned task ID.
  41. * @param events - events to process. This is a bit map and can
  42. * contain more than one event.
  43. */
  44. extern tmosEvents HAL_ProcessEvent(tmosTaskID task_id, tmosEvents events);
  45. /**
  46. * @brief BLE 库初始化
  47. */
  48. extern void CH58X_BLEInit(void);
  49. /**
  50. * @brief 获取内部温感采样值,如果使用了ADC中断采样,需在此函数中暂时屏蔽中断.
  51. *
  52. * @return 内部温感采样值.
  53. */
  54. extern uint16_t HAL_GetInterTempValue(void);
  55. /**
  56. * @brief 内部32k校准
  57. */
  58. extern void Lib_Calibration_LSI(void);
  59. /*********************************************************************
  60. *********************************************************************/
  61. #ifdef __cplusplus
  62. }
  63. #endif
  64. #endif