MiniDisplay.h
author sl
Sat, 30 Aug 2014 18:43:54 +0200
changeset 14 86faea78ddf0
parent 8 5a9dbbc40c6b
child 16 42ba42be810d
permissions -rw-r--r--
GP1212A02A: Some proper commands implementation and experimenting with various
setup trying to get a descent frame rate.
     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 MiniDisplayRequest(MiniDisplayDevice aDevice, TMiniDisplayRequest aRequest);
   139 
   140 /**
   141 Tell whether or not a request is pending.
   142 @param [IN] The device to apply this command to.
   143 @return true if we have a request pending, false otherwise.
   144 */
   145 extern "C" MDAPI bool MiniDisplayRequestPending(MiniDisplayDevice aDevice);
   146 
   147 
   148 /**
   149 Provide the current request if any.
   150 @param [IN] The device to apply this command to.
   151 @return The current request if any.
   152 */
   153 extern "C" MDAPI TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice);
   154 
   155 
   156 /**
   157 Cancel any pending request.
   158 @param [IN] The device to apply this command to.
   159 */
   160 extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice);
   161 
   162 /**
   163 Attempt request completion.
   164 @param [IN] The device to apply this command to.
   165 */
   166 extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice);
   167 
   168 /**
   169 Provide device ID.
   170 @param [IN] The device to apply this command to.
   171 @return Device ID name.
   172 */
   173 extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice);
   174 
   175 /**
   176 Provide firmware revision.
   177 @param [IN] The device to apply this command to.
   178 @return Firmware revision name.
   179 */
   180 extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice);
   181 
   182 /**
   183 Get power supply status.
   184 @param [IN] The device to apply this command to.
   185 */
   186 extern "C" MDAPI bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice);
   187 
   188 
   189 
   190 #endif
   191