-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
74 changed files
with
6,857 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
obj-$(CONFIG_OPENVFD) := openvfd.o | ||
openvfd-objs += protocols/i2c_sw.o | ||
openvfd-objs += protocols/i2c_hw.o | ||
openvfd-objs += protocols/spi_sw.o | ||
openvfd-objs += controllers/dummy.o | ||
openvfd-objs += controllers/seg7_ctrl.o | ||
openvfd-objs += controllers/fd628.o | ||
openvfd-objs += controllers/fd650.o | ||
openvfd-objs += controllers/hd44780.o | ||
openvfd-objs += controllers/gfx_mono_ctrl.o | ||
openvfd-objs += controllers/ssd1306.o | ||
openvfd-objs += controllers/pcd8544.o | ||
openvfd-objs += controllers/il3829.o | ||
openvfd-objs += openvfd_drv.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#ifndef __CONTROLLERH__ | ||
#define __CONTROLLERH__ | ||
|
||
#include "../openvfd_drv.h" | ||
|
||
struct controller_interface { | ||
unsigned char (*init)(void); | ||
|
||
unsigned short (*get_brightness_levels_count)(void); | ||
unsigned short (*get_brightness_level)(void); | ||
unsigned char (*set_brightness_level)(unsigned short level); | ||
|
||
unsigned char (*get_power)(void); | ||
void (*set_power)(unsigned char state); | ||
void (*power_suspend)(void); | ||
void (*power_resume)(void); | ||
|
||
struct vfd_display *(*get_display_type)(void); | ||
unsigned char (*set_display_type)(struct vfd_display *display); | ||
|
||
void (*set_icon)(const char *name, unsigned char state); | ||
|
||
size_t (*read_data)(unsigned char *data, size_t length); | ||
size_t (*write_data)(const unsigned char *data, size_t length); | ||
size_t (*write_display_data)(const struct vfd_display_data *data); | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef __CONTROLLER_LIST_H__ | ||
#define __CONTROLLER_LIST_H__ | ||
|
||
#include "dummy.h" | ||
#include "fd628.h" | ||
#include "fd650.h" | ||
#include "hd44780.h" | ||
#include "ssd1306.h" | ||
#include "pcd8544.h" | ||
#include "il3829.h" | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#include "dummy.h" | ||
|
||
static unsigned char dummy_init(void); | ||
static unsigned short dummy_get_brightness_levels_count(void); | ||
static unsigned short dummy_get_brightness_level(void); | ||
static unsigned char dummy_set_brightness_level(unsigned short level); | ||
static unsigned char dummy_get_power(void); | ||
static void dummy_set_power(unsigned char state); | ||
static struct vfd_display *dummy_get_display_type(void); | ||
static unsigned char dummy_set_display_type(struct vfd_display *display); | ||
static void dummy_set_icon(const char *name, unsigned char state); | ||
static size_t dummy_read_data(unsigned char *data, size_t length); | ||
static size_t dummy_write_data(const unsigned char *data, size_t length); | ||
static size_t dummy_write_display_data(const struct vfd_display_data *data); | ||
|
||
static struct controller_interface dummy_interface = { | ||
.init = dummy_init, | ||
.get_brightness_levels_count = dummy_get_brightness_levels_count, | ||
.get_brightness_level = dummy_get_brightness_level, | ||
.set_brightness_level = dummy_set_brightness_level, | ||
.get_power = dummy_get_power, | ||
.set_power = dummy_set_power, | ||
.get_display_type = dummy_get_display_type, | ||
.set_display_type = dummy_set_display_type, | ||
.set_icon = dummy_set_icon, | ||
.read_data = dummy_read_data, | ||
.write_data = dummy_write_data, | ||
.write_display_data = dummy_write_display_data, | ||
}; | ||
|
||
static struct vfd_dev *dev = NULL; | ||
|
||
struct controller_interface *init_dummy(struct vfd_dev *_dev) | ||
{ | ||
dev = _dev; | ||
return &dummy_interface; | ||
} | ||
|
||
static unsigned char dummy_init(void) | ||
{ | ||
return 1; | ||
} | ||
|
||
static unsigned short dummy_get_brightness_levels_count(void) | ||
{ | ||
return 8; | ||
} | ||
|
||
static unsigned short dummy_get_brightness_level(void) | ||
{ | ||
return dev->brightness; | ||
} | ||
|
||
static unsigned char dummy_set_brightness_level(unsigned short level) | ||
{ | ||
dev->brightness = level & 0x7; | ||
dev->power = 1; | ||
return 1; | ||
} | ||
|
||
static unsigned char dummy_get_power(void) | ||
{ | ||
return dev->power; | ||
} | ||
|
||
static void dummy_set_power(unsigned char state) | ||
{ | ||
dev->power = state; | ||
} | ||
|
||
static struct vfd_display *dummy_get_display_type(void) | ||
{ | ||
return &dev->dtb_active.display; | ||
} | ||
|
||
static unsigned char dummy_set_display_type(struct vfd_display *display) | ||
{ | ||
dev->dtb_active.display = *display; | ||
return 1; | ||
} | ||
|
||
static void dummy_set_icon(const char *name, unsigned char state) | ||
{ | ||
} | ||
|
||
static size_t dummy_read_data(unsigned char *data, size_t length) | ||
{ | ||
return 0; | ||
} | ||
|
||
static size_t dummy_write_data(const unsigned char *_data, size_t length) | ||
{ | ||
return length; | ||
} | ||
|
||
static size_t dummy_write_display_data(const struct vfd_display_data *data) | ||
{ | ||
return sizeof(*data); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef __DUMMYH__ | ||
#define __DUMMYH__ | ||
|
||
#include "controller.h" | ||
|
||
struct controller_interface *init_dummy(struct vfd_dev *dev); | ||
|
||
#endif |
Oops, something went wrong.