summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAyushee <ayushee.shah@intel.com>2019-04-05 11:39:51 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-05-02 16:12:40 -0700
commitb7a7ad3ffc436fc074c79b62194c33980e746586 (patch)
tree7332a81c666c66db9f6af9fc4422aae105c5f1b5 /include
parent34366869bbab2e7c27a037b4c7d3c15ee5bf151a (diff)
downloadchrome-ec-b7a7ad3ffc436fc074c79b62194c33980e746586.tar.gz
driver/max695x: Add 7 segment display driver
Port80 information and power sequencing states can be displayed on the 7-segment so that we can observe its information without connecting a debugger. Adding this CL to initialize and write to the 7-segment display. For port80, 80(data) gets displayed on the seven segment, for the power states, EC(state) gets displayed on the seven segment. The MAX6958/MAX6959 is a compact multiplexed common - cathode display designed to interface microprocessors with seven - segment numerical LED digits or to discrete LEDs via a 2-wire serial interface compatible with SMBusTM and I2C. The 2-wire serial interface uses fixed logic thresholds of 0.8V/2.1V when the display driver is powered from a 5V supply for compatibility with 2.5V and 3.3V systems. BRANCH=None BUG=b:130738086 TEST=Manually tested on intelrvp, able to write to the 7 segment display Change-Id: I82ba3aca40640e094463669aa1ff106ce7b99b7b Signed-off-by: Ayushee <ayushee.shah@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1574665 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/config.h4
-rw-r--r--include/display_7seg.h27
2 files changed, 31 insertions, 0 deletions
diff --git a/include/config.h b/include/config.h
index 171938d9cc..30d3416da0 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1120,6 +1120,7 @@
#undef CONFIG_CMD_RTC_ALARM
#define CONFIG_CMD_RW
#undef CONFIG_CMD_SCRATCHPAD
+#undef CONFIG_CMD_SEVEN_SEG_DISPLAY
#define CONFIG_CMD_SHMEM
#undef CONFIG_CMD_SLEEP
#define CONFIG_CMD_SLEEPMASK
@@ -2650,6 +2651,9 @@
*/
#define CONFIG_PORT80_PRINT_IN_INT 0
+/* MAX695x 7 segment driver */
+#undef CONFIG_MAX695X_SEVEN_SEGMENT_DISPLAY
+
/* Compile common code to support power button debouncing */
#undef CONFIG_POWER_BUTTON
diff --git a/include/display_7seg.h b/include/display_7seg.h
new file mode 100644
index 0000000000..9574518cb3
--- /dev/null
+++ b/include/display_7seg.h
@@ -0,0 +1,27 @@
+/* Copyright (c) 2019 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* Seven Segment Display module for Chrome EC */
+
+#ifndef __CROS_EC_DISPLAY_7SEG_H
+#define __CROS_EC_DISPLAY_7SEG_H
+
+enum seven_seg_module_display {
+ SEVEN_SEG_CONSOLE_DISPLAY, /* Console data */
+ SEVEN_SEG_EC_DISPLAY, /* power state */
+ SEVEN_SEG_PORT80_DISPLAY, /* port80 data */
+};
+
+/**
+ * Write register to MAX656x 7-segment display.
+ *
+ * @param module which is writing to the display
+ * @param data to be displayed
+ * @return EC_SUCCESS is write is successful
+ */
+int display_7seg_write(enum seven_seg_module_display module, uint16_t data);
+
+#endif /* __CROS_EC_DISPLAY_7SEG_H */
+