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