Digole Display Driver
Display driver for Digole Serial OLED/LCD displays
digole.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <termios.h>
#include <sys/select.h>
#include <unistd.h>
#include <sys/time.h>
#include <sys/types.h>
#include <errno.h>
#include "digole.h"
int com_fd
void us_delay (unsigned int usecs)
 microsecond delay
void ms_delay (unsigned int usecs)
 millisecond delay
int writen (int fd, unsigned char *ptr, int nbytes)
 write n bytes of data to a file descriptor
void print_com (int fd, unsigned char *buf)
void dd_println (unsigned char *v)
 Print a line of text.
void dd_disable_cursor (void)
 Disable cursor.
void dd_enable_cursor (void)
 Enable cursor.
void dd_draw_str (unsigned char x, unsigned char y, unsigned char *s)
 Draw string.
void dd_set_printpos (unsigned char x, unsigned char y, unsigned char graph)
 Setting Drawing Position.
void dd_clear_screen (void)
 Clear Screen.
void dd_set_lcd_colrow (unsigned char col, unsigned char row)
 Set number of columns and rows for text-mode.
void dd_display_config (unsigned char v)
 Display the display configuration on boot.
void dd_display_startscreen (unsigned char m)
 Display the start screen on power-up/boot.
void dd_set_mode (unsigned char m)
 Set the Display Drawing Mode.
void dd_set_text_pos_back (void)
 Set text position back one character (BS)
void dd_set_text_pos_offset (unsigned char xoffset, unsigned char yoffset)
 Adjust the current text position by specified offset.
void dd_set_text_pos_abs (unsigned char x, unsigned char y)
 Adjust the current text position to absolute offset.
void dd_set_line_pattern (unsigned char pattern)
 Set the line pattern for line drawing operations.
void dd_digital_output (unsigned char x)
 digital port output
void draw_bitmap (unsigned char x, unsigned char y, unsigned char w, unsigned char h, unsigned char *bitmap)
 Draw monochrome bitmap.
void dd_set_rot (unsigned char d)
 Set display rotation.
void dd_set_contrast (unsigned char c)
 set the display contrast
void dd_draw_box (unsigned char x, unsigned char y, unsigned char w, unsigned char h)
 draw a box
void dd_draw_circle (int8_t x, unsigned char y, unsigned char r, unsigned char f)
 draw a circle
void dd_draw_frame (unsigned char x, unsigned char y, unsigned char w, unsigned char h)
 draw a frame (rectangle)
void dd_setpixel (unsigned char x, unsigned char y, unsigned char color)
 set a pixel a specified color
void dd_drawline (unsigned char x, unsigned char y, unsigned char x1, unsigned char y1)
 draw a line
void dd_lineto (unsigned char x, unsigned char y)
 draw a line from the current position to a new position
void dd_hline (unsigned char x, unsigned char y, unsigned char w)
 draw a horizontal line at specified position and width
void dd_vline (unsigned char x, unsigned char y, unsigned char h)
 draw a vertical line at specified position and height
void dd_next_text_line (void)
 move text cursor to new line
void dd_setfont (unsigned char font)
 set the font to be used from preloaded flash locations
void dd_setcolor (unsigned char color)
 set the drawing color
void dd_setbgcolor (unsigned char color)
 set the current color as the background color
void dd_backlight_on (void)
 turn on backlight
void dd_backlight_off (void)
 turn off backlight
void dd_set_screen_on (void)
 turn on screen
void dd_set_screen_off (void)
 turn off screen
void dd_direct_command (unsigned char d)
 send direct command to display
void dd_direct_data (unsigned char d)
 send direct data to display
void dd_move_area (unsigned char x0, unsigned char y0, unsigned char w, unsigned char h, unsigned char xoffset, unsigned char yoffset)
 move screen memory area from one location to another
void dd_upload_start_screen (int len, unsigned char *data)
 download startup screen data to display controller
void dd_upload_user_font (int len, unsigned char *data, unsigned char sect)
 upload font data
void dd_draw_bitmap256 (unsigned char x, unsigned char y, unsigned char w, unsigned char h, unsigned char *bitmap)
 draw a 256-color bitmap
void dd_draw_bitmap262K (unsigned char x, unsigned char y, unsigned char w, unsigned char h, unsigned char *bitmap)
 draw a 262K-color bitmap
void dd_set_truecolor (unsigned char r, unsigned char g, unsigned char b)
 set the drawing color in 24-bit mode
void dd_reset_draw_win (void)
 reset the drawing window to full screen
void dd_clean_win (void)
 clear drawing window
void dd_define_win (unsigned char x, unsigned char y, unsigned char h, unsigned char w)
 define drawing window

Detailed Description

 All Files Functions