yc11xx_ks.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 ks.h
  12. *@brief key scan support for application.
  13. */
  14. #include <stdio.h>
  15. #include <string.h>
  16. #include <stdlib.h>
  17. #include "yc11xx.h"
  18. #include "yc_drv_common.h"
  19. #ifndef _KEYSCAN_
  20. #define _KEYSCAN_
  21. #define KS_BUFF_POLL_LEN 7
  22. typedef struct {
  23. uint8_t ksPool[KS_BUFF_POLL_LEN];
  24. }tKSEVENT;
  25. /**
  26. *@brief This function initialize key scan hardware.
  27. *@param None.
  28. *@return None.
  29. */
  30. void KS_Initialize(uint8_t Col[],
  31. uint8_t RowSize,
  32. uint8_t ColSize,
  33. uint8_t KsData[]);
  34. /**
  35. *@brief This function Get Keyscan event message.
  36. *@param None.
  37. *@return Pointer of keyscan event.
  38. */
  39. tKSEVENT *KS_GetCurrentEvt();
  40. /**
  41. *@brief This function scan ks matrix.
  42. *@param None.
  43. *@return None.
  44. */
  45. void KS_ScanMatrix();
  46. /**
  47. *@brief This function uninstall key scan hardware.
  48. *@param None.
  49. *@return None.
  50. */
  51. void KS_Unistall();
  52. #endif