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