MiniDisplay.h
author sl
Thu, 21 Aug 2014 21:53:35 +0200
changeset 9 6b08e3e81cf3
parent 6 b1c1b2be9a1c
child 11 2d749a2bea34
permissions -rw-r--r--
Still working on our architecture to support GP1212A02
     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     }
    34 TMiniDisplayType;
    35 
    36 typedef enum
    37     {
    38     EMiniDisplayRequestNone,
    39     EMiniDisplayRequestDeviceId,
    40     EMiniDisplayRequestFirmwareRevision,
    41     EMiniDisplayRequestPowerSupplyStatus
    42     }
    43 TMiniDisplayRequest;
    44 
    45 //Open & Close functions
    46 extern "C" MDAPI MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType);
    47 extern "C" MDAPI void MiniDisplayClose(MiniDisplayDevice aDevice);
    48 
    49 /**
    50 Clear our MiniDisplay.
    51 @param [IN] The device to apply this command to.
    52 */
    53 extern "C" MDAPI void MiniDisplayClear(MiniDisplayDevice aDevice);
    54 
    55 /**
    56 Fill our MiniDisplay.
    57 @param [IN] The device to apply this command to.
    58 */
    59 extern "C" MDAPI void MiniDisplayFill(MiniDisplayDevice aDevice);
    60 
    61 /**
    62 Swap our MiniDisplay buffers committing our back buffer content to the screen.
    63 @param [IN] The device to apply this command to.
    64 */
    65 extern "C" MDAPI void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice);
    66 
    67 /**
    68 Provide maximum brightness level for the given device.
    69 @param [IN] The device to apply this command to.
    70 @return Maximum brightness level.
    71 */
    72 extern "C" MDAPI int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice);
    73 
    74 /**
    75 Provide minimum brightness level for the given device.
    76 @param [IN] The device to apply this command to.
    77 @return Minimum brightness level.
    78 */
    79 extern "C" MDAPI int MiniDisplayMinBrightness(MiniDisplayDevice aDevice);
    80 
    81 /**
    82 Set device brightness level.
    83 @param [IN] The device to apply this command to.
    84 @param [IN] Brightness level
    85 */
    86 extern "C" MDAPI void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness);
    87 
    88 /**
    89 Provide pixels width of our display.
    90 @param [IN] The device to apply this command to.
    91 @return Width in pixels.
    92 */
    93 extern "C" MDAPI int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice);
    94 
    95 /**
    96 Provide pixels height of our display.
    97 @param [IN] The device to apply this command to.
    98 @return Height in pixels.
    99 */
   100 extern "C" MDAPI int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice);
   101 
   102 /**
   103 Set our given pixel.
   104 @param [IN] The device to apply this command to.
   105 @param [IN] Pixel X coordinate.
   106 @param [IN] Pixel Y coordinate.
   107 @param [IN] Pixel value.
   108 */
   109 extern "C" MDAPI void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, int aValue);
   110 
   111 //TODO: Have an API to specify pixel depth
   112 
   113 /**
   114 Provide vendor name.
   115 @param [IN] The device to apply this command to.
   116 @return Vendor name.
   117 */
   118 extern "C" MDAPI wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice);
   119 
   120 /**
   121 Provide product name.
   122 @param [IN] The device to apply this command to.
   123 @return Product name.
   124 */
   125 extern "C" MDAPI wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice);
   126 
   127 /**
   128 Provide Serial number.
   129 @param [IN] The device to apply this command to.
   130 @return Serial number name.
   131 */
   132 extern "C" MDAPI wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice);
   133 
   134 /**
   135 Request device ID.
   136 @param [IN] The device to apply this command to.
   137 */
   138 extern "C" MDAPI void MiniDisplayRequestDeviceId(MiniDisplayDevice aDevice);
   139 
   140 /**
   141 Request power status.
   142 @param [IN] The device to apply this command to.
   143 */
   144 extern "C" MDAPI void MiniDisplayRequestPowerSupplyStatus(MiniDisplayDevice aDevice);
   145 
   146 /**
   147 Request firmware version.
   148 @param [IN] The device to apply this command to.
   149 */
   150 extern "C" MDAPI void MiniDisplayRequestFirmwareRevision(MiniDisplayDevice aDevice);
   151 
   152 /**
   153 Tell whether or not a request is pending.
   154 @param [IN] The device to apply this command to.
   155 @return true if we have a request pending, false otherwise.
   156 */
   157 extern "C" MDAPI bool MiniDisplayRequestPending(MiniDisplayDevice aDevice);
   158 
   159 
   160 /**
   161 Provide the current request if any.
   162 @param [IN] The device to apply this command to.
   163 @return The current request if any.
   164 */
   165 extern "C" MDAPI TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice);
   166 
   167 
   168 /**
   169 Cancel any pending request.
   170 @param [IN] The device to apply this command to.
   171 */
   172 extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice);
   173 
   174 /**
   175 Attempt request completion.
   176 @param [IN] The device to apply this command to.
   177 */
   178 extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice);
   179 
   180 /**
   181 Provide device ID.
   182 @param [IN] The device to apply this command to.
   183 @return Device ID name.
   184 */
   185 extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice);
   186 
   187 /**
   188 Provide firmware revision.
   189 @param [IN] The device to apply this command to.
   190 @return Firmware revision name.
   191 */
   192 extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice);
   193 
   194 /**
   195 Get power supply status.
   196 @param [IN] The device to apply this command to.
   197 */
   198 extern "C" MDAPI bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice);
   199 
   200 
   201 
   202 #endif
   203