47 lines
1.0 KiB
C
47 lines
1.0 KiB
C
#ifndef WIRES_HPP
|
|
#define WIRES_HPP
|
|
|
|
#include <stdint.h>
|
|
#include <driver/i2c.h>
|
|
#include <driver/gpio.h>
|
|
#include <esp_log.h>
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/semphr.h"
|
|
#include "drivers/char_lcd.h"
|
|
#include "drivers/game_timer.h"
|
|
#include "main.h"
|
|
#include "perh.h"
|
|
|
|
#define WIRES_PIN_DELTA PIN_PERH3
|
|
#define PIN_WIRES_SDA PIN_PERH1
|
|
#define PIN_WIRES_SCL PIN_PERH2
|
|
#define WIRES_I2C_NUM I2C_NUM_1
|
|
#define WIRES_I2C_ADDR 125
|
|
|
|
/// The mutex for accessing `I2C_NUM_1` (wires I2C bus).
|
|
extern SemaphoreHandle_t wires_i2c_mutex;
|
|
|
|
#define DELTA_BIT_WIRES 0
|
|
#define DELTA_BIT_BUTTON 1
|
|
|
|
extern const uint32_t STRIKE_TIME_PENALTY;
|
|
extern uint32_t step_strikes[N_STEPS];
|
|
extern uint32_t step_finish_times[N_STEPS];
|
|
|
|
extern uint32_t total_strikes;
|
|
|
|
void init_wires(void);
|
|
uint8_t get_wires(void);
|
|
uint8_t get_cut_wires(void);
|
|
|
|
bool get_help_button(void);
|
|
bool get_help_button_pressed(void);
|
|
bool get_help_button_released(void);
|
|
|
|
void clear_wires_pressed_released_cut(void);
|
|
|
|
void set_leds(uint8_t led_states);
|
|
|
|
void strike(const char* reason);
|
|
|
|
#endif /* WIRES_HPP */ |