core_service.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2022 OpenLuat & AirM2M
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a copy of
  5. * this software and associated documentation files (the "Software"), to deal in
  6. * the Software without restriction, including without limitation the rights to
  7. * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  8. * the Software, and to permit persons to whom the Software is furnished to do so,
  9. * subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in all
  12. * copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
  16. * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
  17. * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
  18. * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  19. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  20. */
  21. #ifndef __CORE_SERVICE_H__
  22. #define __CORE_SERVICE_H__
  23. #include "bsp_common.h"
  24. typedef struct
  25. {
  26. uint32_t Speed;
  27. uint32_t x1;
  28. uint32_t y1;
  29. uint32_t x2;
  30. uint32_t y2;
  31. uint32_t xoffset;
  32. uint32_t yoffset;
  33. uint32_t Size;
  34. uint8_t *Data;
  35. uint8_t SpiID;
  36. uint8_t Mode;
  37. uint8_t CSPin;
  38. uint8_t DCPin;
  39. uint8_t ColorMode;
  40. }LCD_DrawStruct;
  41. void Core_ServiceInit(void);
  42. void Core_LCDDraw(LCD_DrawStruct *Draw);
  43. void Core_CameraDraw(LCD_DrawStruct *Draw);
  44. void Core_DecodeQR(uint8_t *ImageData, uint16_t ImageW, uint16_t ImageH, CBDataFun_t CB);
  45. uint32_t Core_LCDDrawCacheLen(void);
  46. void Core_USBDefaultDeviceStart(uint8_t USB_ID);
  47. void Core_USBAction(uint8_t USB_ID, uint8_t Action, void *pParam);
  48. void Core_PrintMemInfo(void);
  49. void Core_PrintServiceStack(void);
  50. void Core_DebugMem(uint8_t HeapID, const char *FuncName, uint32_t Line);
  51. uint8_t Core_GetSleepFlag(void);
  52. void Core_SetSleepEnable(uint8_t OnOff);
  53. void Core_VUartInit(uint8_t UartID, uint32_t BaudRate, uint8_t IsRxCacheEnable, uint8_t DataBits, uint8_t Parity, uint8_t StopBits, CBFuncEx_t CB);
  54. void Core_VUartDeInit(uint8_t UartID);
  55. void Core_VUartSetRxTimeout(uint8_t UartID, uint32_t TimeoutUS);
  56. void Core_VUartSetCb(uint8_t UartID, CBFuncEx_t CB);
  57. uint32_t Core_VUartRxBufferRead(uint8_t UartID, uint8_t *Data, uint32_t Len);
  58. int32_t Core_VUartBufferTx(uint8_t UartID, const uint8_t *Data, uint32_t Len);
  59. void Core_VUartBufferTxStop(uint8_t UartID);
  60. void Core_VHIDInit(uint8_t USB_ID, CBFuncEx_t CB);
  61. void Core_VHIDUploadData(uint8_t USB_ID, uint8_t *Data, uint16_t Len);
  62. void Core_VHIDUploadStop(uint8_t USB_ID);
  63. #endif