Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic ssdfb: define SSD1353 command set
details: https://anonhg.NetBSD.org/src/rev/64dbe959de51
branches: trunk
changeset: 1022701:64dbe959de51
user: tnn <tnn%NetBSD.org@localhost>
date: Mon Aug 02 14:00:48 2021 +0000
description:
ssdfb: define SSD1353 command set
also adjust some SSD1322 command names
diffstat:
sys/dev/ic/ssdfb.c | 10 +++---
sys/dev/ic/ssdfbvar.h | 79 ++++++++++++++++++++++++++++++++++++++++++++------
2 files changed, 74 insertions(+), 15 deletions(-)
diffs (157 lines):
diff -r 6db6e3e94f39 -r 64dbe959de51 sys/dev/ic/ssdfb.c
--- a/sys/dev/ic/ssdfb.c Mon Aug 02 12:56:22 2021 +0000
+++ b/sys/dev/ic/ssdfb.c Mon Aug 02 14:00:48 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfb.c,v 1.14 2021/07/30 13:44:09 tnn Exp $ */
+/* $NetBSD: ssdfb.c,v 1.15 2021/08/02 14:00:48 tnn Exp $ */
/*
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.14 2021/07/30 13:44:09 tnn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ssdfb.c,v 1.15 2021/08/02 14:00:48 tnn Exp $");
#include "opt_ddb.h"
@@ -271,7 +271,7 @@
ri->ri_depth = sc->sc_p->p_bits_per_pixel;
#else
ri->ri_depth = 8;
-#endif
+#endif
ri->ri_font = sc->sc_font;
ri->ri_width = sc->sc_p->p_width;
ri->ri_height = sc->sc_p->p_height;
@@ -774,14 +774,14 @@
if (error)
return error;
SSDFB_CMD2(SSD1322_CMD_SET_SECOND_PRECHARGE_PERIOD,
- SSD1322_DEFAULT_SECOND_PRECHARGE);
+ SSD1322_DEFAULT_SECOND_PRECHARGE_PERIOD);
if (error)
return error;
/*
* Configure physical display panel layout.
*/
- SSDFB_CMD2(SSD1322_CMD_SET_MUX_RATIO, sc->sc_p->p_multiplex_ratio);
+ SSDFB_CMD2(SSD1322_CMD_SET_MULTIPLEX_RATIO, sc->sc_p->p_multiplex_ratio);
if (error)
return error;
if (sc->sc_upsidedown)
diff -r 6db6e3e94f39 -r 64dbe959de51 sys/dev/ic/ssdfbvar.h
--- a/sys/dev/ic/ssdfbvar.h Mon Aug 02 12:56:22 2021 +0000
+++ b/sys/dev/ic/ssdfbvar.h Mon Aug 02 14:00:48 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ssdfbvar.h,v 1.6 2021/07/30 13:44:09 tnn Exp $ */
+/* $NetBSD: ssdfbvar.h,v 1.7 2021/08/02 14:00:48 tnn Exp $ */
/*
* Copyright (c) 2019 The NetBSD Foundation, Inc.
@@ -154,13 +154,12 @@
#define SSD1322_CMD_SET_DISPLAY_START_LINE 0xa1
#define SSD1322_CMD_SET_DISPLAY_OFFSET 0xa2
-/* These are the same as SSDFB generic commands */
-#define SSD1322_CMD_ENTIRE_DISPLAY_OFF 0xa4
-#define SSD1322_CMD_ENTIRE_DISPLAY_ON 0xa5
-#define SSD1322_CMD_NORMAL_DISPLAY 0xa6
-#define SSD1322_CMD_INVERSE_DISPLAY 0xa7
-#define SSD1322_CMD_SET_SLEEP_MODE_ON 0xae
-#define SSD1322_CMD_SET_SLEEP_MODE_OFF 0xaf
+#define SSD1322_CMD_ENTIRE_DISPLAY_OFF SSDFB_CMD_ENTIRE_DISPLAY_OFF
+#define SSD1322_CMD_ENTIRE_DISPLAY_ON SSDFB_CMD_ENTIRE_DISPLAY_ON
+#define SSD1322_CMD_NORMAL_DISPLAY SSDFB_CMD_SET_NORMAL_DISPLAY
+#define SSD1322_CMD_INVERSE_DISPLAY SSDFB_CMD_SET_INVERSE_DISPLAY
+#define SSD1322_CMD_SET_SLEEP_MODE_ON SSDFB_CMD_SET_DISPLAY_OFF
+#define SSD1322_CMD_SET_SLEEP_MODE_OFF SSDFB_CMD_SET_DISPLAY_ON
#define SSD1322_CMD_ENABLE_PARTIAL_DISPLAY 0xa8
#define SSD1322_CMD_EXIT_PARTIAL_DISPLAY 0xa9
@@ -190,7 +189,7 @@
#define SSD1322_GPIO1_LOW __BIT(3)
#define SSD1322_GPIO1_HIGH __BITS(3, 2)
#define SSD1322_CMD_SET_SECOND_PRECHARGE_PERIOD 0xb6
- #define SSD1322_DEFAULT_SECOND_PRECHARGE 8
+ #define SSD1322_DEFAULT_SECOND_PRECHARGE_PERIOD 8
#define SSD1322_CMD_SET_GRAY_SCALE_TABLE 0xb8
#define SSD1322_CMD_SET_DEFAULT_GRAY_SCALE_TABLE 0xb9
#define SSD1322_CMD_SET_PRE_CHARGE_VOLTAGE_LEVEL 0xbb
@@ -201,13 +200,73 @@
#define SSD1322_DEFAULT_CONTRAST_CURRENT 0x7f
#define SSD1322_CMD_MASTER_CONTRAST_CURRENT_CONTROL 0xc7
#define SSD1322_DEFAULT_MASTER_CONTRAST_CURRENT_CONTROL 0xf
-#define SSD1322_CMD_SET_MUX_RATIO 0xca
+#define SSD1322_CMD_SET_MULTIPLEX_RATIO 0xca
#define SSD1322_CMD_DISPLAY_ENHANCEMENT_B 0xd1
#define SSD1322_DISPLAY_ENHANCEMENT_B_MAGIC1 0xa2
#define SSD1322_DISPLAY_ENHANCEMENT_B_MAGIC2 0x20
#define SSD1322_CMD_SET_COMMAND_LOCK 0xfd
#define SSD1322_COMMAND_UNLOCK_MAGIC 0x12
#define SSD1322_COMMAND_LOCK_MAGIC 0x16
+/* undocumented on this chip, but works in practice */
+#define SSD1322_CMD_NOP SSDFB_CMD_NOP
+
+/*
+ * SSD1353 command set
+ */
+#define SSD1353_CMD_SET_COLUMN_ADDRESS SSD1322_CMD_SET_COLUMN_ADDRESS
+#define SSD1353_CMD_DRAW_LINE 0x21
+#define SSD1353_CMD_DRAW_RECTANGLE 0x22
+#define SSD1353_CMD_COPY 0x23
+#define SSD1353_CMD_DIM 0x24
+#define SSD1353_CMD_CLEAR_WINDOW 0x25
+#define SSD1353_CMD_FILL_ENABLE 0x26
+#define SSD1353_CMD_SCROLLING_SETUP 0x27
+#define SSD1353_CMD_DEACTIVATE_SCROLL SSDFB_CMD_DEACTIVATE_SCROLL
+#define SSD1353_CMD_ACTIVATE_SCROLL SSDFB_CMD_ACTIVATE_SCROLL
+#define SSD1353_CMD_WRITE_RAM SSD1322_CMD_WRITE_RAM
+#define SD1353_CMD_READ_RAM SSD1322_CMD_READ_RAM
+#define SSD1353_CMD_SET_ROW_ADDRESS SSD1322_CMD_SET_ROW_ADDRESS
+#define SSD1353_CMD_SET_CONTRAST_CONTROL_A 0x81
+#define SSD1353_CMD_SET_CONTRAST_CONTROL_B 0x82
+#define SSD1353_CMD_SET_CONTRAST_CONTROL_C 0x83
+ #define SSD1353_DEFAULT_CONTRAST_CONTROL 128
+#define SSD1353_CMD_MASTER_CURRENT_CONTROL 0x87
+ #define SSD1353_DEFAULT_MASTER_CURRENT_ATTENUATION 15
+#define SSD1353_CMD_SET_SECOND_PRECHARGE_SPEED 0x8a
+ #define SSD1353_DEFAULT_SECOND_PRECHARGE_SPEED 2
+#define SSD1353_CMD_REMAP_COLOR_DEPTH 0xa0
+#define SSD1353_CMD_SET_DISPLAY_START_LINE SSD1322_CMD_SET_DISPLAY_START_LINE
+#define SSD1353_CMD_SET_DISPLAY_OFFSET SSD1322_CMD_SET_DISPLAY_OFFSET
+#define SSD1353_CMD_SET_VERTICAL_SCROLL_AREA SSDFB_CMD_SET_VERTICAL_SCROLL_AREA
+#define SSD1353_CMD_NORMAL_DISPLAY 0xa4
+#define SSD1353_CMD_ENTIRE_DISPLAY_ON 0xa5
+#define SSD1353_CMD_ENTIRE_DISPLAY_OFF 0xa6
+#define SSD1353_CMD_INVERSE_DISPLAY SSDFB_CMD_SET_INVERSE_DISPLAY
+#define SSD1353_CMD_SET_MULTIPLEX_RATIO SSDFB_CMD_SET_MULTIPLEX_RATIO
+#define SSD1353_CMD_DIM_MODE_SETTING 0xab
+#define SSD1353_CMD_SET_DISPLAY_ON_DIM 0xac
+#define SSD1353_CMD_SET_DISPLAY_OFF SSDFB_CMD_SET_DISPLAY_OFF
+#define SSD1353_CMD_SET_DISPLAY_ON SSDFB_CMD_SET_DISPLAY_ON
+#define SSD1353_CMD_SET_PHASE_LENGTH SSD1322_CMD_SET_PHASE_LENGTH
+ #define SSD1353_DEFAULT_PHASE_2 7
+ #define SSD1353_DEFAULT_PHASE_1 4
+#define SSD1353_CMD_SET_FRONT_CLOCK_DIVIDER SSD1322_CMD_SET_FRONT_CLOCK_DIVIDER
+ #define SSD1353_DEFAULT_DIVIDER 0
+ #define SSD1353_DEFAULT_FREQUENCY 12
+#define SSD1353_CMD_SET_SECOND_PRECHARGE_PERIOD 0xb4
+ #define SSD1353_DEFAULT_SECOND_PRECHARGE_PERIOD 7
+#define SSD1353_CMD_SET_GRAY_SCALE_TABLE SSD1322_CMD_SET_GRAY_SCALE_TABLE
+#define SSD1353_CMD_SET_DEFAULT_GRAY_SCALE_TABLE SSD1322_CMD_SET_DEFAULT_GRAY_SCALE_TABLE
+#define SSD1353_CMD_SET_PRE_CHARGE_VOLTAGE_LEVEL SSD1322_CMD_SET_PRE_CHARGE_VOLTAGE_LEVEL
+ #define SSD1353_DEFAULT_PRE_CHARGE_VOLTAGE_LEVEL 0x3e
+#define SSD1353_CMD_SET_VCOMH SSD1322_CMD_SET_VCOMH
+ #define SSD1353_DEFAULT_VCOMH 0x3c
+#define SSD1353_CMD_OTP_WRITE 0xc0
+#define SSD1353_CMD_RESET 0xe2
+#define SSD1353_CMD_NOP SSDFB_CMD_NOP
+#define SSD1353_CMD_SET_COMMAND_LOCK SSD1322_CMD_SET_COMMAND_LOCK
+ #define SSD1353_COMMAND_UNLOCK_MAGIC SSD1322_COMMAND_UNLOCK_MAGIC
+ #define SSD1353_COMMAND_LOCK_MAGIC SSD1353_COMMAND_LOCK_MAGIC
struct ssdfb_softc;
Home |
Main Index |
Thread Index |
Old Index