35 lines
1020 B
C
35 lines
1020 B
C
#ifndef SSEG_H
|
|
#define SSEG_H
|
|
|
|
#include "TM1640/TM1640.h"
|
|
#include <esp_log.h>
|
|
|
|
#define SSEG_PIN_DATA GPIO_NUM_10
|
|
#define SSEG_PIN_CLK GPIO_NUM_11
|
|
|
|
extern TM1640* sseg;
|
|
|
|
/// Initializes the seven segment driver
|
|
void init_sseg();
|
|
|
|
/// sets the game seven segment to the value of the digits
|
|
///
|
|
/// the bits 0-6 map to segments A-G, and bit 7 is DP.
|
|
///
|
|
/// `digits` must have len >= 4.
|
|
void set_game_sseg_raw(const uint8_t* digits);
|
|
|
|
/// sets the module seven segment to the value of the digits
|
|
///
|
|
/// the bits 0-6 map to segments A-G, and bit 7 is DP.
|
|
///
|
|
/// `digits` must have len >= 4.
|
|
void set_module_sseg_raw(const uint8_t* digits);
|
|
|
|
/// sets the game timer to the given number, with the dot at position `dot_pos` from the right (0 => right-most digit).
|
|
void set_game_sseg_num(uint32_t value, uint8_t dot_pos);
|
|
|
|
/// sets the module timer to the given number, with the dot at position `dot_pos` from the right (0 => right-most digit).
|
|
void set_module_sseg_num(uint32_t value, uint8_t dot_pos);
|
|
|
|
#endif /* SSEG_H */ |