#include <stdarg.h>
#include <stdio.h>
#include "board.h"
#include "conf_dip204.h"
#include "dip204.h"
#include "gpio.h"
#include "compiler.h"
#include "spi.h"
#include "pwm.h"
#include "delay.h"
Macros | |
#define | DIP204_CGRAM_BASE_ADDR 0x40 |
#define | DIP204_PERIOD_MAX 50 |
#define | DIP204_READ_COMMAND 0xFC |
#define | DIP204_READ_DATA 0xFE |
#define | DIP204_WRITE_COMMAND 0xF8 |
#define | DIP204_WRITE_DATA 0xFA |
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,...) |
static void | dip204_read_byte (unsigned char *byte) |
hardware abstraction layer to read a byte from LCD depends if LCD is plugged on SPI or on EBI More... | |
void | dip204_read_data (unsigned char *data) |
static void | dip204_select (void) |
function to select the LCD More... | |
void | dip204_set_backlight (backlight_power power) |
void | dip204_set_cursor_position (unsigned char column, unsigned char line) |
void | dip204_show_cursor (void) |
static void | dip204_unselect (void) |
function to unselect the LCD More... | |
static void | dip204_wait_busy (void) |
function to wait for LCD becomes not busy More... | |
static void | dip204_write_byte (unsigned char byte) |
hardware abstraction layer to send a byte to LCD depends if LCD is plugged on SPI or on EBI More... | |
void | dip204_write_data (unsigned char data) |
void | dip204_write_string (const char *string) |
Variables | |
static int | channel_id = -1 |
static avr32_pwm_channel_t | pwm_channel |
static unsigned short | pwm_duty |
#define DIP204_CGRAM_BASE_ADDR 0x40 |
Referenced by dip204_create_char().
#define DIP204_PERIOD_MAX 50 |
Referenced by dip204_init(), and dip204_set_backlight().
#define DIP204_READ_COMMAND 0xFC |
Read Command start byte, for Busy-flag checking
Referenced by dip204_create_char(), dip204_wait_busy(), and dip204_write_byte().
#define DIP204_READ_DATA 0xFE |
Read Data from DDRAM
Referenced by dip204_read_data(), and dip204_write_byte().
#define DIP204_WRITE_COMMAND 0xF8 |
Write Command start byte
Referenced by dip204_clear_display(), dip204_create_char(), dip204_hide_cursor(), dip204_init(), dip204_set_cursor_position(), dip204_show_cursor(), and dip204_write_byte().
#define DIP204_WRITE_DATA 0xFA |
Write Data start byte
Referenced by dip204_create_char(), dip204_printf_string(), dip204_write_byte(), dip204_write_data(), and dip204_write_string().
|
static |
hardware abstraction layer to read a byte from LCD depends if LCD is plugged on SPI or on EBI
byte | Input. byte read from the LCD (D7 .. D0) |
References Assert, bit_reverse8, DIP204_SPI, SPI_OK, spi_read(), and spi_write().
Referenced by dip204_create_char(), dip204_read_data(), and dip204_wait_busy().
function to select the LCD
References DIP204_SPI, DIP204_SPI_NPCS, and spi_selectChip().
Referenced by dip204_clear_display(), dip204_create_char(), dip204_hide_cursor(), dip204_init(), dip204_printf_string(), dip204_read_data(), dip204_set_cursor_position(), dip204_show_cursor(), dip204_write_data(), and dip204_write_string().
function to unselect the LCD
References Assert, DIP204_SPI, DIP204_SPI_NPCS, SPI_OK, and spi_unselectChip().
Referenced by dip204_clear_display(), dip204_create_char(), dip204_hide_cursor(), dip204_init(), dip204_printf_string(), dip204_read_data(), dip204_set_cursor_position(), dip204_show_cursor(), dip204_write_data(), and dip204_write_string().
function to wait for LCD becomes not busy
References dip204_read_byte(), DIP204_READ_COMMAND, and dip204_write_byte().
Referenced by dip204_clear_display(), dip204_create_char(), dip204_hide_cursor(), dip204_init(), dip204_printf_string(), dip204_read_data(), dip204_set_cursor_position(), dip204_show_cursor(), dip204_write_data(), and dip204_write_string().
|
static |
hardware abstraction layer to send a byte to LCD depends if LCD is plugged on SPI or on EBI
byte | Input. byte to write to the LCD (D7 .. D0) |
References Assert, bit_reverse8, DIP204_READ_COMMAND, DIP204_READ_DATA, DIP204_SPI, DIP204_WRITE_COMMAND, DIP204_WRITE_DATA, SPI_OK, and spi_write().
Referenced by dip204_clear_display(), dip204_create_char(), dip204_hide_cursor(), dip204_init(), dip204_printf_string(), dip204_read_data(), dip204_set_cursor_position(), dip204_show_cursor(), dip204_wait_busy(), dip204_write_data(), and dip204_write_string().
|
static |
The channel number
Referenced by dip204_init(), dip204_set_backlight(), pwm_async_update_channel(), pwm_channel_init(), and pwm_sync_update_channel().
|
static |
the PWM channel config
Referenced by dip204_init(), and dip204_set_backlight().
|
static |
the duty cycle that will be updated to change backlight power
Referenced by dip204_init(), and dip204_set_backlight().