style: added docs
This commit is contained in:
1 parent
b8aa3a594d
commit
b9fc3a6f41
17 files changed
+824
-244
No files matched your search
+64
-62
@@ -1,5 +1,27 @@
|
||||
/**
|
||||
* @file ate0005.h
|
||||
*
|
||||
* @brief Configuration and interface definitions of the ATE0005 universal
|
||||
* optical 2-channel angle gauge and tachometer.
|
||||
*
|
||||
* This header aggregates the includes required by the application and defines
|
||||
* the FreeRTOS task priorities and stack sizes, the operating mode constants
|
||||
* with the main menu labels, the WiFi access point and station parameters and
|
||||
* the GPIO pin mapping of the peripherals of the ATE0005 device running on the
|
||||
* ESP32 platform.
|
||||
*
|
||||
* Key features:
|
||||
* - Task priorities and stack sizes for the inclinometer, tachometer, encoder,
|
||||
* expander and statistics tasks
|
||||
* - Operating mode constants and the matching main menu labels
|
||||
* - WiFi access point and station configuration with the remote syslog server
|
||||
* address
|
||||
* - I2C bus, LCD expander and optical device GPIO pin definitions
|
||||
*
|
||||
* @note The GPIO definitions match the connectors of the ATE0005 board and
|
||||
* must not be changed without a hardware revision.
|
||||
* @note The optical device of each channel is shared by the inclinometer and
|
||||
* the tachometer of the same channel.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
@@ -15,82 +37,62 @@
|
||||
#include "zh_espnow.h"
|
||||
#include "zh_syslog.h"
|
||||
|
||||
#define STATS_TASK_PRIORITY tskIDLE_PRIORITY
|
||||
#define STATS_TASK_STACK_SIZE configMINIMAL_STACK_SIZE + 1280
|
||||
#define A_INCLINOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5
|
||||
#define A_INCLINOMETER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE + 512
|
||||
#define B_INCLINOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5
|
||||
#define B_INCLINOMETER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE + 512
|
||||
#define A_TACHOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5
|
||||
#define A_TACHOMETER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE + 512
|
||||
#define B_TACHOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5
|
||||
#define B_TACHOMETER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE + 512
|
||||
#define ENCODER_TASK_PRIORITY tskIDLE_PRIORITY + 4
|
||||
#define ENCODER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define EXPANDER_TASK_PRIORITY tskIDLE_PRIORITY + 4
|
||||
#define EXPANDER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define STATS_TASK_PRIORITY tskIDLE_PRIORITY /*!< Priority of the statistics logging task */
|
||||
#define STATS_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE + 1280) /*!< Stack size for the statistics logging task */
|
||||
#define A_INCLINOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5 /*!< Priority of the A inclinometer processing task */
|
||||
#define A_INCLINOMETER_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE + 512) /*!< Stack size for the A inclinometer processing task */
|
||||
#define B_INCLINOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5 /*!< Priority of the B inclinometer processing task */
|
||||
#define B_INCLINOMETER_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE + 512) /*!< Stack size for the B inclinometer processing task */
|
||||
#define A_TACHOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5 /*!< Priority of the A tachometer processing task */
|
||||
#define A_TACHOMETER_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE + 512) /*!< Stack size for the A tachometer processing task */
|
||||
#define B_TACHOMETER_TASK_PRIORITY tskIDLE_PRIORITY + 5 /*!< Priority of the B tachometer processing task */
|
||||
#define B_TACHOMETER_TASK_STACK_SIZE (configMINIMAL_STACK_SIZE + 512) /*!< Stack size for the B tachometer processing task */
|
||||
#define ENCODER_TASK_PRIORITY tskIDLE_PRIORITY + 4 /*!< Priority of the mode encoder task */
|
||||
#define ENCODER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE /*!< Stack size for the mode encoder task */
|
||||
#define EXPANDER_TASK_PRIORITY tskIDLE_PRIORITY + 4 /*!< Priority of the PCF8574 expander task */
|
||||
#define EXPANDER_TASK_STACK_SIZE configMINIMAL_STACK_SIZE /*!< Stack size for the PCF8574 expander task */
|
||||
|
||||
#define TRIAC_ON true
|
||||
#define TRIAC_OFF false
|
||||
#define MODE_ANGLE_ANGLE 0 /*!< Operating mode: both inclinometers active */
|
||||
#define MAIN_MENU_ANGLE_ANGLE_NAME "ANGLE/ANGLE" /*!< Menu label for angle/angle mode */
|
||||
#define MODE_TACHO_TACHO 1 /*!< Operating mode: both tachometers active */
|
||||
#define MAIN_MENU_TACHO_TACHO_NAME "TACHO/TACHO" /*!< Menu label for tachometer/tachometer mode */
|
||||
#define MODE_ANGLE_TACHO 2 /*!< Operating mode: A inclinometer and B tachometer active */
|
||||
#define MAIN_MENU_ANGLE_TACHO_NAME "ANGLE/TACHO" /*!< Menu label for angle/tachometer mode */
|
||||
#define MODE_REMOTE 3 /*!< Operating mode: remote control via ESP-NOW */
|
||||
#define MAIN_MENU_REMOTE_NAME "REMOTE" /*!< Menu label for remote mode */
|
||||
|
||||
#define ENCODER_BUTTON_RELEASED true
|
||||
#define ENCODER_BUTTON_PRESSED false
|
||||
#define WIFI_AP_SSID "ATE0005" /*!< WiFi AP SSID */
|
||||
#define WIFI_AP_PASS "repairlab" /*!< WiFi AP password */
|
||||
#define WIFI_AP_CHANNEL 1 /*!< WiFi AP channel */
|
||||
#define MAX_AP_CONNECTION 4 /*!< Maximum number of stations connected to AP */
|
||||
|
||||
#define LED_OFF ZH_PCF8574_GPIO_LOW
|
||||
#define LED_ON ZH_PCF8574_GPIO_HIGH
|
||||
#define WIFI_STA_SSID "rick_professor" /*!< WiFi STA SSID */
|
||||
#define WIFI_STA_PASS "repairlab" /*!< WiFi STA password */
|
||||
#define WIFI_STA_MAXIMUM_RETRY 10 /*!< Maximum number of reconnection attempts for STA mode */
|
||||
|
||||
#define RELAY_OFF ZH_PCF8574_GPIO_LOW
|
||||
#define RELAY_ON ZH_PCF8574_GPIO_HIGH
|
||||
#define SYSLOG_IP "77.51.201.8" /*!< IP address of the remote syslog server */
|
||||
|
||||
#define MODE_ANGLE_ANGLE 0
|
||||
#define MAIN_MENU_ANGLE_ANGLE_NAME "ANGLE/ANGLE"
|
||||
#define MODE_TACHO_TACHO 1
|
||||
#define MAIN_MENU_TACHO_TACHO_NAME "TACHO/TACHO"
|
||||
#define MODE_ANGLE_TACHO 2
|
||||
#define MAIN_MENU_ANGLE_TACHO_NAME "ANGLE/TACHO"
|
||||
#define MODE_REMOTE 3
|
||||
#define MAIN_MENU_REMOTE_NAME "REMOTE"
|
||||
#define I2C_SCL_GPIO GPIO_NUM_22 /*!< I2C clock line GPIO */
|
||||
#define I2C_SDA_GPIO GPIO_NUM_21 /*!< I2C data line GPIO */
|
||||
|
||||
#define WIFI_AP_SSID "ATE0005"
|
||||
#define WIFI_AP_PASS "repairlab"
|
||||
#define WIFI_AP_CHANNEL 1
|
||||
#define MAX_AP_CONNECTION 4
|
||||
#define LCD_I2C_ADDRESS 0x20 /*!< I2C address of the LCD PCF8574 expander (U2) */
|
||||
|
||||
#define WIFI_STA_SSID "rick_professor"
|
||||
#define WIFI_STA_PASS "repairlab"
|
||||
#define WIFI_STA_MAXIMUM_RETRY 10
|
||||
#define MODE_ENCODER_NUMBER 1 /*!< Encoder instance number (Connector EN1) */
|
||||
#define MODE_ENCODER_A_GPIO GPIO_NUM_27 /*!< Mode encoder A-phase GPIO */
|
||||
#define MODE_ENCODER_B_GPIO GPIO_NUM_26 /*!< Mode encoder B-phase GPIO */
|
||||
#define MODE_ENCODER_S_GPIO GPIO_NUM_25 /*!< Mode encoder switch GPIO */
|
||||
|
||||
#define SYSLOG_IP "77.51.201.8"
|
||||
#define A_OPTICAL_DEVICE_A_GPIO GPIO_NUM_14 /*!< Optical device A-phase GPIO for channel A (Connector EN2) */
|
||||
#define A_OPTICAL_DEVICE_B_GPIO GPIO_NUM_13 /*!< Optical device B-phase GPIO for channel A */
|
||||
|
||||
#define I2C_SCL_GPIO GPIO_NUM_22
|
||||
#define I2C_SDA_GPIO GPIO_NUM_21
|
||||
|
||||
#define LCD_I2C_ADDRESS 0x20 /*!< U2. */
|
||||
|
||||
#define MODE_ENCODER_NUMBER 0x01 /*!< Connector EN1. */
|
||||
#define MODE_ENCODER_A_GPIO GPIO_NUM_27
|
||||
#define MODE_ENCODER_B_GPIO GPIO_NUM_26
|
||||
#define MODE_ENCODER_S_GPIO GPIO_NUM_25
|
||||
|
||||
#define A_OPTICAL_DEVICE_A_GPIO GPIO_NUM_14 /*!< Connector EN2. */
|
||||
#define A_OPTICAL_DEVICE_B_GPIO GPIO_NUM_13
|
||||
|
||||
#define B_OPTICAL_DEVICE_A_GPIO GPIO_NUM_18 /*!< Connector EN3. */
|
||||
#define B_OPTICAL_DEVICE_B_GPIO GPIO_NUM_19
|
||||
#define B_OPTICAL_DEVICE_A_GPIO GPIO_NUM_18 /*!< Optical device A-phase GPIO for channel B (Connector EN3) */
|
||||
#define B_OPTICAL_DEVICE_B_GPIO GPIO_NUM_19 /*!< Optical device B-phase GPIO for channel B */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t a_inclinometer_task_min_stack_size;
|
||||
uint32_t b_inclinometer_task_min_stack_size;
|
||||
uint32_t a_tachometer_task_min_stack_size;
|
||||
uint32_t b_tachometer_task_min_stack_size;
|
||||
} task_stats_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
Reference in new issue
Block a user