Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ad5422_arduino mbed LT1446 ADS1248-1 LM35-1 Flash FT813 PGA280_ADS1259
main.h
00001 #include "PerifConfig.h" 00002 #include "PGA280.h" 00003 #include "ADS1259.h" 00004 #include "PGA280ADS1259.h" 00005 #include "ad5422_arduino.h" 00006 #include "lm35.h" 00007 #include "LT1446.h" 00008 #include "ads1248.h" 00009 #include "flashwrapper.h" 00010 #include <cmath> 00011 #include "FT_Platform.h" 00012 #include "display.h" 00013 00014 /*тип для хранение настроек ПИДа*/ 00015 #ifndef _PID_T //если ещё нету определения типа то создать 00016 typedef struct{ 00017 float kP,kI,kD,sampleTime; 00018 uint32_t chkd; 00019 uint8_t 00020 enabled:1, 00021 :7; 00022 }PID_t; 00023 #endif 00024 //тип для "удобного" хранения настроек калибровки дисплея 00025 typedef struct{ 00026 char calibration[25]; 00027 }Calibration_t; 00028 00029 //"переходник" между "голыми" и "осмысленными" данными 00030 typedef union 00031 { 00032 struct{ 00033 float temp_u; 00034 float rashod_u; 00035 PID_t PID;//пид для нагрева колонки 00036 PID_t PID_R; //ПИД для расхода 00037 char calibration[25]; 00038 struct { 00039 float k,b; 00040 }ADS1248Calibr; 00041 }; 00042 //массив слов по 4 байта 00043 uint32_t w[2*sizeof(float)+2*(sizeof(PID_t)/sizeof(uint32_t))+sizeof(Calibration_t)/sizeof(uint32_t)+2*sizeof(float)]; 00044 }Mem_t; 00045 Mem_t Mem;//экземпляр "переходника" 00046 00047 typedef struct{ 00048 volatile float Error, dError, last_Error; //Ошибка и предыдущее значение для ПИД 00049 volatile float Integral; //Интегральная составляющая ПИД-регулятора 00050 }PID_prom_t; //промежуточные значения ПИД 00051 00052 typedef struct{ 00053 float kp,ki,kd,st; 00054 }PID_defs_t; //тип для хранения настроек по умолчанию 00055 00056 float inline NormADC(long data); 00057 void ComandCheck(); 00058 float PID (PID_t *pidx, PID_prom_t *prom); 00059 void printtemp(); 00060 float BufToFloat(unsigned char *buf); 00061 void setPIDdefault(PID_t *pidx,PID_defs_t *defs); 00062 void pressed();
Generated on Thu Jul 14 2022 17:32:52 by
1.7.2