MiniDisplay.h
author StephaneLenclud
Tue, 10 Feb 2015 15:38:27 +0100
changeset 34 892f755c2612
parent 32 2c844ef1ff4b
child 35 638eb0763e20
permissions -rw-r--r--
MDM166AA: Clock and Clear adjustments.
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
    {
StephaneLenclud@24
    30
	EMiniDisplayAutoDetect=0,
sl@8
    31
    EMiniDisplayFutabaGP1212A01,
StephaneLenclud@18
    32
    EMiniDisplayFutabaGP1212A02,
StephaneLenclud@25
    33
	EMiniDisplayFutabaMDM166AA,
StephaneLenclud@18
    34
	EMiniDisplayAutoDetectFailed
sl@8
    35
    }
sl@8
    36
TMiniDisplayType;
sl@8
    37
sl@8
    38
typedef enum
sl@8
    39
    {
StephaneLenclud@32
    40
    EMiniDisplayRequestNone=0,
sl@4
    41
    EMiniDisplayRequestDeviceId,
sl@4
    42
    EMiniDisplayRequestFirmwareRevision,
sl@4
    43
    EMiniDisplayRequestPowerSupplyStatus
sl@4
    44
    }
sl@4
    45
TMiniDisplayRequest;
sl@4
    46
StephaneLenclud@24
    47
/**
StephaneLenclud@32
    48
Define the various type of icons we support.
StephaneLenclud@32
    49
For binary compatibility new entries must be added at the end.
StephaneLenclud@32
    50
*/
StephaneLenclud@32
    51
typedef enum
StephaneLenclud@32
    52
    {
StephaneLenclud@33
    53
    EMiniDisplayIconNetworkSignal=0,
StephaneLenclud@33
    54
	EMiniDisplayIconInternet,
StephaneLenclud@32
    55
    EMiniDisplayIconEmail,
StephaneLenclud@32
    56
    EMiniDisplayIconMute,
StephaneLenclud@32
    57
    EMiniDisplayIconVolume,
StephaneLenclud@32
    58
	EMiniDisplayIconVolumeLabel,
StephaneLenclud@32
    59
	EMiniDisplayIconPlay,
StephaneLenclud@32
    60
	EMiniDisplayIconPause,
StephaneLenclud@32
    61
	EMiniDisplayIconRecording
StephaneLenclud@32
    62
    }
StephaneLenclud@32
    63
TMiniDisplayIconType;
StephaneLenclud@32
    64
StephaneLenclud@32
    65
/**
StephaneLenclud@24
    66
Attempt to establish a connection to with a display of the given type.
StephaneLenclud@24
    67
Supports display auto-detection too.
StephaneLenclud@24
    68
StephaneLenclud@24
    69
@param [IN] The display type we want to connect to.
StephaneLenclud@24
    70
@return Handle to the device we connected to on success, null otherwise.
StephaneLenclud@24
    71
*/
sl@8
    72
extern "C" MDAPI MiniDisplayDevice MiniDisplayOpen(TMiniDisplayType aType);
StephaneLenclud@24
    73
StephaneLenclud@24
    74
/**
StephaneLenclud@24
    75
Close the connection with the given display device.
StephaneLenclud@24
    76
StephaneLenclud@24
    77
@param [IN] The device to apply this command to.
StephaneLenclud@24
    78
*/
sl@2
    79
extern "C" MDAPI void MiniDisplayClose(MiniDisplayDevice aDevice);
sl@1
    80
sl@1
    81
/**
StephaneLenclud@24
    82
Provides the number of display types supported.
StephaneLenclud@24
    83
That includes the pseudo 'Auto-Detect' display.
StephaneLenclud@24
    84
@return The number of display type supported.
StephaneLenclud@24
    85
*/
StephaneLenclud@24
    86
extern "C" MDAPI int MiniDisplayTypeCount();
StephaneLenclud@24
    87
StephaneLenclud@24
    88
