====== 7-Segment Display - Segment Control Mode ======
Each segment of the display can be controlled independently. The segments are **"active-low"**, e.g. the segment is on if a logic "0" is written to it. \\ \\
> {{ctboard:ctboard_mode_1.svg?48px }} {{ctboard:ctboard_mode_2.svg?48px }} {{ctboard:ctboard_mode_3.svg?48px }} {{ctboard:ctboard_mode_4.svg?48px }} Please make sure the CT Board is in the correct mode.
> Supported [[ctboard:mode_switch|modes]]: **1**, **2**, **3**, **4**
\\
===== Registers =====
The registers are read / write.
\\ {{ctboard_7seg_raw_reg.svg}} \\ \\
===== Diagram =====
\\ {{ctboard_7seg_raw.svg?700em}} \\ \\
===== Programming Example =====
The code snippet below shows how to use the 7-segment display in segment control mode.
#include "reg_ctboard.h"
CT_SEG7->RAW.BYTE.DS0 = (uint8_t) data_byte; /* Write byte of segment data to DS0. */
CT_SEG7->RAW.HWORD.DS3_2 = (uint16_t) data_halfword; /* Write half word of segment data to DS3..2. */
CT_SEG7->RAW.WORD = (uint32_t) data_word; /* Write word of segment data to all displays. */
\\
ADDR_SEG7_RAW EQU 0x60000110
LDR r0, =ADDR_SEG7_RAW
STRB r1, [r0, #0] ; Write byte of segment data to DS0.
STRH r1, [r0, #2] ; Write half word of segment data to DS3..2.
STR r1, [r0, #0] ; Write word of segment data to all displays.
\\