123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /*
- * sys_api.h
- *
- * Created on: 12.03.2017
- * Author: jesstr
- */
- #ifndef SYS_API_H_
- #define SYS_API_H_
- #include <stdbool.h>
- #include <stdint.h>
- #ifndef DEVICE_MAC
- #define DEVICE_MAC "EC-4C-4D-00-C7-FF"
- #endif
- #ifndef DEVICE_SERIAL
- #define DEVICE_SERIAL "7023000"
- #endif
- #define SYS_MAC DEVICE_MAC
- #define SYS_SERIAL DEVICE_SERIAL
- #define SYS_CUSTOMER "Rotek"
- #define MAC_LEN 18
- #define SER_LEN 16
- #define CUST_LEN 16
- #define PROD_LEN 20
- /**
- * @brief Cтруктура системных настроек
- */
- typedef struct
- {
- char mac[MAC_LEN]; // MAC адрес
- char serial[SER_LEN]; // Серийный номер
- char customer[CUST_LEN]; // Заказчик
- char proddate[PROD_LEN]; // Дата производства
- char testState[16];
- uint32_t controlword;
- uint32_t crc;
- } SYS_t;
- bool SYS_BackupInfo(char *mac, char *serial);
- bool SYS_RestoreInfo(SYS_t *settings);
- /**
- * @brief
- * @retval
- */
- uint32_t SYS_GetCRC(SYS_t *settings);
- /**
- * @brief Загрузка структуры системных настроек из flash
- */
- bool SYS_Load(SYS_t *settings);
- /**
- * @brief Запись структуры настроек во flash
- */
- bool SYS_Save(SYS_t *settings);
- #endif /* SYS_API_H_ */
|