Secondary display API: Difference between revisions
No edit summary |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
== | == API Overview == | ||
The calling sequence is [[#open|open]]>[[#ctrl_devs|ctrl_devs]]/[[#write_picture|write_picture]]>[[#close|close ]] | The calling sequence is [[#open|open]]>[[#ctrl_devs|ctrl_devs]]/[[#write_picture|write_picture]]>[[#close|close ]] | ||
=== open === | === <big>open</big> === | ||
void* customer_display_open(int* pError) | <syntaxhighlight lang="c">void* customer_display_open(int* pError)</syntaxhighlight > | ||
Open the | Open the Customer Display device. | ||
This operation should be used before other operations. | This operation should be used before other operations. | ||
{|class="wizarpostable" | |||
|- | |||
! scope="row" colspan="2" | Parameters | |||
|- | |- | ||
| ' | | pErrorCode || '''int*:''' if out is null, can not open, else, the out is the handler | ||
|} | |} | ||
=== close === | |||
int customer_display_close(int nHandle) | === <big>close</big> === | ||
<syntaxhighlight lang="c">int customer_display_close(int nHandle)</syntaxhighlight > | |||
Close the CustomerDisplay device opened before. | Close the CustomerDisplay device opened before. | ||
The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device. | The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device. | ||
''' | {|class="wizarpostable" | ||
|- | |||
! scope="row" colspan="2" | Parameters | |||
|- | |||
| nHandle || '''int:''' Handle of this device, returned from open | |||
|} | |||
{| | {| | ||
|- | |- | ||
| | | | ||
|} | |||
{|class="wizarpostable" | |||
|- | |||
! scope="row" colspan="2" | Returns | |||
|- | |||
| int || The result code, >= 0, success; <0 [[Error_code|error code]]. | |||
|} | |} | ||
=== <big>ctrl_devs</big>=== | |||
=== ctrl_devs=== | <syntaxhighlight lang="c">int customer_display_ctrl_devs(int nHandle, int nCmd, int nValue)</syntaxhighlight > | ||
int customer_display_ctrl_devs(int nHandle, int nCmd, int nValue) | |||
Use the function of the CustomerDisplay, such as set background, display default screen, open or close led, buzzer beep and so on. | Use the function of the CustomerDisplay, such as set background, display default screen, open or close led, buzzer beep and so on. | ||
{|class="wizarpostable" | |||
|- | |||
! scope="row" colspan="2" | Parameters | |||
|- | |- | ||
| '' | | nHandle || '''int:''' Handle of this device, returned from open | ||
|- | |- | ||
| '' | | nCmd || '''int:''' Control command | ||
|- | |- | ||
| '' | | nValue || '''int:''' Value of control command | ||
|} | |} | ||
find nCmd and nValue from the follow table: | |||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 52: | Line 64: | ||
| 0x07:buzzer.|| 0 | | 0x07:buzzer.|| 0 | ||
|} | |} | ||
{|class="wizarpostable" | |||
|- | |||
! scope="row" colspan="2" | Returns | |||
|- | |||
| int || The result code, >= 0, success; <0 [[Error_code|error code]]. | |||
|} | |||
=== <big>write_picture</big>=== | |||
<syntaxhighlight lang="c">int customer_display_write_picture_data(int nHandle, unsigned int nXcoordinate, unsigned int nYcoordinate,unsigned int nWidth, unsigned int nHeight ,unsigned char* pData, unsigned int nDataLength)</syntaxhighlight > | |||
=== write_picture=== | |||
int customer_display_write_picture_data(int nHandle, unsigned int nXcoordinate, unsigned int nYcoordinate,unsigned int nWidth, unsigned int nHeight ,unsigned char* pData, unsigned int nDataLength) | |||
Write picture point data(one point to 4 bytes in ARGB8888). | Write picture point data(one point to 4 bytes in ARGB8888). | ||
You need firstly convert a Bitmap to point data. | You need firstly convert a Bitmap to point data. | ||
{|class="wizarpostable" | |||
|- | |||
''' | ! scope="row" colspan="2" | Parameters | ||
|- | |||
| nHandle || '''int:''' Handle of this device, returned from open | |||
|- | |||
| nXcoordinate || '''unsigned int:''' X cordinate | |||
|- | |||
| nYcoordinate || '''unsigned int:''' Y cordinate | |||
|- | |- | ||
| '' | | nWidth || '''unsigned int:''' width | ||
|- | |- | ||
| '' | | nHeight || '''unsigned int:''' Height | ||
|- | |- | ||
| '' | | pData || '''unsigned char*:''' All point data | ||
|- | |- | ||
| '' | | nDataLength || '''unsigned int:''' Point data length | ||
|} | |||
{| | |||
|- | |- | ||
| | | | ||
|} | |||
{|class="wizarpostable" | |||
|- | |- | ||
| | ! scope="row" colspan="2" | Returns | ||
|- | |- | ||
| | | int || The result code, >= 0, success; <0 [[Error_code|error code]]. | ||
|} | |} | ||
Latest revision as of 09:41, 11 March 2019
API Overview
The calling sequence is open>ctrl_devs/write_picture>close
open
void* customer_display_open(int* pError)
Open the Customer Display device. This operation should be used before other operations.
Parameters | |
---|---|
pErrorCode | int*: if out is null, can not open, else, the out is the handler |
close
int customer_display_close(int nHandle)
Close the CustomerDisplay device opened before. The open and close apis are pair operations. If you don’t want to use this device, you should call the close api to release this device.
Parameters | |
---|---|
nHandle | int: Handle of this device, returned from open |
Returns | |
---|---|
int | The result code, >= 0, success; <0 error code. |
ctrl_devs
int customer_display_ctrl_devs(int nHandle, int nCmd, int nValue)
Use the function of the CustomerDisplay, such as set background, display default screen, open or close led, buzzer beep and so on.
Parameters | |
---|---|
nHandle | int: Handle of this device, returned from open |
nCmd | int: Control command |
nValue | int: Value of control command |
find nCmd and nValue from the follow table:
nCmd | nValue |
---|---|
0x04:set background. | RED :0x001F;BLACK:0X0000;YELLOW:0X07FF;BLUE:0XF800;GRAY0:0XCE9A. |
0x05:display default screen. | 0 |
0x06:led. | 1:open led; 0:close led. |
0x07:buzzer. | 0 |
Returns | |
---|---|
int | The result code, >= 0, success; <0 error code. |
write_picture
int customer_display_write_picture_data(int nHandle, unsigned int nXcoordinate, unsigned int nYcoordinate,unsigned int nWidth, unsigned int nHeight ,unsigned char* pData, unsigned int nDataLength)
Write picture point data(one point to 4 bytes in ARGB8888). You need firstly convert a Bitmap to point data.
Parameters | |
---|---|
nHandle | int: Handle of this device, returned from open |
nXcoordinate | unsigned int: X cordinate |
nYcoordinate | unsigned int: Y cordinate |
nWidth | unsigned int: width |
nHeight | unsigned int: Height |
pData | unsigned char*: All point data |
nDataLength | unsigned int: Point data length |
Returns | |
---|---|
int | The result code, >= 0, success; <0 error code. |