HIDLCD Driver API is an extension of HIDAPI library and build on top of it.
More...
|
struct | HIDDisplayParams |
| The structure holding the physical parameters and other capabilities of the LCD display. More...
|
|
|
HIDDisplayParams *HID_API_EXPORT HID_API_CALL | hidlcd_get_display_params (hid_device *dev) |
| Returns the physical parameters of the connected auxiliary LCD display. More...
|
|
HID_API_EXPORT hid_device *HID_API_CALL | hidlcd_open (unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number) |
| Returns the device handle. More...
|
|
void HID_API_EXPORT HID_API_CALL | hidlcd_close (hid_device *dev) |
| Closes the device handle and releases associated resources. More...
|
|
int HID_API_EXPORT HID_API_CALL | hidlcd_exit (void) |
| Closes the HIDLCD library and releases associated resources. More...
|
|
int HID_API_EXPORT HID_API_CALL | hidlcd_init (void) |
| Initialize the HIDLCD library. More...
|
|
int HID_API_EXPORT HID_API_CALL | hidlcd_set_cursor (hid_device *dev, u_int8_t row, u_int8_t col) |
| This function sets the cursor of the LCD display in the specified position. More...
|
|
int HID_API_EXPORT HID_API_CALL | hidlcd_set_cursor_flags_ext (hid_device *dev, u_int8_t flags, HID_ADCMD_MODE mode) |
| This function sets the cursor extended parameters and display mode. More...
|
|
int HID_API_EXPORT HID_API_CALL | hidlcd_print (hid_device *dev, HIDDisplayParams *display_params, const char *string) |
| Prints the text on the LCD screen. More...
|
|
int HID_API_EXPORT HID_API_CALL | hidlcd_send_command_ext (hid_device *dev, u_int8_t command, HID_ADCMD_MODE mode) |
| Sends the command to the LCD display with mode. More...
|
|
int HID_API_EXPORT HID_API_CALL | hidlcd_send_command (hid_device *dev, u_int8_t command) |
| Sends the command to the LCD display. More...
|
|
HIDLCD Driver API is an extension of HIDAPI library and build on top of it.
The purpose of the API is to create higher level of abstraction on top of HIDAPI, which only provide raw API calls.
◆ HID_ADCMD_MODE
Modes of setting the command flags to the LCD display.
Enumerator |
---|
HID_ADCMD_MODE_DEFAULT | Command flags are added to the existing state of screen.
|
HID_ADCMD_MODE_OFF | Clear the command/state.
|
HID_ADCMD_MODE_OVERWRITE | Ovewrite the state of the screen.
|
◆ hidlcd_close()
void HID_API_EXPORT HID_API_CALL hidlcd_close |
( |
hid_device * |
dev | ) |
|
Closes the device handle and releases associated resources.
- Parameters
-
dev | A device handle returned from hid_open(). |
◆ hidlcd_exit()
int HID_API_EXPORT HID_API_CALL hidlcd_exit |
( |
void |
| ) |
|
Closes the HIDLCD library and releases associated resources.
- Returns
◆ hidlcd_get_display_params()
HIDDisplayParams* HID_API_EXPORT HID_API_CALL hidlcd_get_display_params |
( |
hid_device * |
dev | ) |
|
Returns the physical parameters of the connected auxiliary LCD display.
- Parameters
-
dev | A device handle returned from hid_open(). |
- Returns
- the pointer to HIDDisplayParams structure with the parameters of the display.
◆ hidlcd_init()
int HID_API_EXPORT HID_API_CALL hidlcd_init |
( |
void |
| ) |
|
Initialize the HIDLCD library.
- Returns
- This function returns 0 on success and -1 on error.
◆ hidlcd_open()
HID_API_EXPORT hid_device* HID_API_CALL hidlcd_open |
( |
unsigned short |
vendor_id, |
|
|
unsigned short |
product_id, |
|
|
const wchar_t * |
serial_number |
|
) |
| |
Returns the device handle.
- Parameters
-
vendor_id | Vendor ID. |
product_id | Product ID. |
serial_number | Serial number of the device if multiple LCD with the same VID/PID are connected |
- Returns
- LCD device handle.
◆ hidlcd_print()
int HID_API_EXPORT HID_API_CALL hidlcd_print |
( |
hid_device * |
dev, |
|
|
HIDDisplayParams * |
display_params, |
|
|
const char * |
string |
|
) |
| |
Prints the text on the LCD screen.
- Parameters
-
dev | A device handle returned from hid_open(). |
display_params | Parameters of the display returned by hidlcd_get_display_params(). |
string | The string to display |
- Returns
- Returns positive value if success and -1 if error.
◆ hidlcd_send_command()
int HID_API_EXPORT HID_API_CALL hidlcd_send_command |
( |
hid_device * |
dev, |
|
|
u_int8_t |
command |
|
) |
| |
Sends the command to the LCD display.
- Parameters
-
dev | A device handle returned from hid_open(). |
command | Command |
- Returns
- Returns positive value if success and -1 if error.
◆ hidlcd_send_command_ext()
int HID_API_EXPORT HID_API_CALL hidlcd_send_command_ext |
( |
hid_device * |
dev, |
|
|
u_int8_t |
command, |
|
|
HID_ADCMD_MODE |
mode |
|
) |
| |
Sends the command to the LCD display with mode.
- Parameters
-
dev | A device handle returned from hid_open(). |
command | Command |
mode | Mode of command |
- Returns
- Returns positive value if success and -1 if error.
◆ hidlcd_set_cursor()
int HID_API_EXPORT HID_API_CALL hidlcd_set_cursor |
( |
hid_device * |
dev, |
|
|
u_int8_t |
row, |
|
|
u_int8_t |
col |
|
) |
| |
This function sets the cursor of the LCD display in the specified position.
- Parameters
-
dev | A device handle returned from hid_open(). |
row | Row number, starting from 0 |
col | Column number starting from 0 |
- Returns
- Returns positive value if success and -1 if error.
◆ hidlcd_set_cursor_flags_ext()
int HID_API_EXPORT HID_API_CALL hidlcd_set_cursor_flags_ext |
( |
hid_device * |
dev, |
|
|
u_int8_t |
flags, |
|
|
HID_ADCMD_MODE |
mode |
|
) |
| |
This function sets the cursor extended parameters and display mode.
- Parameters
-
dev | A device handle returned from hid_open(). |
flags | A bitmap field specifying the cursor mode (enable/disable/blinking etc) |
mode | LCD command mode |
- Returns
- Returns positive value if success and -1 if error.