/**
StephaneLenclud@24
    89
Provides the human readable name of the given display type.
StephaneLenclud@24
    90
StephaneLenclud@24
    91
@param [IN] The display type we want to get the name for.
StephaneLenclud@24
    92
@return The name of the given display type.
StephaneLenclud@24
    93
*/
StephaneLenclud@24
    94
extern "C" MDAPI wchar_t* MiniDisplayTypeName(TMiniDisplayType aType);
StephaneLenclud@24
    95
StephaneLenclud@24
    96
/**
sl@2
    97
Clear our MiniDisplay.
sl@2
    98
@param [IN] The device to apply this command to.
sl@1
    99
*/
sl@2
   100
extern "C" MDAPI void MiniDisplayClear(MiniDisplayDevice aDevice);
sl@1
   101
sl@2
   102
/**
sl@2
   103
Fill our MiniDisplay.
sl@2
   104
@param [IN] The device to apply this command to.
sl@2
   105
*/
sl@2
   106
extern "C" MDAPI void MiniDisplayFill(MiniDisplayDevice aDevice);
sl@1
   107
sl@2
   108
/**
sl@2
   109
Swap our MiniDisplay buffers committing our back buffer content to the screen.
sl@2
   110
@param [IN] The device to apply this command to.
sl@2
   111
*/
sl@2
   112
extern "C" MDAPI void MiniDisplaySwapBuffers(MiniDisplayDevice aDevice);
sl@2
   113
sl@2
   114
/**
sl@2
   115
Provide maximum brightness level for the given device.
sl@2
   116
@param [IN] The device to apply this command to.
sl@2
   117
@return Maximum brightness level.
sl@2
   118
*/
sl@2
   119
extern "C" MDAPI int MiniDisplayMaxBrightness(MiniDisplayDevice aDevice);
sl@2
   120
sl@2
   121
/**
sl@2
   122
Provide minimum brightness level for the given device.
sl@2
   123
@param [IN] The device to apply this command to.
sl@2
   124
@return Minimum brightness level.
sl@2
   125
*/
sl@2
   126
extern "C" MDAPI int MiniDisplayMinBrightness(MiniDisplayDevice aDevice);
sl@2
   127
sl@2
   128
/**
sl@2
   129
Set device brightness level.
sl@2
   130
@param [IN] The device to apply this command to.
sl@2
   131
@param [IN] Brightness level
sl@2
   132
*/
sl@2
   133
extern "C" MDAPI void MiniDisplaySetBrightness(MiniDisplayDevice aDevice, int aBrightness);
sl@1
   134
sl@3
   135
/**
sl@3
   136
Provide pixels width of our display.
sl@3
   137
@param [IN] The device to apply this command to.
sl@3
   138
@return Width in pixels.
sl@3
   139
*/
sl@3
   140
extern "C" MDAPI int MiniDisplayWidthInPixels(MiniDisplayDevice aDevice);
sl@3
   141
sl@3
   142
/**
sl@3
   143
Provide pixels height of our display.
sl@3
   144
@param [IN] The device to apply this command to.
sl@3
   145
@return Height in pixels.
sl@3
   146
*/
sl@3
   147
extern "C" MDAPI int MiniDisplayHeightInPixels(MiniDisplayDevice aDevice);
sl@3
   148
sl@3
   149
/**
sl@3
   150
Set our given pixel.
sl@3
   151
@param [IN] The device to apply this command to.
sl@3
   152
@param [IN] Pixel X coordinate.
sl@3
   153
@param [IN] Pixel Y coordinate.
sl@3
   154
@param [IN] Pixel value.
sl@3
   155
*/
sl@22
   156
extern "C" MDAPI void MiniDisplaySetPixel(MiniDisplayDevice aDevice, int aX, int aY, unsigned int aPixel);
sl@3
   157
sl@3
   158
//TODO: Have an API to specify pixel depth
sl@3
   159
sl@4
   160
