LibDriver ST7920
Loading...
Searching...
No Matches
st7920 extended driver function

st7920 extended driver modules More...

Collaboration diagram for st7920 extended driver function:

Enumerations

enum  st7920_reverse_line_t { ST7920_REVERSE_LINE_FIRST = 0x00 , ST7920_REVERSE_LINE_SECOND = 0x01 , ST7920_REVERSE_LINE_THIRD = 0x02 , ST7920_REVERSE_LINE_FOURTH = 0x03 }
 st7920 reverse line enumeration definition More...

Functions

uint8_t st7920_write_point (st7920_handle_t *handle, uint8_t x, uint8_t y, uint8_t data)
 write a point
uint8_t st7920_read_point (st7920_handle_t *handle, uint8_t x, uint8_t y, uint8_t *data)
 read a point
uint8_t st7920_fill_rect (st7920_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t color)
 fill a rectangle
uint8_t st7920_draw_picture (st7920_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t *img)
 draw a picture
uint8_t st7920_draw_compress_picture (st7920_handle_t *handle, uint8_t left, uint8_t top, uint8_t right, uint8_t bottom, uint8_t *img)
 draw a compressed picture
uint8_t st7920_set_standby (st7920_handle_t *handle)
 terminate to the standby mode
uint8_t st7920_set_vertical_scroll (st7920_handle_t *handle, st7920_bool_t enable)
 set the vertical scroll
uint8_t st7920_set_reverse_line (st7920_handle_t *handle, st7920_reverse_line_t l)
 set the reverse line
uint8_t st7920_set_extended_function (st7920_handle_t *handle, st7920_interface_bus_bit_t bus_bit, st7920_command_mode_t mode, st7920_bool_t graphic_display_enable)
 set the extended function
uint8_t st7920_set_scroll_address (st7920_handle_t *handle, uint8_t addr)
 set the scroll address
uint8_t st7920_set_graphic_address (st7920_handle_t *handle, uint8_t vertical_addr, uint8_t horizontal_addr)
 set the graphic address

Detailed Description

st7920 extended driver modules

Enumeration Type Documentation

◆ st7920_reverse_line_t

st7920 reverse line enumeration definition

Enumerator
ST7920_REVERSE_LINE_FIRST 

first line normal or reverse

ST7920_REVERSE_LINE_SECOND 

second line normal or reverse

ST7920_REVERSE_LINE_THIRD 

third line normal or reverse

ST7920_REVERSE_LINE_FOURTH 

fourth line normal or reverse

Definition at line 141 of file driver_st7920.h.

Function Documentation

◆ st7920_draw_compress_picture()

uint8_t st7920_draw_compress_picture ( st7920_handle_t * handle,
uint8_t left,
uint8_t top,
uint8_t right,
uint8_t bottom,
uint8_t * img )

draw a compressed picture

Parameters
[in]*handlepointer to an st7920 handle structure
[in]leftleft coordinate x
[in]toptop coordinate y
[in]rightright coordinate x
[in]bottombottom coordinate y
[in]*imgpointer to an image buffer
Returns
status code
  • 0 success
  • 1 fill rect failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
  • 5 left or top is invalid
  • 6 right or bottom is invalid
  • 7 left > right or top > bottom
Note
draw a compressed picture, one bit one pixel

Definition at line 954 of file driver_st7920.c.

◆ st7920_draw_picture()

uint8_t st7920_draw_picture ( st7920_handle_t * handle,
uint8_t left,
uint8_t top,
uint8_t right,
uint8_t bottom,
uint8_t * img )

draw a picture

Parameters
[in]*handlepointer to an st7920 handle structure
[in]leftleft coordinate x
[in]toptop coordinate y
[in]rightright coordinate x
[in]bottombottom coordinate y
[in]*imgpointer to an image buffer
Returns
status code
  • 0 success
  • 1 fill rect failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
  • 5 left or top is invalid
  • 6 right or bottom is invalid
  • 7 left > right or top > bottom
Note
none

Definition at line 805 of file driver_st7920.c.

◆ st7920_fill_rect()

uint8_t st7920_fill_rect ( st7920_handle_t * handle,
uint8_t left,
uint8_t top,
uint8_t right,
uint8_t bottom,
uint8_t color )

fill a rectangle

