ipsdisplay  2.1.0.0
Modules | Functions
IPS Display Click Driver

API for configuring and manipulating IPS Display Click driver. More...

Modules

 IPS Display Commands List
 List of commands of IPS Display Click driver.
 
 IPS Display Registers Settings
 Settings for registers of IPS Display Click driver.
 
 IPS Display MikroBUS Map
 MikroBUS pin mapping of IPS Display Click driver.
 
 Ipsdisplay_cmd
 

Functions

void ipsdisplay_cfg_setup (ipsdisplay_cfg_t *cfg)
 IPS Display configuration object setup function. More...
 
err_t ipsdisplay_init (ipsdisplay_t *ctx, ipsdisplay_cfg_t *cfg)
 IPS Display initialization function. More...
 
err_t ipsdisplay_default_cfg (ipsdisplay_t *ctx)
 IPS Display default configuration function. More...
 
err_t ipsdisplay_write_cmd (ipsdisplay_t *ctx, uint8_t cmd)
 IPS Display write cmd function. More...
 
err_t ipsdisplay_write_cmd_par (ipsdisplay_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 IPS Display write cmd par function. More...
 
err_t ipsdisplay_write_data (ipsdisplay_t *ctx, uint16_t *data_in, uint16_t len)
 IPS Display write data function. More...
 
void ipsdisplay_disable_device (ipsdisplay_t *ctx)
 IPS Display disable device function. More...
 
void ipsdisplay_enable_device (ipsdisplay_t *ctx)
 IPS Display enable device function. More...
 
void ipsdisplay_reset_device (ipsdisplay_t *ctx)
 IPS Display reset device function. More...
 
void ipsdisplay_enter_cmd_mode (ipsdisplay_t *ctx)
 IPS Display enter cmd mode function. More...
 
void ipsdisplay_enter_data_mode (ipsdisplay_t *ctx)
 IPS Display enter data mode function. More...
 
err_t ipsdisplay_set_rotation (ipsdisplay_t *ctx, uint8_t rotation)
 IPS Display set rotation function. More...
 
err_t ipsdisplay_set_pos (ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, ipsdisplay_point_t end_pt)
 IPS Display set pos function. More...
 
err_t ipsdisplay_fill_screen (ipsdisplay_t *ctx, uint16_t color)
 IPS Display fill screen function. More...
 
err_t ipsdisplay_write_char (ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, uint8_t data_in, uint16_t color)
 IPS Display write char function. More...
 
err_t ipsdisplay_write_string (ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, uint8_t *data_in, uint16_t color)
 IPS Display write string function. More...
 
err_t ipsdisplay_draw_pixel (ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, uint16_t color)
 IPS Display draw pixel function. More...
 
err_t ipsdisplay_draw_line (ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, ipsdisplay_point_t end_pt, uint16_t color)
 IPS Display draw line function. More...
 
err_t ipsdisplay_draw_rectangle (ipsdisplay_t *ctx, ipsdisplay_point_t start_pt, ipsdisplay_point_t end_pt, uint16_t color)
 IPS Display draw rectangle function. More...
 
err_t ipsdisplay_draw_circle (ipsdisplay_t *ctx, ipsdisplay_point_t center_pt, uint8_t radius, uint16_t color)
 IPS Display draw circle function. More...
 
err_t ipsdisplay_draw_picture (ipsdisplay_t *ctx, uint8_t rotation, const uint16_t *image)
 IPS Display draw picture function. More...
 

Detailed Description

API for configuring and manipulating IPS Display Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ipsdisplay_cfg_setup()

void ipsdisplay_cfg_setup ( ipsdisplay_cfg_t cfg)

IPS Display configuration object setup function.

This function initializes Click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ipsdisplay_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ipsdisplay_default_cfg()

err_t ipsdisplay_default_cfg ( ipsdisplay_t ctx)

IPS Display default configuration function.

This function executes a default configuration of IPS Display Click board.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ipsdisplay_disable_device()

void ipsdisplay_disable_device ( ipsdisplay_t ctx)

IPS Display disable device function.

This function disables the device by setting the RST pin to low logic state.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ipsdisplay_draw_circle()

err_t ipsdisplay_draw_circle ( ipsdisplay_t ctx,
ipsdisplay_point_t  center_pt,
uint8_t  radius,
uint16_t  color 
)

IPS Display draw circle function.

This function draws a circle with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]center_pt: Center point coordinates.
[in]radius: Circle radius.
[in]color: RGB565 color.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
X and Y are swapped in Horizontal display orientation.

◆ ipsdisplay_draw_line()

err_t ipsdisplay_draw_line ( ipsdisplay_t ctx,
ipsdisplay_point_t  start_pt,
ipsdisplay_point_t  end_pt,
uint16_t  color 
)

IPS Display draw line function.

This function draws a line with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]end_pt: End point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]color: RGB565 color.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
X and Y are swapped in Horizontal display orientation.

◆ ipsdisplay_draw_picture()

err_t ipsdisplay_draw_picture ( ipsdisplay_t ctx,
uint8_t  rotation,
const uint16_t *  image 
)

