ipsdisplay2 2.1.0.0
Loading...
Searching...
No Matches
IPS Display 2 Click Driver

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

Topics

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

Functions

void ipsdisplay2_cfg_setup (ipsdisplay2_cfg_t *cfg)
 IPS Display 2 configuration object setup function.
 
err_t ipsdisplay2_init (ipsdisplay2_t *ctx, ipsdisplay2_cfg_t *cfg)
 IPS Display 2 initialization function.
 
err_t ipsdisplay2_default_cfg (ipsdisplay2_t *ctx)
 IPS Display 2 default configuration function.
 
err_t ipsdisplay2_write_cmd (ipsdisplay2_t *ctx, uint8_t cmd)
 IPS Display 2 write cmd function.
 
err_t ipsdisplay2_write_cmd_par (ipsdisplay2_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t len)
 IPS Display 2 write cmd par function.
 
err_t ipsdisplay2_write_data (ipsdisplay2_t *ctx, uint16_t *data_in, uint16_t len)
 IPS Display 2 write data function.
 
void ipsdisplay2_disable_device (ipsdisplay2_t *ctx)
 IPS Display 2 disable device function.
 
void ipsdisplay2_enable_device (ipsdisplay2_t *ctx)
 IPS Display 2 enable device function.
 
void ipsdisplay2_reset_device (ipsdisplay2_t *ctx)
 IPS Display 2 reset device function.
 
void ipsdisplay2_disable_backlight (ipsdisplay2_t *ctx)
 IPS Display 2 disable backlight function.
 
void ipsdisplay2_enable_backlight (ipsdisplay2_t *ctx)
 IPS Display 2 enable backlight function.
 
void ipsdisplay2_enter_cmd_mode (ipsdisplay2_t *ctx)
 IPS Display 2 enter cmd mode function.
 
void ipsdisplay2_enter_data_mode (ipsdisplay2_t *ctx)
 IPS Display 2 enter data mode function.
 
err_t ipsdisplay2_set_rotation (ipsdisplay2_t *ctx, uint8_t rotation)
 IPS Display 2 set rotation function.
 
err_t ipsdisplay2_set_pos (ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, ipsdisplay2_point_t end_pt)
 IPS Display 2 set pos function.
 
err_t ipsdisplay2_fill_screen (ipsdisplay2_t *ctx, uint16_t color)
 IPS Display 2 fill screen function.
 
err_t ipsdisplay2_write_char (ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, uint8_t data_in, uint16_t color)
 IPS Display 2 write char function.
 
err_t ipsdisplay2_write_string (ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, uint8_t *data_in, uint16_t color)
 IPS Display 2 write string function.
 
err_t ipsdisplay2_draw_pixel (ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, uint16_t color)
 IPS Display 2 draw pixel function.
 
err_t ipsdisplay2_draw_line (ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, ipsdisplay2_point_t end_pt, uint16_t color)
 IPS Display 2 draw line function.
 
err_t ipsdisplay2_draw_rectangle (ipsdisplay2_t *ctx, ipsdisplay2_point_t start_pt, ipsdisplay2_point_t end_pt, uint16_t color)
 IPS Display 2 draw rectangle function.
 
err_t ipsdisplay2_draw_circle (ipsdisplay2_t *ctx, ipsdisplay2_point_t center_pt, uint8_t radius, uint16_t color)
 IPS Display 2 draw circle function.
 
err_t ipsdisplay2_draw_picture (ipsdisplay2_t *ctx, uint8_t rotation, const uint16_t *image)
 IPS Display 2 draw picture function.
 

Detailed Description

API for configuring and manipulating IPS Display 2 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

◆ ipsdisplay2_cfg_setup()

void ipsdisplay2_cfg_setup ( ipsdisplay2_cfg_t * cfg)

IPS Display 2 configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ ipsdisplay2_default_cfg()

err_t ipsdisplay2_default_cfg ( ipsdisplay2_t * ctx)

IPS Display 2 default configuration function.

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

Parameters
[in]ctx: Click context object. See ipsdisplay2_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.

◆ ipsdisplay2_disable_backlight()

void ipsdisplay2_disable_backlight ( ipsdisplay2_t * ctx)

IPS Display 2 disable backlight function.

This function disables the backlight by setting the BCK pin to low logic state.

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

◆ ipsdisplay2_disable_device()

void ipsdisplay2_disable_device ( ipsdisplay2_t * ctx)

IPS Display 2 disable device function.

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

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

◆ ipsdisplay2_draw_circle()

err_t ipsdisplay2_draw_circle ( ipsdisplay2_t * ctx,
ipsdisplay2_point_t center_pt,
uint8_t radius,
uint16_t color )

IPS Display 2 draw circle function.

This function draws a circle with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay2_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.

◆ ipsdisplay2_draw_line()

err_t ipsdisplay2_draw_line ( ipsdisplay2_t * ctx,
ipsdisplay2_point_t start_pt,
ipsdisplay2_point_t end_pt,
uint16_t color )