/**
sl@4
   161
Provide vendor name.
sl@4
   162
@param [IN] The device to apply this command to.
sl@4
   163
@return Vendor name.
sl@4
   164
*/
sl@4
   165
extern "C" MDAPI wchar_t* MiniDisplayVendor(MiniDisplayDevice aDevice);
sl@4
   166
sl@4
   167
/**
sl@4
   168
Provide product name.
sl@4
   169
@param [IN] The device to apply this command to.
sl@4
   170
@return Product name.
sl@4
   171
*/
sl@4
   172
extern "C" MDAPI wchar_t* MiniDisplayProduct(MiniDisplayDevice aDevice);
sl@4
   173
sl@4
   174
/**
sl@4
   175
Provide Serial number.
sl@4
   176
@param [IN] The device to apply this command to.
sl@4
   177
@return Serial number name.
sl@4
   178
*/
sl@4
   179
extern "C" MDAPI wchar_t* MiniDisplaySerialNumber(MiniDisplayDevice aDevice);
sl@4
   180
sl@4
   181
/**
sl@4
   182
Request device ID.
sl@4
   183
@param [IN] The device to apply this command to.
sl@4
   184
*/
sl@11
   185
extern "C" MDAPI void MiniDisplayRequest(MiniDisplayDevice aDevice, TMiniDisplayRequest aRequest);
sl@4
   186
sl@4
   187
/**
sl@4
   188
Tell whether or not a request is pending.
sl@4
   189
@param [IN] The device to apply this command to.
sl@4
   190
@return true if we have a request pending, false otherwise.
sl@4
   191
*/
sl@4
   192
extern "C" MDAPI bool MiniDisplayRequestPending(MiniDisplayDevice aDevice);
sl@4
   193
sl@4
   194
sl@4
   195
/**
sl@4
   196
Provide the current request if any.
sl@4
   197
@param [IN] The device to apply this command to.
sl@4
   198
@return The current request if any.
sl@4
   199
*/
sl@4
   200
extern "C" MDAPI TMiniDisplayRequest MiniDisplayCurrentRequest(MiniDisplayDevice aDevice);
sl@4
   201
sl@4
   202
sl@4
   203
/**
sl@4
   204
Cancel any pending request.
sl@4
   205
@param [IN] The device to apply this command to.
sl@4
   206
*/
sl@4
   207
extern "C" MDAPI void MiniDisplayCancelRequest(MiniDisplayDevice aDevice);
sl@1
   208
sl@5
   209
/**
sl@5
   210
Attempt request completion.
sl@5
   211
@param [IN] The device to apply this command to.
sl@5
   212
*/
sl@6
   213
extern "C" MDAPI TMiniDisplayRequest MiniDisplayAttemptRequestCompletion(MiniDisplayDevice aDevice);
sl@5
   214
sl@5
   215
/**
sl@5
   216
Provide device ID.
sl@5
   217
@param [IN] The device to apply this command to.
sl@5
   218
@return Device ID name.
sl@5
   219
*/
sl@5
   220
extern "C" MDAPI char* MiniDisplayDeviceId(MiniDisplayDevice aDevice);
sl@5
   221
sl@5
   222
/**
sl@5
   223
Provide firmware revision.
sl@5
   224
@param [IN] The device to apply this command to.
sl@5
   225
@return Firmware revision name.
sl@5
   226
*/
sl@5
   227
extern "C" MDAPI char* MiniDisplayFirmwareRevision(MiniDisplayDevice aDevice);
sl@5
   228
sl@6
   229
/**
sl@6
   230
Get power supply status.
sl@6
   231
@param [IN] The device to apply this command to.
sl@6
   232
*/
sl@6
   233
extern "C" MDAPI bool MiniDisplayPowerSupplyStatus(MiniDisplayDevice aDevice);
sl@6
   234
sl@16
   235
/**
sl@16
   236
Turn device Power ON.
sl@16
   237
@param [IN] The device to apply this command to.
sl@16
   238
*/
sl@16
   239