IPS Display draw picture function.

This function draws a picture with a specified color in a desired display orientation.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]rotation:
  • 0 - Vertical 0 - Normal,
  • 1 - Vertical 180 - XY mirrored,
  • 2 - Horizontal 0 - XY exchanged, X mirrored,
  • 3 - Horizontal 180 - XY exchanged, Y mirrored.
[in]image: Image array.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
240x135px pictures draws in a horizontal orientation, 135x240px pictures draws in a vertical orientation.

◆ ipsdisplay_draw_pixel()

err_t ipsdisplay_draw_pixel ( ipsdisplay_t ctx,
ipsdisplay_point_t  start_pt,
uint16_t  color 
)

IPS Display draw pixel function.

This function draws a pixel on the selected position with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]color: RGB565 color.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
X and Y are swapped in Horizontal display orientation.

◆ ipsdisplay_draw_rectangle()

err_t ipsdisplay_draw_rectangle ( ipsdisplay_t ctx,
ipsdisplay_point_t  start_pt,
ipsdisplay_point_t  end_pt,
uint16_t  color 
)

IPS Display draw rectangle function.

This function draws a rectangle with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]end_pt: End point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]color: RGB565 color.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
X and Y are swapped in Horizontal display orientation.

◆ ipsdisplay_enable_device()

void ipsdisplay_enable_device ( ipsdisplay_t ctx)

IPS Display enable device function.

This function enables the device by setting the RST pin to high logic state.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ipsdisplay_enter_cmd_mode()

void ipsdisplay_enter_cmd_mode ( ipsdisplay_t ctx)

IPS Display enter cmd mode function.

This function enters the command mode by setting the DC pin to low logic state.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ipsdisplay_enter_data_mode()

void ipsdisplay_enter_data_mode ( ipsdisplay_t ctx)

IPS Display enter data mode function.

This function enters the data mode by setting the DC pin to high logic state.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ipsdisplay_fill_screen()

err_t ipsdisplay_fill_screen ( ipsdisplay_t ctx,
uint16_t  color 
)

IPS Display fill screen function.

This function fills the screen with the selected color.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]color: RGB565 color.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ipsdisplay_init()

err_t ipsdisplay_init ( ipsdisplay_t ctx,
ipsdisplay_cfg_t cfg 
)

IPS Display initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ipsdisplay_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ipsdisplay_reset_device()

void ipsdisplay_reset_device ( ipsdisplay_t ctx)

IPS Display reset device function.

This function resets the device by toggling the RST pin state.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ipsdisplay_set_pos()

err_t ipsdisplay_set_pos ( ipsdisplay_t ctx,
ipsdisplay_point_t  start_pt,
ipsdisplay_point_t  end_pt 
)

IPS Display set pos function.

This function sets the coordinates of editable display area.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]end_pt: End point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
X and Y are swapped in Horizontal display orientation.

◆ ipsdisplay_set_rotation()

err_t ipsdisplay_set_rotation ( ipsdisplay_t ctx,
uint8_t  rotation 
)

IPS Display set rotation function.

This function sets the display rotation.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]rotation:
  • 0 - Vertical 0 - Normal,
  • 1 - Vertical 180 - XY mirrored,
  • 2 - Horizontal 0 - XY exchanged, X mirrored,
  • 3 - Horizontal 180 - XY exchanged, Y mirrored.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ipsdisplay_write_char()

err_t ipsdisplay_write_char ( ipsdisplay_t ctx,
ipsdisplay_point_t  start_pt,
uint8_t  data_in,
uint16_t  color 
)

IPS Display write char function.

This function writes a single ASCII character on the selected position in a 6x12 font size with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]data_in: ASCII(32-126) char to write.
[in]color: RGB565 color.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ipsdisplay_write_cmd()

err_t ipsdisplay_write_cmd ( ipsdisplay_t ctx,
uint8_t  cmd 
)

IPS Display write cmd function.

This function writes a command byte by using SPI serial interface.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]cmd: Command byte.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ipsdisplay_write_cmd_par()

err_t ipsdisplay_write_cmd_par ( ipsdisplay_t ctx,
uint8_t  cmd,
uint8_t *  data_in,
uint8_t  len 
)

IPS Display write cmd par function.

This function writes a desired number of data parameters to the selected command by using SPI serial interface.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]cmd: Command byte.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ipsdisplay_write_data()

err_t ipsdisplay_write_data ( ipsdisplay_t ctx,
uint16_t *  data_in,
uint16_t  len 
)

IPS Display write data function.

This function writes a desired number of data words by using SPI serial interface.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]data_in: Data to be written (16-bit array).
[in]len: Number of words to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ ipsdisplay_write_string()

err_t ipsdisplay_write_string ( ipsdisplay_t ctx,
ipsdisplay_point_t  start_pt,
uint8_t *  data_in,
uint16_t  color 
)

IPS Display write string function.

This function writes a text string starting from the selected position in a 6x12 font size with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay_point_t object definition for detailed explanation.
[in]data_in: ASCII(32-126) string to write (must end with \0).
[in]color: RGB565 color.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.