Parameters
[in]*handlepointer to an st7920 handle structure
[in]leftleft coordinate x
[in]toptop coordinate y
[in]rightright coordinate x
[in]bottombottom coordinate y
[in]colordisplay color
Returns
status code
  • 0 success
  • 1 fill rect failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
  • 5 left or top is invalid
  • 6 right or bottom is invalid
  • 7 left > right or top > bottom
Note
none

Definition at line 657 of file driver_st7920.c.

◆ st7920_read_point()

uint8_t st7920_read_point ( st7920_handle_t * handle,
uint8_t x,
uint8_t y,
uint8_t * data )

read a point

Parameters
[in]*handlepointer to an st7920 handle structure
[in]xcoordinate x
[in]ycoordinate y
[out]*datapointer to a data buffer
Returns
status code
  • 0 success
  • 1 write point failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
  • 5 x is over 127
  • 6 y is over 63
Note
0 <= x <= 127 0 <= y <= 63

Definition at line 498 of file driver_st7920.c.

◆ st7920_set_extended_function()

uint8_t st7920_set_extended_function ( st7920_handle_t * handle,
st7920_interface_bus_bit_t bus_bit,
st7920_command_mode_t mode,
st7920_bool_t graphic_display_enable )

set the extended function

Parameters
[in]*handlepointer to an st7920 handle structure
[in]bus_bitbus bit
[in]modecommand mode
[in]graphic_display_enablebool value
Returns
status code
  • 0 success
  • 1 set extended function failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1698 of file driver_st7920.c.

◆ st7920_set_graphic_address()

uint8_t st7920_set_graphic_address ( st7920_handle_t * handle,
uint8_t vertical_addr,
uint8_t horizontal_addr )

set the graphic address

Parameters
[in]*handlepointer to an st7920 handle structure
[in]vertical_addrvertical address
[in]horizontal_addrhorizontal address
Returns
status code
  • 0 success
  • 1 set graphic address failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
  • 5 vertical_addr is over 0x3F
  • 6 horizontal_addr is over 0xF
Note
0 <= vertical_addr <= 0x3F 0 <= horizontal_addr <= 0xF

Definition at line 1789 of file driver_st7920.c.

◆ st7920_set_reverse_line()

uint8_t st7920_set_reverse_line ( st7920_handle_t * handle,
st7920_reverse_line_t l )

set the reverse line

Parameters
[in]*handlepointer to an st7920 handle structure
[in]lreverse line
Returns
status code
  • 0 success
  • 1 set reverse line failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
Note
none

Definition at line 1656 of file driver_st7920.c.

◆ st7920_set_scroll_address()

uint8_t st7920_set_scroll_address ( st7920_handle_t * handle,
uint8_t addr )

set the scroll address

Parameters
[in]*handlepointer to an st7920 handle structure
[in]addrscroll address
Returns
status code
  • 0 success
  • 1 set scroll address failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
  • 5 addr is over 0x3F
Note
0 <= addr <= 0x3F

Definition at line 1737 of file driver_st7920.c.

◆ st7920_set_standby()

uint8_t st7920_set_standby ( st7920_handle_t * handle)

terminate to the standby mode

Parameters
[in]*handlepointer to an st7920 handle structure
Returns
status code
  • 0 success
  • 1 set standby failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
Note
none

Definition at line 1574 of file driver_st7920.c.

◆ st7920_set_vertical_scroll()

uint8_t st7920_set_vertical_scroll ( st7920_handle_t * handle,
st7920_bool_t enable )

set the vertical scroll

Parameters
[in]*handlepointer to an st7920 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set vertical scroll failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
Note
none

Definition at line 1614 of file driver_st7920.c.

◆ st7920_write_point()

uint8_t st7920_write_point ( st7920_handle_t * handle,
uint8_t x,
uint8_t y,
uint8_t data )

write a point

Parameters
[in]*handlepointer to an st7920 handle structure
[in]xcoordinate x
[in]ycoordinate y
[in]datawritten data
Returns
status code
  • 0 success
  • 1 write point failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 this command must be run in extended command mode
  • 5 x is over 127
  • 6 y is over 63
Note
0 <= x <= 127 0 <= y <= 63

Definition at line 404 of file driver_st7920.c.