extern "C" MDAPI void MiniDisplayPowerOn(MiniDisplayDevice aDevice);
sl@16
   240
sl@16
   241
/**
sl@16
   242
Turn device Power OFF.
sl@16
   243
@param [IN] The device to apply this command to.
sl@16
   244
*/
sl@16
   245
extern "C" MDAPI void MiniDisplayPowerOff(MiniDisplayDevice aDevice);
sl@16
   246
sl@16
   247
/**
sl@16
   248
Specifies whether or not this display supports power ON/OFF functions.
sl@16
   249
@param [IN] The device to apply this command to.
sl@16
   250
@return True if one can turn display power on and off, false otherwise.
sl@16
   251
*/
sl@16
   252
extern "C" MDAPI bool MiniDisplaySupportPowerOnOff(MiniDisplayDevice aDevice);
sl@6
   253
sl@17
   254
/**
sl@17
   255
Show built-in clock.
sl@17
   256
@param [IN] The device to apply this command to.
sl@17
   257
*/
sl@17
   258
extern "C" MDAPI void MiniDisplayShowClock(MiniDisplayDevice aDevice);
sl@17
   259
sl@17
   260
/**
sl@17
   261
Hide built-in clock.
sl@17
   262
@param [IN] The device to apply this command to.
sl@17
   263
*/
sl@17
   264
extern "C" MDAPI void MiniDisplayHideClock(MiniDisplayDevice aDevice);
sl@17
   265
sl@17
   266
/**
sl@17
   267
Specifies whether or not this display supports clock functions.
sl@17
   268
@param [IN] The device to apply this command to.
sl@17
   269
@return True if this display supports built-in clock, false otherwise.
sl@17
   270
*/
sl@17
   271
extern "C" MDAPI bool MiniDisplaySupportClock(MiniDisplayDevice aDevice);
sl@17
   272
StephaneLenclud@32
   273
/**
StephaneLenclud@32
   274
Tells how many icons of the given are supported by the specified device.
StephaneLenclud@32
   275
Typically icons on a VFD hardware have several segments that can be light up separately.
StephaneLenclud@32
   276
@param [IN] The device to apply this command to.
StephaneLenclud@32
   277
@param [IN] The type of icon we are interested in.
StephaneLenclud@32
   278
@return The number of icons of this kind this display supports.
StephaneLenclud@32
   279
*/
StephaneLenclud@32
   280
extern "C" MDAPI int MiniDisplayIconCount(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon);
sl@5
   281
StephaneLenclud@32
   282
/**
StephaneLenclud@32
   283
Tells how many status the icon of the specified type supports for the given device.
StephaneLenclud@32
   284
Status are typically brightness level on VFD hardware.
StephaneLenclud@32
   285
Most icon will just support 2 status: 0 for Off and 1 for On.
StephaneLenclud@32
   286
@param [IN] The device to apply this command to.
StephaneLenclud@32
   287
@param [IN] The type of icon we are interested in.
StephaneLenclud@32
   288
@return The number of icons of this kind this display supports.
StephaneLenclud@32
   289
*/
StephaneLenclud@32
   290
extern "C" MDAPI int MiniDisplayIconStatusCount(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon);
StephaneLenclud@32
   291
StephaneLenclud@32
   292
/**
StephaneLenclud@32
   293
Set the status of the given icon for the specified device.
StephaneLenclud@32
   294
@param [IN] The device to apply this command to.
StephaneLenclud@32
   295
@param [IN] The type of icon we are interested in.
StephaneLenclud@32
   296
@param [IN] The index of the icon of the given type.
StephaneLenclud@32
   297
@param [IN] The status the icon is to assume.
StephaneLenclud@32
   298
*/
StephaneLenclud@32
   299
extern "C" MDAPI void MiniDisplaySetIconStatus(MiniDisplayDevice aDevice, TMiniDisplayIconType aIcon, int aIndex, int aStatus);
StephaneLenclud@31
   300
StephaneLenclud@31
   301
sl@1
   302
#endif
sl@1
   303