Driver for the TM1637 4-digit 7-segment display
More...
Driver for the TM1637 4-digit 7-segment display
|
file | tm1637.h |
| Interface definition for the TM1637 4-digit 7-segment display driver.
|
|
file | tm1637_params.h |
| Config for the TM1637 display.
|
|
|
enum | tm1637_brightness_t {
TM1637_PW_1_16 = 0x00
, TM1637_PW_2_16 = 0x01
, TM1637_PW_4_16 = 0x02
, TM1637_PW_10_16 = 0x03
,
TM1637_PW_11_16 = 0x04
, TM1637_PW_12_16 = 0x05
, TM1637_PW_13_16 = 0x06
, TM1637_PW_14_16 = 0x07
} |
| Brightness level enum for the display. More...
|
|
◆ tm1637_brightness_t
Brightness level enum for the display.
- Note
- The brightness must be one of the given values according to the specification. It is expressed as a fraction of the full pulse width. The value has a size of 3 bits.
Definition at line 63 of file tm1637.h.
◆ tm1637_clear()
int tm1637_clear |
( |
const tm1637_t * | dev | ) |
|
Clear the display.
- Parameters
-
[in] | dev | device descriptor of the display |
- Return values
-
◆ tm1637_init()
Initializes the tm1637 device.
- Parameters
-
[out] | dev | device descriptor of the display |
[in] | params | configuration parameters |
- Return values
-
◆ tm1637_write_number()
Writes an integer to the display.
- Note
- The integer can't be bigger than 9999 or smaller than -999 as only 4 digits can be displayed at a time. When leading zeros are enabled, the display is padded with zeros. For negative integers the leading zeros are added between the minus sign and the number.
- Parameters
-
[in] | dev | device descriptor of the display |
[in] | number | number to write, in the range of -999 to 9999 |
[in] | brightness | brightness of the display according to tm1637_brightness_t |
[in] | colon | If enabled, displays a colon in the middle |
[in] | leading_zeros | If enabled, displays leading zeros |
- Return values
-