#ifndef SC_H #define SC_H #include #include #include "driver/gpio.h" #include "driver/i2c_master.h" #define MCP_I2C_ADDR CONFIG_MCP_I2C_ADDR #define SDA_PIN CONFIG_SDA_PIN #define SCL_PIN CONFIG_SCL_PIN #define N0_P0 CONFIG_N0_P0 #define N0_P1 CONFIG_N0_P1 #define N0_P2 CONFIG_N0_P2 #define N0_P3 CONFIG_N0_P3 #define N1_P0 CONFIG_N1_P0 #define N1_P1 CONFIG_N1_P1 #define N1_P2 CONFIG_N1_P2 #define N1_P3 CONFIG_N1_P3 #define N2_P0 CONFIG_N2_P0 #define N2_P1 CONFIG_N2_P1 #define N2_P2 CONFIG_N2_P2 #define N2_P3 CONFIG_N2_P3 #define N3_P0 CONFIG_N3_P0 #define N3_P1 CONFIG_N3_P1 #define N3_P2 CONFIG_N3_P2 #define N3_P3 CONFIG_N3_P3 #define MCP_GPIO_OUTPUT 0 #define REG_IODIRA 0x00 #define REG_IODIRB 0x01 #define REG_GPIOA 0x12 #define REG_GPIOB 0x13 #define BV(x) (1 << (x)) struct Nixie { uint8_t digit; uint8_t reg; uint8_t D; uint8_t C; uint8_t B; uint8_t A; }; struct Screen { struct Nixie nixies[4]; i2c_master_bus_handle_t i2c_bus; i2c_master_dev_handle_t mcp; }; void configure_screen(struct Screen* screen); void test_screen(struct Screen* screen); void display(struct Screen* screen, char digits[4]); #endif