Automatic Curtain  MVP
Software repository for an automatic curtain using stepper motor, TMC2209 and ESP32
config.h File Reference

This header file contains all the constants and enum that will be used throughout the repository like specific pins, mapping from state to led color etc. More...

#include <Arduino.h>
#include <chrono>
#include <cstdint>
#include <deque>
#include <iostream>
Include dependency graph for config.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CONFIG_SET::MOTION_REQUEST
 
struct  CONFIG_SET::DEVICE_CRED
 
struct  CONFIG_SET::CALIB_PARAMS
 

Namespaces

 CONFIG_SET
 Namespace to be used for constants/enums.
 

Typedefs

using CONFIG_SET::time_var = std::chrono::time_point< std::chrono::system_clock >
 
using CONFIG_SET::current_time = std::chrono::system_clock
 

Enumerations

enum  CONFIG_SET::OPERATION_MODE { CONFIG_SET::OPERATION_MODE::RESET, CONFIG_SET::OPERATION_MODE::MAINTENANCE, CONFIG_SET::OPERATION_MODE::USER, CONFIG_SET::OPERATION_MODE::NA }
 
enum  CONFIG_SET::LOG_TYPE { CONFIG_SET::LOG_TYPE::INFO, CONFIG_SET::LOG_TYPE::ERROR, CONFIG_SET::LOG_TYPE::WARN }
 
enum  CONFIG_SET::LOG_CLASS {
  CONFIG_SET::LOG_CLASS::CONTROLLER, CONFIG_SET::LOG_CLASS::CONNECTIVITY, CONFIG_SET::LOG_CLASS::INDICATOR, CONFIG_SET::LOG_CLASS::LOGGING,
  CONFIG_SET::LOG_CLASS::MANUAL_INTERACTION, CONFIG_SET::LOG_CLASS::MOTOR_DRIVER, CONFIG_SET::LOG_CLASS::STORAGE, CONFIG_SET::LOG_CLASS::ALEXA_INTERACTION
}
 
enum  CONFIG_SET::MANUAL_PUSH {
  CONFIG_SET::MANUAL_PUSH::NO_PUSH, CONFIG_SET::MANUAL_PUSH::LONG_PRESS_UP, CONFIG_SET::MANUAL_PUSH::LONG_PRESS_DOWN, CONFIG_SET::MANUAL_PUSH::LONG_PRESS_BOTH,
  CONFIG_SET::MANUAL_PUSH::DOUBLE_TAP_UP, CONFIG_SET::MANUAL_PUSH::DOUBLE_TAP_DOWN, CONFIG_SET::MANUAL_PUSH::DOUBLE_TAP_BOTH
}
 
enum  CONFIG_SET::BUTTON_PRESS { CONFIG_SET::BUTTON_PRESS::NO_PUSH, CONFIG_SET::BUTTON_PRESS::LONG_PRESS, CONFIG_SET::BUTTON_PRESS::DOUBLE_TAP }
 
enum  CONFIG_SET::DEVICE_STATUS { CONFIG_SET::DEVICE_STATUS::FAULT, CONFIG_SET::DEVICE_STATUS::OPERATION_MODE, CONFIG_SET::DEVICE_STATUS::RESET_MODE, CONFIG_SET::DEVICE_STATUS::MAINTENANCE_MODE }
 
enum  CONFIG_SET::DRIVER_STATUS { CONFIG_SET::DRIVER_STATUS::AVAILABLE, CONFIG_SET::DRIVER_STATUS::BUSY, CONFIG_SET::DRIVER_STATUS::IN_ACTIVE }
 

Variables

const int CONFIG_SET::LOGGING_BAUD_RATE = 115200
 
const int CONFIG_SET::MOTOR_DRIVER_BAUD_RATE = 115200
 
const int CONFIG_SET::TRY_RECONNECT = 3
 
const int CONFIG_SET::MAX_SECONDS_LOST_WIFI = 600
 
const std::string CONFIG_SET::STORAGE_NAMESPACE = "madac"
 
const int CONFIG_SET::NUMBER_OF_LEDS = 1
 
const int CONFIG_SET::LED_BRIGHTNESS = 25
 
const int CONFIG_SET::DEQUE_ANALYZER_FREQ = 2
 
const std::string CONFIG_SET::KEY_SSID = "ssid"
 
const std::string CONFIG_SET::KEY_PASSWORD = "password"
 
const std::string CONFIG_SET::KEY_DEVICE_ID = "deviceID"
 
const std::string CONFIG_SET::KEY_TOTAL_STEP_COUNT = "totalStepCount"
 
const std::string CONFIG_SET::KEY_DIRECTION = "direction"
 
const std::string CONFIG_SET::KEY_MODE = "mode"
 
const String CONFIG_SET::DEFAULT_DEVICE_ID = "madac_blinds"
 
const float CONFIG_SET::MOTOR_DRIVER_R_SENSE = 0.11f
 
const uint8_t CONFIG_SET::MOTOR_DRIVER_ADDRESS = 0b00
 
const uint8_t CONFIG_SET::MOTOR_DRIVER_TOFF = 4
 
const uint8_t CONFIG_SET::MOTOR_DRIVER_BLANK_TIME = 24
 
const uint16_t CONFIG_SET::MOTOR_DRIVER_RMS_CURRENT = 2000
 
const uint16_t CONFIG_SET::MOTOR_DRIVER_MICROSTEP = 16
 
const uint32_t CONFIG_SET::MOTOR_DRIVER_TCOOL_THRS = 0xFFFFF
 
const uint8_t CONFIG_SET::MOTOR_DRIVER_SE_MIN = 0
 
const uint8_t CONFIG_SET::MOTOR_DRIVER_SE_MAX = 2
 
const uint8_t CONFIG_SET::MOTOR_DRIVER_SEDN = 0b01
 
const uint32_t CONFIG_SET::MOTOR_DRIVER_MAX_SPEED = 5000
 
const int CONFIG_SET::MOTOR_DRIVER_SG_THRESH = 45
 
const int CONFIG_SET::MOTOR_STOP_TIME_SEC = 120
 
const float CONFIG_SET::STEP_FRACTION_ALLOWANCE = 0.05
 
const int CONFIG_SET::MODE_EXPIRE_TIME_LIMIT = 300
 
const int CONFIG_SET::WIFI_DISCONNECT_RESTART_TIME_LIMIT = 60
 
const int CONFIG_SET::PIN_RGB_LED = 32
 
static const int CONFIG_SET::PIN_BUTTON_UP = 33
 
static const int CONFIG_SET::PIN_BUTTON_DOWN = 25
 
const int CONFIG_SET::PIN_MD_ENABLE = 4
 
const int CONFIG_SET::PIN_MD_RX = 16
 
const int CONFIG_SET::PIN_MD_TX = 17
 
const int CONFIG_SET::PIN_MD_MS1 = 5
 
const int CONFIG_SET::PIN_MD_MS2 = 18
 
const int CONFIG_SET::PIN_MD_STEP = 22
 
const int CONFIG_SET::PIN_MD_DIR = 23
 
const int CONFIG_SET::PIN_MD_INDEX = 21
 
const int CONFIG_SET::PIN_MD_DIAG = 19
 

Detailed Description

This header file contains all the constants and enum that will be used throughout the repository like specific pins, mapping from state to led color etc.

Author
Mahimana Bhatt (mahim.nosp@m.anab.nosp@m.hatt@.nosp@m.gmai.nosp@m.l.com)
Version
0.1
Date
2022-07-19