Automatic Curtain  MVP
Software repository for an automatic curtain using stepper motor, TMC2209 and ESP32
CONFIG_SET Namespace Reference

Namespace to be used for constants/enums. More...

Classes

struct  CALIB_PARAMS
 
struct  DEVICE_CRED
 
struct  MOTION_REQUEST
 

Typedefs

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

Enumerations

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

Variables

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

Detailed Description

Namespace to be used for constants/enums.

Typedef Documentation

◆ current_time

using CONFIG_SET::current_time = typedef std::chrono::system_clock

◆ time_var

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

Enumeration Type Documentation

◆ BUTTON_PRESS

Enumerator
NO_PUSH 
LONG_PRESS 
DOUBLE_TAP 

◆ DEVICE_STATUS

Enumerator
FAULT 
OPERATION_MODE 
RESET_MODE 
MAINTENANCE_MODE 

◆ DRIVER_STATUS

Enumerator
AVAILABLE 
BUSY 
IN_ACTIVE 

◆ LOG_CLASS

enum CONFIG_SET::LOG_CLASS
strong
Enumerator
CONTROLLER 
CONNECTIVITY 
INDICATOR 
LOGGING 
MANUAL_INTERACTION 
MOTOR_DRIVER 
STORAGE 
ALEXA_INTERACTION 

◆ LOG_TYPE

enum CONFIG_SET::LOG_TYPE
strong
Enumerator
INFO 
ERROR 
WARN 

◆ MANUAL_PUSH

Enumerator
NO_PUSH 
LONG_PRESS_UP 
LONG_PRESS_DOWN 
LONG_PRESS_BOTH 
DOUBLE_TAP_UP 
DOUBLE_TAP_DOWN 
DOUBLE_TAP_BOTH 

◆ OPERATION_MODE

Enumerator
RESET 
MAINTENANCE 
USER 
NA 

Variable Documentation

◆ DEFAULT_DEVICE_ID

const String CONFIG_SET::DEFAULT_DEVICE_ID = "madac_blinds"

◆ DEQUE_ANALYZER_FREQ

const int CONFIG_SET::DEQUE_ANALYZER_FREQ = 2

◆ KEY_DEVICE_ID

const std::string CONFIG_SET::KEY_DEVICE_ID = "deviceID"

◆ KEY_DIRECTION

const std::string CONFIG_SET::KEY_DIRECTION = "direction"

◆ KEY_MODE

const std::string CONFIG_SET::KEY_MODE = "mode"

◆ KEY_PASSWORD

const std::string CONFIG_SET::KEY_PASSWORD = "password"

◆ KEY_SSID

const std::string CONFIG_SET::KEY_SSID = "ssid"

◆ KEY_TOTAL_STEP_COUNT

const std::string CONFIG_SET::KEY_TOTAL_STEP_COUNT = "totalStepCount"

◆ LED_BRIGHTNESS

const int CONFIG_SET::LED_BRIGHTNESS = 25

◆ LOGGING_BAUD_RATE

const int CONFIG_SET::LOGGING_BAUD_RATE = 115200

◆ MAX_SECONDS_LOST_WIFI

const int CONFIG_SET::MAX_SECONDS_LOST_WIFI = 600

◆ MODE_EXPIRE_TIME_LIMIT

const int CONFIG_SET::MODE_EXPIRE_TIME_LIMIT = 300

◆ MOTOR_DRIVER_ADDRESS

const uint8_t CONFIG_SET::MOTOR_DRIVER_ADDRESS = 0b00

◆ MOTOR_DRIVER_BAUD_RATE

const int CONFIG_SET::MOTOR_DRIVER_BAUD_RATE = 115200

◆ MOTOR_DRIVER_BLANK_TIME

const uint8_t CONFIG_SET::MOTOR_DRIVER_BLANK_TIME = 24

◆ MOTOR_DRIVER_MAX_SPEED

const uint32_t CONFIG_SET::MOTOR_DRIVER_MAX_SPEED = 5000

◆ MOTOR_DRIVER_MICROSTEP

const uint16_t CONFIG_SET::MOTOR_DRIVER_MICROSTEP = 16

◆ MOTOR_DRIVER_R_SENSE

const float CONFIG_SET::MOTOR_DRIVER_R_SENSE = 0.11f

◆ MOTOR_DRIVER_RMS_CURRENT

const uint16_t CONFIG_SET::MOTOR_DRIVER_RMS_CURRENT = 2000

◆ MOTOR_DRIVER_SE_MAX

const uint8_t CONFIG_SET::MOTOR_DRIVER_SE_MAX = 2

◆ MOTOR_DRIVER_SE_MIN

const uint8_t CONFIG_SET::MOTOR_DRIVER_SE_MIN = 0

◆ MOTOR_DRIVER_SEDN

const uint8_t CONFIG_SET::MOTOR_DRIVER_SEDN = 0b01

◆ MOTOR_DRIVER_SG_THRESH

const int CONFIG_SET::MOTOR_DRIVER_SG_THRESH = 45

◆ MOTOR_DRIVER_TCOOL_THRS

const uint32_t CONFIG_SET::MOTOR_DRIVER_TCOOL_THRS = 0xFFFFF

◆ MOTOR_DRIVER_TOFF

const uint8_t CONFIG_SET::MOTOR_DRIVER_TOFF = 4

◆ MOTOR_STOP_TIME_SEC

const int CONFIG_SET::MOTOR_STOP_TIME_SEC = 120

◆ NUMBER_OF_LEDS

const int CONFIG_SET::NUMBER_OF_LEDS = 1

◆ PIN_BUTTON_DOWN

const int CONFIG_SET::PIN_BUTTON_DOWN = 25
static

◆ PIN_BUTTON_UP

const int CONFIG_SET::PIN_BUTTON_UP = 33
static

◆ PIN_MD_DIAG

const int CONFIG_SET::PIN_MD_DIAG = 19

◆ PIN_MD_DIR

const int CONFIG_SET::PIN_MD_DIR = 23

◆ PIN_MD_ENABLE

const int CONFIG_SET::PIN_MD_ENABLE = 4

◆ PIN_MD_INDEX

const int CONFIG_SET::PIN_MD_INDEX = 21

◆ PIN_MD_MS1

const int CONFIG_SET::PIN_MD_MS1 = 5

◆ PIN_MD_MS2

const int CONFIG_SET::PIN_MD_MS2 = 18

◆ PIN_MD_RX

const int CONFIG_SET::PIN_MD_RX = 16

◆ PIN_MD_STEP

const int CONFIG_SET::PIN_MD_STEP = 22

◆ PIN_MD_TX

const int CONFIG_SET::PIN_MD_TX = 17

◆ PIN_RGB_LED

const int CONFIG_SET::PIN_RGB_LED = 32

◆ STEP_FRACTION_ALLOWANCE

const float CONFIG_SET::STEP_FRACTION_ALLOWANCE = 0.05

◆ STORAGE_NAMESPACE

const std::string CONFIG_SET::STORAGE_NAMESPACE = "madac"

◆ TRY_RECONNECT

const int CONFIG_SET::TRY_RECONNECT = 3

◆ WIFI_DISCONNECT_RESTART_TIME_LIMIT

const int CONFIG_SET::WIFI_DISCONNECT_RESTART_TIME_LIMIT = 60