add display driver for HCMS* SPI displays

This commit is contained in:
Thomas Doerfler
2008-07-11 10:03:19 +00:00
parent 25a92bc1ed
commit 80a0ae8248
7 changed files with 2928 additions and 0 deletions

View File

@@ -13,6 +13,15 @@ EXTRA_DIST =
noinst_LIBRARIES =
noinst_PROGRAMS =
# display
if LIBCHIP
include_libchip_HEADERS += display/disp_hcms29xx.h
noinst_LIBRARIES += libdisplay.a
libdisplay_a_SOURCES = display/disp_hcms29xx.c display/font_hcms29xx.c
libdisplay_a_CPPFLAGS = $(AM_CPPFLAGS)
endif
# flash
if LIBCHIP
include_libchip_HEADERS += flash/am29lv160.h

View File

@@ -0,0 +1,37 @@
/* $Id$ */
#ifndef DISP_FONTS_H
#define DISP_FONTS_H
#include <rtems.h>
typedef int8_t disp_font_dimen;
struct disp_font_bounding_box
{
disp_font_dimen w, h, x, y;
};
struct disp_font_glyph
{
struct disp_font_bounding_box bb;
disp_font_dimen wx, wy;
const unsigned char *bitmap;
};
struct disp_font_base
{
int8_t trans;
struct disp_font_bounding_box fbb;
disp_font_dimen ascent, descent;
uint8_t default_char;
struct disp_font_glyph *latin1[256];
};
typedef struct disp_font_base *disp_font_t;
/* Prototypes ------------------------------------------------- */
/* End -------------------------------------------------------- */
#endif /* not defined DISP_FONTS_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,69 @@
/*===============================================================*\
| Project: display driver for HCMS29xx |
+-----------------------------------------------------------------+
| File: disp_hcms29xx.h |
+-----------------------------------------------------------------+
| Copyright (c) 2008 |
| Embedded Brains GmbH |
| Obere Lagerstr. 30 |
| D-82178 Puchheim |
| Germany |
| rtems@embedded-brains.de |
+-----------------------------------------------------------------+
| The license and distribution terms for this file may be |
| found in the file LICENSE in this distribution or at |
| |
| http://www.rtems.com/license/LICENSE. |
| |
+-----------------------------------------------------------------+
| this file declares the SPI based driver for a HCMS29xx 4 digit |
| alphanumeric LED display |
+-----------------------------------------------------------------+
| $Id$
\*===============================================================*/
#ifndef _DISP_HCMS29XX_H
#define _DISP_HCMS29XX_H
#include <rtems.h>
#include <time.h>
#ifdef __cplusplus
extern "C" {
#endif
#define DISP_HCMS29XX_TEXT_CNT (128)
typedef struct {
rtems_device_major_number minor; /* minor device number */
/*
* in the disp_buffer, the string to be displayed is placed
*/
char disp_buffer[DISP_HCMS29XX_TEXT_CNT];
int disp_buf_cnt; /* number of valid chars in disp_buffer */
/*
* in the trns buffer the string is transfered to display task
*/
char trns_buffer[DISP_HCMS29XX_TEXT_CNT];
/*
* in the dev_buffer, characters will be accumulated before display...
*/
char dev_buffer[DISP_HCMS29XX_TEXT_CNT];
int dev_buf_cnt; /* number of valid chars in dev_buffer */
rtems_id trns_sema_id; /* ID of disp trns buffer sema */
rtems_id task_id; /* ID of disp task */
rtems_boolean rotate; /* FLAG: display is upside down */
} spi_disp_hcms29xx_param_t;
typedef struct {
rtems_libi2c_drv_t libi2c_drv_entry;
spi_disp_hcms29xx_param_t disp_param;
} disp_hcms29xx_drv_t;
/*
* pass this descriptor pointer to rtems_libi2c_register_drv
*/
extern rtems_libi2c_drv_t *disp_hcms29xx__driver_descriptor;
#ifdef __cplusplus
}
#endif
#endif /* _DISP_HCMS29XX_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,42 @@
/*===============================================================*\
| Project: display driver for HCMS29xx |
+-----------------------------------------------------------------+
| File: font_hcms29xx.h |
+-----------------------------------------------------------------+
| Copyright (c) 2008 |
| Embedded Brains GmbH |
| Obere Lagerstr. 30 |
| D-82178 Puchheim |
| Germany |
| rtems@embedded-brains.de |
+-----------------------------------------------------------------+
| The license and distribution terms for this file may be |
| found in the file LICENSE in this distribution or at |
| |
| http://www.rtems.com/license/LICENSE. |
| |
+-----------------------------------------------------------------+
| This file declares the 5x7 bit font used in disp_hcms29xx |
+-----------------------------------------------------------------+
| $Id$
\*===============================================================*/
#ifndef FONT_HCMS29XX_H
#define FONT_HCMS29XX_H
#include "disp_fonts.h"
#ifdef __cplusplus
extern "C" {
#endif
extern disp_font_t font_hcms29xx;
extern const struct disp_font_base font_hcms29xx_base;
#ifdef __cplusplus
}
#endif
#endif /* not defined FONT_HCMS29XX_H */

View File

@@ -35,6 +35,11 @@ $(PROJECT_INCLUDE)/libchip/$(dirstamp):
PREINSTALL_DIRS += $(PROJECT_INCLUDE)/libchip/$(dirstamp)
endif
if LIBCHIP
$(PROJECT_INCLUDE)/libchip/disp_hcms29xx.h: display/disp_hcms29xx.h $(PROJECT_INCLUDE)/libchip/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libchip/disp_hcms29xx.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/libchip/disp_hcms29xx.h
endif
if LIBCHIP
$(PROJECT_INCLUDE)/libchip/am29lv160.h: flash/am29lv160.h $(PROJECT_INCLUDE)/libchip/$(dirstamp)
$(INSTALL_DATA) $< $(PROJECT_INCLUDE)/libchip/am29lv160.h
PREINSTALL_FILES += $(PROJECT_INCLUDE)/libchip/am29lv160.h