HAL.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : HAL.h
  3. * Author : WCH
  4. * Version : V1.0
  5. * Date : 2016/05/05
  6. * Description :
  7. *********************************************************************************
  8. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  9. * Attention: This software (modified or not) and binary are used for
  10. * microcontroller manufactured by Nanjing Qinheng Microelectronics.
  11. *******************************************************************************/
  12. /******************************************************************************/
  13. #ifndef __HAL_H
  14. #define __HAL_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include "config.h"
  19. #include "RTC.h"
  20. #include "SLEEP.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 Hardware initialization
  35. */
  36. extern void HAL_Init(void);
  37. /**
  38. * @brief HAL processing
  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 Initialization of the BLE library
  47. */
  48. extern void WCHBLE_Init(void);
  49. /**
  50. * @brief Get the internal temperature sampling value.
  51. * If the ADC interrupt sampling is used,
  52. * the interrupt is temporarily shielded in this function.
  53. *
  54. * @return Internal temperature sampling value.
  55. */
  56. extern uint16_t HAL_GetInterTempValue(void);
  57. /**
  58. * @brief Internal 32K calibration
  59. */
  60. extern void Lib_Calibration_LSI(void);
  61. /*********************************************************************
  62. *********************************************************************/
  63. #ifdef __cplusplus
  64. }
  65. #endif
  66. #endif