core_service.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. uint32_t DCDelay;
  35. uint8_t *Data;
  36. uint8_t SpiID;
  37. uint8_t Mode;
  38. uint8_t CSPin;
  39. uint8_t DCPin;
  40. uint8_t ColorMode;
  41. }LCD_DrawStruct;
  42. void Core_ServiceInit(void);
  43. void Core_LCDDraw(LCD_DrawStruct *Draw);
  44. void Core_LCDDrawBlock(LCD_DrawStruct *Draw);
  45. void Core_CameraDraw(LCD_DrawStruct *Draw);
  46. void Core_WriteSDHC(void *pSDHC, void *pData);
  47. void Core_DecodeQR(uint8_t *ImageData, uint16_t ImageW, uint16_t ImageH, CBDataFun_t CB);
  48. uint32_t Core_LCDDrawCacheLen(void);
  49. void Core_USBSetID(uint8_t USB_ID, uint16_t VID, uint16_t PID);
  50. void Core_USBSetHIDMode(uint8_t USB_ID, uint8_t HIDMode, uint8_t BuffSize);
  51. void Core_USBDefaultDeviceStart(uint8_t USB_ID);
  52. void Core_USBAction(uint8_t USB_ID, uint8_t Action, void *pParam);
  53. void Core_ScanKeyBoard(void);
  54. void Core_SetRGB565FixValue(uint8_t R, uint8_t G, uint8_t B);
  55. void Core_EncodeJPEGSetup(HANDLE Fun, void *pParam);
  56. void Core_EncodeJPEGStart(uint32_t Width, uint32_t Height, uint8_t Quality);
  57. void Core_EncodeJPEGRun(uint8_t *Data, uint32_t Len, uint8_t ColorMode);
  58. void Core_EncodeJPEGEnd(CBFuncEx_t CB, void *pParam);
  59. void Core_PrintMemInfo(void);
  60. void Core_PrintServiceStack(void);
  61. void Core_DebugMem(uint8_t HeapID, const char *FuncName, uint32_t Line);
  62. uint8_t Core_GetSleepFlag(void);
  63. void Core_SetSleepEnable(uint8_t OnOff);
  64. void Core_VUartInit(uint8_t UartID, uint32_t BaudRate, uint8_t IsRxCacheEnable, uint8_t DataBits, uint8_t Parity, uint8_t StopBits, CBFuncEx_t CB);
  65. void Core_VUartDeInit(uint8_t UartID);
  66. void Core_VUartSetRxTimeout(uint8_t UartID, uint32_t TimeoutUS);
  67. void Core_VUartSetCb(uint8_t UartID, CBFuncEx_t CB);
  68. uint32_t Core_VUartRxBufferRead(uint8_t UartID, uint8_t *Data, uint32_t Len);
  69. void Core_VUartRxBufferClear(uint8_t UartID);
  70. int32_t Core_VUartBufferTx(uint8_t UartID, const uint8_t *Data, uint32_t Len);
  71. void Core_VUartBufferTxStop(uint8_t UartID);
  72. void Core_VHIDInit(uint8_t USB_ID, CBFuncEx_t CB);
  73. void Core_VHIDUploadData(uint8_t USB_ID, uint8_t *Data, uint32_t Len);
  74. void Core_VHIDSendRawData(uint8_t USB_ID, uint8_t *Data, uint32_t Len);
  75. void Core_VHIDUploadStop(uint8_t USB_ID);
  76. uint32_t Core_VHIDRxBufferRead(uint8_t USB_ID, uint8_t *Data, uint32_t Len);
  77. void Core_UDiskAttachSDHC(uint8_t USB_ID, void *pCtrl);
  78. void Core_UDiskDetachSDHC(uint8_t USB_ID, void *pCtrl);
  79. void Core_UDiskAttachSDHCRecovery(uint8_t USB_ID, void *pCtrl);
  80. int Core_OTAInit(CoreUpgrade_HeadStruct *Head, uint32_t size);
  81. int Core_OTAWrite(uint8_t *Data, uint32_t Len);
  82. uint8_t Core_OTACheckReadyStart(void);
  83. int Core_OTACheckDone(void);
  84. void Core_OTAEnd(uint8_t isOK);
  85. void Core_ServiceRunUserAPI(CBFuncEx_t CB, void *pData, void *pParam);
  86. void Core_ServiceRunUserAPIWithFile(CBFuncEx_t CB, void *pData, void *pParam);
  87. #endif