sl@1: // sl@1: // sl@1: // sl@1: sl@1: #ifndef MINI_DISPLAY_H sl@1: #define MINI_DISPLAY_H sl@1: sl@2: /* Cmake will define MyLibrary_EXPORTS on Windows when it sl@2: configures to build a shared library. If you are going to use sl@2: another build system on windows or create the visual studio sl@2: projects by hand you need to define MyLibrary_EXPORTS when sl@2: building a DLL on windows. sl@1: */ sl@2: // We are using the Visual Studio Compiler and building Shared libraries sl@1: sl@4: #if defined (_WIN32) sl@2: #if defined(MiniDisplay_EXPORTS) sl@2: #define MDAPI __declspec(dllexport) sl@2: #else sl@2: #define MDAPI __declspec(dllimport) sl@2: #endif /* MyLibrary_EXPORTS */ sl@2: #else /* defined (_WIN32) */ sl@2: #define MDAPI sl@2: #endif sl@2: sl@2: typedef void* MiniDisplayDevice; sl@2: sl@4: typedef enum sl@4: { sl@8: EMiniDisplayAutoDetect=0, /*Not yet implemented*/ sl@8: EMiniDisplayFutabaGP1212A01, StephaneLenclud@18: EMiniDisplayFutabaGP1212A02, StephaneLenclud@18: EMiniDisplayAutoDetectFailed sl@8: } sl@8: TMiniDisplayType; sl@8: sl@8: typedef enum sl@8: { sl@4: EMiniDisplayRequestNone, sl@4: EMiniDisplayRequestDeviceId, sl@4: EMiniDisplayRequestFirmwareRevision, sl@4: EMiniDisplayRequestPowerSupplyStatus sl@4: } sl@4: TMiniDisplayRequest; sl@4: sl@2: //Open & Close functions sl@8: extern "C" MDAPI MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType); sl@2: extern "C" MDAPI void MiniDisplayClose(MiniDisplayDevice aDevice); sl@1: sl@1: /** sl@2: Clear our MiniDisplay. sl@2: @param [IN] The device to apply this command to. sl@1: */ sl@2: extern "C" MDAPI void MiniDisplayClear(MiniDisplayDevice aDevice); sl@1: sl@2: /** sl@2: Fill our MiniDisplay. sl@2: @param [IN] The device to apply this command to. sl@2: */ sl@2: extern "C" MDAPI void MiniDisplayFill(MiniDisplayDevice aDevice); sl@1: sl@2: /** sl@2: Swap our MiniDisplay buffers committing our back buffer content to the screen. sl@2: @param [IN] The device to apply this command to. sl@2: */ sl@2: extern "C" MDAPI void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice); sl@2: sl@2: /** sl@2: Provide maximum brightness level for the given device. sl@2: @param [IN] The device to apply this command to. sl@2: @return Maximum brightness level. sl@2: */ sl@2: extern "C" MDAPI int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice); sl@2: sl@2: /** sl@2: Provide minimum brightness level for the given device. sl@2: @param [IN] The device to apply this command to. sl@2: @return Minimum brightness level. sl@2: */ sl@2: extern "C" MDAPI int MiniDisplayMinBrightness(MiniDisplayDevice aDevice); sl@2: sl@2: /** sl@2: Set device brightness level. sl@2: @param [IN] The device to apply this command to. sl@2: @param [IN] Brightness level sl@2: */ sl@2: extern "C" MDAPI void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness); sl@1: sl@3: /** sl@3: Provide pixels width of our display. sl@3: @param [IN] The device to apply this command to. sl@3: @return Width in pixels. sl@3: */ sl@3: extern "C" MDAPI int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice); sl@3: sl@3: /** sl@3: Provide pixels height of our display. sl@3: @param [IN] The device to apply this command to. sl@3: @return Height in pixels. sl@3: */ sl@3: extern "C" MDAPI int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice); sl@3: sl@3: /** sl@3: Set our given pixel. sl@3: @param [IN] The device to apply this command to. sl@3: @param [IN] Pixel X coordinate. sl@3: @param [IN] Pixel Y coordinate. sl@3: @param [IN] Pixel value. sl@3: */ sl@22: extern "C" MDAPI void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, unsigned int aPixel); sl@3: sl@3: //TODO: Have an API to specify pixel depth sl@3: sl@4: /** sl@4: Provide vendor name. sl@4: @param [IN] The device to apply this command to. sl@4: @return Vendor name. sl@4: */ sl@4: extern "C" MDAPI wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice); sl@4: sl@4: /** sl@4: Provide product name. sl@4: @param [IN] The device to apply this command to. sl@4: @return Product name. sl@4: */ sl@4: extern "C" MDAPI wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice); sl@4: sl@4: /** sl@4: Provide Serial number. sl@4: @param [IN] The device to apply this command to. sl@4: @return Serial number name. sl@4: */ sl@4: extern "C" MDAPI wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice); sl@4: sl@4: /** sl@4: Request device ID. sl@4: @param [IN] The device to apply this command to. sl@4: */ sl@11: extern "C" MDAPI void MiniDisplayRequest(MiniDisplayDevice aDevice, TMiniDisplayRequest aRequest); sl@4: sl@4: /** sl@4: Tell whether or not a request is pending. sl@4: @param [IN] The device to apply this command to. sl@4: @return true if we have a request pending, false otherwise. sl@4: */ sl@4: extern "C" MDAPI bool MiniDisplayRequestPending(MiniDisplayDevice aDevice); sl@4: sl@4: sl@4: /** sl@4: Provide the current request if any. sl@4: @param [IN] The device to apply this command to. sl@4: @return The current request if any. sl@4: */ sl@4: extern "C" MDAPI TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice); sl@4: sl@4: sl@4: /** sl@4: Cancel any pending request. sl@4: @param [IN] The device to apply this command to. sl@4: */ sl@4: extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice); sl@1: sl@5: /** sl@5: Attempt request completion. sl@5: @param [IN] The device to apply this command to. sl@5: */ sl@6: extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice); sl@5: sl@5: /** sl@5: Provide device ID. sl@5: @param [IN] The device to apply this command to. sl@5: @return Device ID name. sl@5: */ sl@5: extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice); sl@5: sl@5: /** sl@5: Provide firmware revision. sl@5: @param [IN] The device to apply this command to. sl@5: @return Firmware revision name. sl@5: */ sl@5: extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice); sl@5: sl@6: /** sl@6: Get power supply status. sl@6: @param [IN] The device to apply this command to. sl@6: */ sl@6: extern "C" MDAPI bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice); sl@6: sl@16: /** sl@16: Turn device Power ON. sl@16: @param [IN] The device to apply this command to. sl@16: */ sl@16: extern "C" MDAPI void MiniDisplayPowerOn(MiniDisplayDevice aDevice); sl@16: sl@16: /** sl@16: Turn device Power OFF. sl@16: @param [IN] The device to apply this command to. sl@16: */ sl@16: extern "C" MDAPI void MiniDisplayPowerOff(MiniDisplayDevice aDevice); sl@16: sl@16: /** sl@16: Specifies whether or not this display supports power ON/OFF functions. sl@16: @param [IN] The device to apply this command to. sl@16: @return True if one can turn display power on and off, false otherwise. sl@16: */ sl@16: extern "C" MDAPI bool MiniDisplaySupportPowerOnOff(MiniDisplayDevice aDevice); sl@6: sl@17: /** sl@17: Show built-in clock. sl@17: @param [IN] The device to apply this command to. sl@17: */ sl@17: extern "C" MDAPI void MiniDisplayShowClock(MiniDisplayDevice aDevice); sl@17: sl@17: /** sl@17: Hide built-in clock. sl@17: @param [IN] The device to apply this command to. sl@17: */ sl@17: extern "C" MDAPI void MiniDisplayHideClock(MiniDisplayDevice aDevice); sl@17: sl@17: /** sl@17: Specifies whether or not this display supports clock functions. sl@17: @param [IN] The device to apply this command to. sl@17: @return True if this display supports built-in clock, false otherwise. sl@17: */ sl@17: extern "C" MDAPI bool MiniDisplaySupportClock(MiniDisplayDevice aDevice); sl@17: sl@5: sl@1: #endif sl@1: