InES Hardware Abstraction Layer
hal_ct_seg7.h
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * -- _____ ______ _____ -
3  * -- |_ _| | ____|/ ____| -
4  * -- | | _ __ | |__ | (___ Institute of Embedded Systems -
5  * -- | | | '_ \| __| \___ \ Zurich University of -
6  * -- _| |_| | | | |____ ____) | Applied Sciences -
7  * -- |_____|_| |_|______|_____/ 8401 Winterthur, Switzerland -
8  * ------------------------------------------------------------------------- */
16 /* Re-definition guard */
17 #ifndef _HAL_CT_SEG7_H
18 #define _HAL_CT_SEG7_H
19 
20 
21 /* Standard includes */
22 #include <stdint.h>
23 
24 
25 /* -- Type definitions
26  * ------------------------------------------------------------------------- */
27 
32 typedef enum {
33  HAL_CT_SEG7_DS0 = 0u,
34  HAL_CT_SEG7_DS1 = 8u,
35  HAL_CT_SEG7_DS2 = 16u,
36  HAL_CT_SEG7_DS3 = 24u,
38 
39 
44 typedef enum {
45  HAL_CT_SEG7_SEGA = 0x01,
46  HAL_CT_SEG7_SEGB = 0x02,
47  HAL_CT_SEG7_SEGC = 0x04,
48  HAL_CT_SEG7_SEGD = 0x08,
49  HAL_CT_SEG7_SEGE = 0x10,
50  HAL_CT_SEG7_SEGF = 0x20,
51  HAL_CT_SEG7_SEGG = 0x40,
52  HAL_CT_SEG7_SEGDP = 0x80,
54 
55 
56 /* -- Public function declarations
57  * ------------------------------------------------------------------------- */
58 
65  uint8_t segment);
66 
72 void hal_ct_seg7_bin_write(uint16_t value);
73 
78 void hal_ct_seg7_clear(hal_ct_seg7_t display);
79 
83 void hal_ct_seg7_clear_all(void);
84 
90 
96 
103 uint8_t hal_ct_seg7_get_bcd(uint8_t value);
104 
111 uint8_t hal_ct_seg7_get_seg7(uint8_t value);
112 
113 
114 #endif
void hal_ct_seg7_raw_write(hal_ct_seg7_t display, uint8_t segment)
Writes segment data to specified 7 segment display.
void hal_ct_seg7_dot_set(hal_ct_seg7_t display)
Set dot on specified displays.
void hal_ct_seg7_dot_clear(hal_ct_seg7_t display)
Reset dot on specified displays.
hal_ct_seg7_segment_t
Defines the segments on a 7 segment display.
Definition: hal_ct_seg7.h:44
void hal_ct_seg7_clear(hal_ct_seg7_t display)
Clear all segments on the specified display.
uint8_t hal_ct_seg7_get_bcd(uint8_t value)
Converts binary value to bcd.
void hal_ct_seg7_clear_all(void)
Clear all segments on all displays.
void hal_ct_seg7_bin_write(uint16_t value)
Outputs a 16 bit value in hexadecimal represenation on the seven-segment display.
hal_ct_seg7_t
Defines the 7 segment displays on the CT-Board.
Definition: hal_ct_seg7.h:32
uint8_t hal_ct_seg7_get_seg7(uint8_t value)
Converts binary value to 7 segment code.