HIDLCD
This driver library allows the host to communicate with HID-compliant Auxiliary Display for PC based on Arduino.
Classes | Enumerations | Functions
HIDLCD API

HIDLCD Driver API is an extension of HIDAPI library and build on top of it. More...

Classes

struct  HIDDisplayParams
 The structure holding the physical parameters and other capabilities of the LCD display. More...
 

Enumerations

enum  HID_ADCMD_MODE { HID_ADCMD_MODE_DEFAULT, HID_ADCMD_MODE_OFF, HID_ADCMD_MODE_OVERWRITE }
 Modes of setting the command flags to the LCD display. More...
 

Functions

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...
 

Detailed Description

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.

Enumeration Type Documentation

◆ 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.

Function Documentation

◆ hidlcd_close()

void HID_API_EXPORT HID_API_CALL hidlcd_close ( hid_device *  dev)

Closes the device handle and releases associated resources.

Parameters
devA 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
devA 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_idVendor ID.
product_idProduct ID.
serial_numberSerial 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
devA device handle returned from hid_open().
display_paramsParameters of the display returned by hidlcd_get_display_params().
stringThe 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
devA device handle returned from hid_open().
commandCommand
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
devA device handle returned from hid_open().
commandCommand
modeMode 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
devA device handle returned from hid_open().
rowRow number, starting from 0
colColumn 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
devA device handle returned from hid_open().
flagsA bitmap field specifying the cursor mode (enable/disable/blinking etc)
modeLCD command mode
Returns
Returns positive value if success and -1 if error.