MiniDisplay.h
author sl
Sun, 21 Sep 2014 19:10:08 +0200
changeset 22 ea9ccfdb5563
parent 18 96c013c63595
child 24 9c233658ab28
permissions -rw-r--r--
Making our interface more generic by taking a 32bits color value.
     1 //
     2 //
     3 //
     4 
     5 #ifndef MINI_DISPLAY_H
     6 #define MINI_DISPLAY_H
     7 
     8 /* Cmake will define MyLibrary_EXPORTS on Windows when it
     9 configures to build a shared library. If you are going to use
    10 another build system on windows or create the visual studio
    11 projects by hand you need to define MyLibrary_EXPORTS when
    12 building a DLL on windows.
    13 */
    14 // We are using the Visual Studio Compiler and building Shared libraries
    15 
    16 #if defined (_WIN32)
    17   #if defined(MiniDisplay_EXPORTS)
    18     #define  MDAPI __declspec(dllexport)
    19   #else
    20     #define  MDAPI __declspec(dllimport)
    21   #endif /* MyLibrary_EXPORTS */
    22 #else /* defined (_WIN32) */
    23  #define MDAPI
    24 #endif
    25 
    26 typedef void* MiniDisplayDevice;
    27 
    28 typedef enum
    29     {
    30 	EMiniDisplayAutoDetect=0, /*Not yet implemented*/
    31     EMiniDisplayFutabaGP1212A01,
    32     EMiniDisplayFutabaGP1212A02,
    33 	EMiniDisplayAutoDetectFailed
    34     }
    35 TMiniDisplayType;
    36 
    37 typedef enum
    38     {
    39     EMiniDisplayRequestNone,
    40     EMiniDisplayRequestDeviceId,
    41     EMiniDisplayRequestFirmwareRevision,
    42     EMiniDisplayRequestPowerSupplyStatus
    43     }
    44 TMiniDisplayRequest;
    45 
    46 //Open & Close functions
    47 extern "C" MDAPI MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType);
    48 extern "C" MDAPI void MiniDisplayClose(MiniDisplayDevice aDevice);
    49 
    50 /**
    51 Clear our MiniDisplay.
    52 @param [IN] The device to apply this command to.
    53 */
    54 extern "C" MDAPI void MiniDisplayClear(MiniDisplayDevice aDevice);
    55 
    56 /**
    57 Fill our MiniDisplay.
    58 @param [IN] The device to apply this command to.
    59 */
    60 extern "C" MDAPI void MiniDisplayFill(MiniDisplayDevice aDevice);
    61 
    62 /**
    63 Swap our MiniDisplay buffers committing our back buffer content to the screen.
    64 @param [IN] The device to apply this command to.
    65 */
    66 extern "C" MDAPI void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice);
    67 
    68 /**
    69 Provide maximum brightness level for the given device.
    70 @param [IN] The device to apply this command to.
    71 @return Maximum brightness level.
    72 */
    73 extern "C" MDAPI int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice);
    74 
    75 /**
    76 Provide minimum brightness level for the given device.
    77 @param [IN] The device to apply this command to.
    78 @return Minimum brightness level.
    79 */
    80 extern "C" MDAPI int MiniDisplayMinBrightness(MiniDisplayDevice aDevice);
    81 
    82 /**
    83 Set device brightness level.
    84 @param [IN] The device to apply this command to.
    85 @param [IN] Brightness level
    86 */
    87 extern "C" MDAPI void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness);
    88 
    89 /**
    90 Provide pixels width of our display.
    91 @param [IN] The device to apply this command to.
    92 @return Width in pixels.
    93 */
    94 extern "C" MDAPI int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice);
    95 
    96 /**
    97 Provide pixels height of our display.
    98 @param [IN] The device to apply this command to.
    99 @return Height in pixels.
   100 */
   101 extern "C" MDAPI int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice);
   102 
   103 /**
   104 Set our given pixel.
   105 @param [IN] The device to apply this command to.
   106 @param [IN] Pixel X coordinate.
   107 @param [IN] Pixel Y coordinate.
   108 @param [IN] Pixel value.
   109 */
   110 extern "C" MDAPI void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, unsigned int aPixel);
   111 
   112 //TODO: Have an API to specify pixel depth
   113 
   114 /**
   115 Provide vendor name.
   116 @param [IN] The device to apply this command to.
   117 @return Vendor name.
   118 */
   119 extern "C" MDAPI wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice);
   120 
   121 /**
   122 Provide product name.
   123 @param [IN] The device to apply this command to.
   124 @return Product name.
   125 */
   126 extern "C" MDAPI wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice);
   127 
   128 /**
   129 Provide Serial number.
   130 @param [IN] The device to apply this command to.
   131 @return Serial number name.
   132 */
   133 extern "C" MDAPI wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice);
   134 
   135 /**
   136 Request device ID.
   137 @param [IN] The device to apply this command to.
   138 */
   139 extern "C" MDAPI void MiniDisplayRequest(MiniDisplayDevice aDevice, TMiniDisplayRequest aRequest);
   140 
   141 /**
   142 Tell whether or not a request is pending.
   143 @param [IN] The device to apply this command to.
   144 @return true if we have a request pending, false otherwise.
   145 */
   146 extern "C" MDAPI bool MiniDisplayRequestPending(MiniDisplayDevice aDevice);
   147 
   148 
   149 /**
   150 Provide the current request if any.
   151 @param [IN] The device to apply this command to.
   152 @return The current request if any.
   153 */
   154 extern "C" MDAPI TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice);
   155 
   156 
   157 /**
   158 Cancel any pending request.
   159 @param [IN] The device to apply this command to.
   160 */
   161 extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice);
   162 
   163 /**
   164 Attempt request completion.
   165 @param [IN] The device to apply this command to.
   166 */
   167 extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice);
   168 
   169 /**
   170 Provide device ID.
   171 @param [IN] The device to apply this command to.
   172 @return Device ID name.
   173 */
   174 extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice);
   175 
   176 /**
   177 Provide firmware revision.
   178 @param [IN] The device to apply this command to.
   179 @return Firmware revision name.
   180 */
   181 extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice);
   182 
   183 /**
   184 Get power supply status.
   185 @param [IN] The device to apply this command to.
   186 */
   187 extern "C" MDAPI bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice);
   188 
   189 /**
   190 Turn device Power ON.
   191 @param [IN] The device to apply this command to.
   192 */
   193 extern "C" MDAPI void MiniDisplayPowerOn(MiniDisplayDevice aDevice);
   194 
   195 /**
   196 Turn device Power OFF.
   197 @param [IN] The device to apply this command to.
   198 */
   199 extern "C" MDAPI void MiniDisplayPowerOff(MiniDisplayDevice aDevice);
   200 
   201 /**
   202 Specifies whether or not this display supports power ON/OFF functions.
   203 @param [IN] The device to apply this command to.
   204 @return True if one can turn display power on and off, false otherwise.
   205 */
   206 extern "C" MDAPI bool MiniDisplaySupportPowerOnOff(MiniDisplayDevice aDevice);
   207 
   208 /**
   209 Show built-in clock.
   210 @param [IN] The device to apply this command to.
   211 */
   212 extern "C" MDAPI void MiniDisplayShowClock(MiniDisplayDevice aDevice);
   213 
   214 /**
   215 Hide built-in clock.
   216 @param [IN] The device to apply this command to.
   217 */
   218 extern "C" MDAPI void MiniDisplayHideClock(MiniDisplayDevice aDevice);
   219 
   220 /**
   221 Specifies whether or not this display supports clock functions.
   222 @param [IN] The device to apply this command to.
   223 @return True if this display supports built-in clock, false otherwise.
   224 */
   225 extern "C" MDAPI bool MiniDisplaySupportClock(MiniDisplayDevice aDevice);
   226 
   227 
   228 #endif
   229