Secondary display API
API Overview
The calling sequence is open>ctrl_devs/write_picture>close
open
void* customer_display_open(int* pError)
Open the CustomerDisplay 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. |