IPS Display 2 draw line function.

This function draws a line with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay2_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay2_point_t object definition for detailed explanation.
[in]end_pt: End point coordinates. See #iipsdisplay2_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.

◆ ipsdisplay2_draw_picture()

err_t ipsdisplay2_draw_picture ( ipsdisplay2_t * ctx,
uint8_t rotation,
const uint16_t * image )

IPS Display 2 draw picture function.

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

Parameters
[in]ctx: Click context object. See ipsdisplay2_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
None.

◆ ipsdisplay2_draw_pixel()

err_t ipsdisplay2_draw_pixel ( ipsdisplay2_t * ctx,
ipsdisplay2_point_t start_pt,
uint16_t color )

IPS Display 2 draw pixel function.

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

Parameters
[in]ctx: Click context object. See ipsdisplay2_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay2_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.

◆ ipsdisplay2_draw_rectangle()

err_t ipsdisplay2_draw_rectangle ( ipsdisplay2_t * ctx,
ipsdisplay2_point_t start_pt,
ipsdisplay2_point_t end_pt,
uint16_t color )

IPS Display 2 draw rectangle function.

This function draws a rectangle with a specified color.

Parameters
[in]ctx: Click context object. See ipsdisplay2_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay2_point_t object definition for detailed explanation.
[in]end_pt: End point coordinates. See #iipsdisplay2_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.

◆ ipsdisplay2_enable_backlight()

void ipsdisplay2_enable_backlight ( ipsdisplay2_t * ctx)

IPS Display 2 enable backlight function.

This function enables the backlight by setting the BCK pin to high logic state.

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

◆ ipsdisplay2_enable_device()

void ipsdisplay2_enable_device ( ipsdisplay2_t * ctx)

IPS Display 2 enable device function.

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

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

◆ ipsdisplay2_enter_cmd_mode()

void ipsdisplay2_enter_cmd_mode ( ipsdisplay2_t * ctx)

IPS Display 2 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 ipsdisplay2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ipsdisplay2_enter_data_mode()

void ipsdisplay2_enter_data_mode ( ipsdisplay2_t * ctx)

IPS Display 2 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 ipsdisplay2_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ ipsdisplay2_fill_screen()

err_t ipsdisplay2_fill_screen ( ipsdisplay2_t * ctx,
uint16_t color )

IPS Display 2 fill screen function.

This function fills the screen with the selected color.

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

◆ ipsdisplay2_init()

err_t ipsdisplay2_init ( ipsdisplay2_t * ctx,
ipsdisplay2_cfg_t * cfg )

IPS Display 2 initialization function.

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

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

◆ ipsdisplay2_reset_device()

void ipsdisplay2_reset_device ( ipsdisplay2_t * ctx)

IPS Display 2 reset device function.

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

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

◆ ipsdisplay2_set_pos()

err_t ipsdisplay2_set_pos ( ipsdisplay2_t * ctx,
ipsdisplay2_point_t start_pt,
ipsdisplay2_point_t end_pt )

IPS Display 2 set pos function.

This function sets the coordinates of editable display area.

Parameters
[in]ctx: Click context object. See ipsdisplay2_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay2_point_t object definition for detailed explanation.
[in]end_pt: End point coordinates. See #iipsdisplay2_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.

◆ ipsdisplay2_set_rotation()

err_t ipsdisplay2_set_rotation ( ipsdisplay2_t * ctx,
uint8_t rotation )

IPS Display 2 set rotation function.

This function sets the display rotation.

Parameters
[in]ctx: Click context object. See ipsdisplay2_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.

◆ ipsdisplay2_write_char()

err_t ipsdisplay2_write_char ( ipsdisplay2_t * ctx,
ipsdisplay2_point_t start_pt,
uint8_t data_in,
uint16_t color )

IPS Display 2 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 ipsdisplay2_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay2_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.

◆ ipsdisplay2_write_cmd()

err_t ipsdisplay2_write_cmd ( ipsdisplay2_t * ctx,
uint8_t cmd )

IPS Display 2 write cmd function.

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

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

◆ ipsdisplay2_write_cmd_par()

err_t ipsdisplay2_write_cmd_par ( ipsdisplay2_t * ctx,
uint8_t cmd,
uint8_t * data_in,
uint8_t len )

IPS Display 2 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 ipsdisplay2_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.

◆ ipsdisplay2_write_data()

err_t ipsdisplay2_write_data ( ipsdisplay2_t * ctx,
uint16_t * data_in,
uint16_t len )

IPS Display 2 write data function.

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

Parameters
[in]ctx: Click context object. See ipsdisplay2_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.

◆ ipsdisplay2_write_string()

err_t ipsdisplay2_write_string ( ipsdisplay2_t * ctx,
ipsdisplay2_point_t start_pt,
uint8_t * data_in,
uint16_t color )

IPS Display 2 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 ipsdisplay2_t object definition for detailed explanation.
[in]start_pt: Start point coordinates. See #iipsdisplay2_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.