Driver for Ortek DIP204B-4ORT01 LCD module (4*20 characters).
Provides functions for initialization, controlling back-light, and writing characters and strings to the display.
Enumerations | |
enum | backlight_options { backlight_IO = 0, backlight_PWM } |
enum | backlight_power { backlight_power_increase = 0, backlight_power_decrease } |
Functions | |
void | dip204_clear_display (void) |
void | dip204_create_char (char ascii_code, const unsigned char data[8]) |
void | dip204_hide_cursor (void) |
void | dip204_init (backlight_options option, bool backlight_on) |
void | dip204_printf_string (const char *format,...) |
void | dip204_read_data (unsigned char *data) |
void | dip204_set_backlight (backlight_power power) |
void | dip204_set_cursor_position (unsigned char column, unsigned char line) |
void | dip204_show_cursor (void) |
void | dip204_write_data (unsigned char data) |
void | dip204_write_string (const char *string) |
enum backlight_options |
enum backlight_power |
void dip204_clear_display | ( | void | ) |
Clear the LCD screen (need void delay_ms(unsigned short time_ms) function to perform active wait)
References delay_ms, dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), and DIP204_WRITE_COMMAND.
void dip204_create_char | ( | char | ascii_code, |
const unsigned char | data[8] | ||
) |
Create a new ASCII character
ascii_code | Input. ascii code of the new character. Must fit in the range [0; 7]. |
data | Input. pixel map of the character. It is composed of 5 columns and 8 lines. |
References DIP204_CGRAM_BASE_ADDR, dip204_read_byte(), DIP204_READ_COMMAND, dip204_select(), dip204_set_cursor_position(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), DIP204_WRITE_COMMAND, and DIP204_WRITE_DATA.
void dip204_hide_cursor | ( | void | ) |
Hide cursor
References dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), and DIP204_WRITE_COMMAND.
Referenced by main().
void dip204_init | ( | backlight_options | option, |
bool | backlight_on | ||
) |
Initialize the LCD (need void delay_ms(unsigned short time_ms) function to perform active wait)
option | backlight_IO if no PWM needed, backlight_PWM if PWM needed... |
backlight_on | Whether to start with backlight on or off. |
References backlight_PWM, channel_id, delay_ms, DIP204_BACKLIGHT_PIN, DIP204_PERIOD_MAX, DIP204_PWM_CHANNEL, DIP204_PWM_FUNCTION, DIP204_PWM_PIN, dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), DIP204_WRITE_COMMAND, pwm_opt_t::diva, pwm_opt_t::divb, gpio_clr_gpio_pin(), gpio_enable_module_pin(), gpio_set_gpio_pin(), pwm_opt_t::prea, pwm_opt_t::preb, pwm_channel, pwm_channel_init(), pwm_duty, pwm_init(), PWM_MODE_LEFT_ALIGNED, PWM_POLARITY_LOW, pwm_start_channels(), and PWM_UPDATE_PERIOD.
Referenced by main().
void dip204_printf_string | ( | const char * | format, |
... | |||
) |
Write a formatted string
format | Input. Formatted null terminated string to display |
References dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), and DIP204_WRITE_DATA.
void dip204_read_data | ( | unsigned char * | data | ) |
Read data at current position
data | Output. data read at current position |
References dip204_read_byte(), DIP204_READ_DATA, dip204_select(), dip204_unselect(), dip204_wait_busy(), and dip204_write_byte().
void dip204_set_backlight | ( | backlight_power | power | ) |
Change the backlight power
power | increase or decrease the backlight... |
References backlight_power_decrease, backlight_power_increase, channel_id, DIP204_BACKLIGHT_PIN, DIP204_PERIOD_MAX, gpio_clr_gpio_pin(), gpio_set_gpio_pin(), Max, Min, pwm_channel, pwm_duty, pwm_sync_update_channel(), and PWM_UPDATE_DUTY.
Referenced by dip204_example_PB_int_handler().
void dip204_set_cursor_position | ( | unsigned char | column, |
unsigned char | line | ||
) |
Set cursor to given position
column | Input. Column where to set cursor (from 1 to 20). |
line | Input. Line where to set cursor (from 1 to 4). |
References dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), and DIP204_WRITE_COMMAND.
Referenced by dip204_create_char(), dip204_example_Joy_int_handler(), dip204_example_PB_int_handler(), and main().
void dip204_show_cursor | ( | void | ) |
Show blinking cursor
References dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), and DIP204_WRITE_COMMAND.
void dip204_write_data | ( | unsigned char | data | ) |
Write a byte at current position
data | Input. data to display |
References dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), and DIP204_WRITE_DATA.
Referenced by dip204_example_Joy_int_handler(), and dip204_example_PB_int_handler().
void dip204_write_string | ( | const char * | string | ) |
Write a string
string | Input. null terminated string to display |
References dip204_select(), dip204_unselect(), dip204_wait_busy(), dip204_write_byte(), and DIP204_WRITE_DATA.
Referenced by dip204_example_Joy_int_handler(), dip204_example_PB_int_handler(), and main().