123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- #ifndef COMMON_CONFIG_H
- #define COMMON_CONFIG_H
- #include "at32f403a_407.h"
- #ifdef DEBUG
- #define DBG
- #else
- #undef DBG
- #define DBG if (0)
- #endif
- #define HW_REV_LEN 16
- #define HW_REV_OFFSET 0x1F0
- #define HW_REV "MT_M03"
- #define MODEL "Метролог M3"
- #define MANUFACTURER "АО \"НПК РоТеК\""
- #define VERSION "1.00.01"
- #define MD5_CRC "BF704428A06FE45359B2037ADBAA2C6E"
-
-
- #define SETTINGS_SECTOR 0x08020000
-
- #define CRC_ADDRESS 0x080207FC
- #define SYS_SECTOR 0x08020800
- #define SYS_CRC_ADDRESS 0x08020FFC
-
- #define SETTINGS_CONTROL_WORD 123456789
- #define BOOT_TRY 26
- #define UPDATE_TIMEOUT 120
- #define USER_FLASH_FIRST_PAGE_ADDRESS 0x08021000
- #define USER_FLASH_END_ADDRESS 0x080C0FFF
- #define USER_FLASH_CRC_ADDRESS 0x080C0FFC
- #define FLASH_SECTOR_SIZE 0x800
- #define IAP_FLASH_FIRST_PAGE_ADDRESS 0x08000000
- #define IAP_FLASH_CRC_ADDRESS 0x0801FFFC
- #define SYSTEMTICK_PERIOD_MS 1
-
-
- #define FW_BEGIN_ADDRESS 0x08021000
-
- #define FLASH_PAGE_SIZE 0x00000800U
-
-
- #define MQTT_CLIENT
- #define USB_RNDIS
- #define MAIN_FW_NAME "MT_M03.bin"
- #define BACKUP_MAIN_FW_NAME "BACKUP.bin"
- #define LOG_ENABLE
- #define LOG_NAME "LOG.txt"
- #define FLASH_TYPE_MX25L1606E
- typedef enum
- {
- MB_REV_0 = 0,
- MB_REV_1 = 1,
- MB_REV_2 = 2,
- MB_REV_3 = 3,
- MB_REV_4 = 4,
- MB_REV_5 = 5,
- MB_REV_6 = 6,
- MB_REV_7 = 7,
-
- } MBOARD_REV_t;
- typedef enum
- {
- DB_ABS = 0,
- DB_REV_1 = 1,
- DB_REV_2 = 2,
- DB_REV_3 = 3,
- DB_REV_4 = 4,
- DB_REV_5 = 5,
- DB_REV_6 = 6,
- DB_REV_7 = 7,
- DB_REV_8 = 8,
- DB_REV_9 = 9,
- DB_REV_10 = 10,
-
- } DBOARD_REV_t;
- typedef enum
- {
- ADC_PWR_MEAS = 0,
- ADC_DB_REV = 1,
- ADC_MB_REV = 2,
-
- } ADC_REV_CH_t;
- extern uint8_t mboard_rev;
- extern uint8_t dboard_rev;
- #endif
|