LibDriver ST7920
Loading...
Searching...
No Matches
driver_st7920.h File Reference

driver st7920 header file More...

#include <stdint.h>
#include <stdio.h>
#include <string.h>
Include dependency graph for driver_st7920.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  st7920_handle_s
 st7920 handle structure definition More...
struct  st7920_info_s
 st7920 information structure definition More...

Macros

#define ST7920_COMMAND_CMD_DELAY   100
 st7920 command cmd delay definition
#define ST7920_COMMAND_DATA_DELAY   10
 st7920 command data delay definition
#define DRIVER_ST7920_LINK_INIT(HANDLE, STRUCTURE)
 initialize st7920_handle_t structure
#define DRIVER_ST7920_LINK_CS_GPIO_INIT(HANDLE, FUC)
 link cs_gpio_init function
#define DRIVER_ST7920_LINK_CS_GPIO_DEINIT(HANDLE, FUC)
 link cs_gpio_deinit function
#define DRIVER_ST7920_LINK_CS_GPIO_WRITE(HANDLE, FUC)
 link cs_gpio_write function
#define DRIVER_ST7920_LINK_SCLK_GPIO_INIT(HANDLE, FUC)
 link sclk_gpio_init function
#define DRIVER_ST7920_LINK_SCLK_GPIO_DEINIT(HANDLE, FUC)
 link sclk_gpio_deinit function
#define DRIVER_ST7920_LINK_SCLK_GPIO_WRITE(HANDLE, FUC)
 link sclk_gpio_write function
#define DRIVER_ST7920_LINK_SID_GPIO_INIT(HANDLE, FUC)
 link sid_gpio_init function
#define DRIVER_ST7920_LINK_SID_GPIO_DEINIT(HANDLE, FUC)
 link sid_gpio_deinit function
#define DRIVER_ST7920_LINK_SID_GPIO_WRITE(HANDLE, FUC)
 link sid_gpio_write function
#define DRIVER_ST7920_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function
#define DRIVER_ST7920_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_ST7920_LINK_DELAY_US(HANDLE, FUC)
 link delay_us function

Typedefs

typedef struct st7920_handle_s st7920_handle_t
 st7920 handle structure definition
typedef struct st7920_info_s st7920_info_t
 st7920 information structure definition

Enumerations

enum  st7920_bool_t { ST7920_BOOL_FALSE = 0x00 , ST7920_BOOL_TRUE = 0x01 }
 st7920 bool enumeration definition More...
enum  st7920_address_counter_mode_t { ST7920_ADDRESS_COUNTER_MODE_DECREASE = 0x00 , ST7920_ADDRESS_COUNTER_MODE_INCREASE = 0x01 }
 st7920 address counter mode enumeration definition More...
enum  st7920_display_shift_t { ST7920_DISPLAY_SHIFT_RIGHT = 0x00 , ST7920_DISPLAY_SHIFT_LEFT = 0x01 }
 st7920 display shift enumeration definition More...
enum  st7920_display_shift_mode_t { ST7920_DISPLAY_SHIFT_MODE_LL = 0x00 , ST7920_DISPLAY_SHIFT_MODE_LH = 0x01 , ST7920_DISPLAY_SHIFT_MODE_HL = 0x02 , ST7920_DISPLAY_SHIFT_MODE_HH = 0x03 }
 st7920 display shift mode enumeration definition More...
enum  st7920_interface_bus_bit_t { ST7920_INTERFACE_BUS_BIT_4 = 0x00 , ST7920_INTERFACE_BUS_BIT_8 = 0x01 }
 st7920 interface bus bit enumeration definition More...
enum  st7920_command_mode_t { ST7920_COMMAND_MODE_BASIC = 0x00 , ST7920_COMMAND_MODE_EXTENDED = 0x01 }
 st7920 command mode enumeration definition More...
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_info (st7920_info_t *info)
 get chip's information
uint8_t st7920_init (st7920_handle_t *handle)
 initialize the chip
uint8_t st7920_deinit (st7920_handle_t *handle)
 close the chip
uint8_t st7920_write_string (st7920_handle_t *handle, uint8_t x, uint8_t y, char *str)
 show a string
uint8_t st7920_display_clear (st7920_handle_t *handle)
 clear the display
uint8_t st7920_return_home (st7920_handle_t *handle)
 return the home
uint8_t st7920_set_entry_mode (st7920_handle_t *handle, st7920_display_shift_t shift, st7920_address_counter_mode_t mode)
 set the entry mode
uint8_t st7920_set_display_control (st7920_handle_t *handle, st7920_bool_t display_on, st7920_bool_t cursor_on, st7920_bool_t character_blink_on)
 set the display control
uint8_t st7920_set_display_shift_mode (st7920_handle_t *handle, st7920_display_shift_mode_t mode)
 set the display shift mode
uint8_t st7920_set_function (st7920_handle_t *handle, st7920_interface_bus_bit_t bus_bit, st7920_command_mode_t mode)
 set the function
uint8_t st7920_set_cgram_address (st7920_handle_t *handle, uint8_t addr)
 set the cgram address
uint8_t st7920_set_ddram_address (st7920_handle_t *handle, uint8_t addr)
 set the ddram address
uint8_t st7920_write_ram (st7920_handle_t *handle, uint8_t *data, uint8_t len)
 write the ram
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
uint8_t st7920_write_cmd (st7920_handle_t *handle, uint8_t cmd)
 write command
uint8_t st7920_write_data (st7920_handle_t *handle, uint8_t data)
 write data

Detailed Description

driver st7920 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2022-03-19

history

Date Version Author Description
2022/03/19 1.0 Shifeng Li first upload

Definition in file driver_st7920.h.