808
Dependents: Chromatograph_Mobile
LT1446.h@1:b456fe5494fe, 2020-08-08 (annotated)
- Committer:
- nikmaos
- Date:
- Sat Aug 08 18:23:07 2020 +0000
- Revision:
- 1:b456fe5494fe
- Parent:
- 0:4ca9c83d7e14
808
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vitlog | 0:4ca9c83d7e14 | 1 | #ifndef LT1446_H |
vitlog | 0:4ca9c83d7e14 | 2 | #define LT1446_H |
vitlog | 0:4ca9c83d7e14 | 3 | /*Начало файла*/ |
vitlog | 0:4ca9c83d7e14 | 4 | #include "PerifConfig.h" |
vitlog | 0:4ca9c83d7e14 | 5 | |
vitlog | 0:4ca9c83d7e14 | 6 | /*записывам в DACA и DACB а отправляем байты. Байт 2 содержит часть от обоих каналов*/ |
vitlog | 0:4ca9c83d7e14 | 7 | typedef union{ |
vitlog | 0:4ca9c83d7e14 | 8 | struct{ |
vitlog | 0:4ca9c83d7e14 | 9 | uint32_t |
vitlog | 0:4ca9c83d7e14 | 10 | DACB:12, |
vitlog | 0:4ca9c83d7e14 | 11 | DACA:12; |
vitlog | 0:4ca9c83d7e14 | 12 | }; |
vitlog | 0:4ca9c83d7e14 | 13 | struct{ |
vitlog | 0:4ca9c83d7e14 | 14 | uint8_t |
vitlog | 0:4ca9c83d7e14 | 15 | b3, |
vitlog | 0:4ca9c83d7e14 | 16 | b2, |
vitlog | 0:4ca9c83d7e14 | 17 | b1; |
vitlog | 0:4ca9c83d7e14 | 18 | }; |
vitlog | 0:4ca9c83d7e14 | 19 | } LT1446_MEM_t; //объявление типа |
vitlog | 0:4ca9c83d7e14 | 20 | //объявление внешней переменной (продолжение в cpp файле) |
vitlog | 0:4ca9c83d7e14 | 21 | extern LT1446_MEM_t LT1446_MEM; |
vitlog | 0:4ca9c83d7e14 | 22 | |
vitlog | 0:4ca9c83d7e14 | 23 | /*Оперативное значение калибровки*/ |
vitlog | 0:4ca9c83d7e14 | 24 | typedef struct { |
vitlog | 0:4ca9c83d7e14 | 25 | float k,Volts,b; |
vitlog | 0:4ca9c83d7e14 | 26 | struct{ |
vitlog | 0:4ca9c83d7e14 | 27 | uint16_t Code:12; //вывод в ЦАП |
vitlog | 0:4ca9c83d7e14 | 28 | uint16_t //резерв под флаги |
vitlog | 0:4ca9c83d7e14 | 29 | f0:1, |
vitlog | 0:4ca9c83d7e14 | 30 | f1:1, |
vitlog | 0:4ca9c83d7e14 | 31 | f2:1, |
vitlog | 0:4ca9c83d7e14 | 32 | f3:1; |
vitlog | 0:4ca9c83d7e14 | 33 | }; |
vitlog | 0:4ca9c83d7e14 | 34 | }LT1446_Calibr_t; |
vitlog | 0:4ca9c83d7e14 | 35 | |
vitlog | 0:4ca9c83d7e14 | 36 | /*типа для создания экземпляра ЦАПа если их несколько*/ |
vitlog | 0:4ca9c83d7e14 | 37 | typedef struct { |
vitlog | 0:4ca9c83d7e14 | 38 | LT1446_Calibr_t dacA; |
vitlog | 0:4ca9c83d7e14 | 39 | LT1446_Calibr_t dacB; |
vitlog | 0:4ca9c83d7e14 | 40 | } LT1446_t; |
vitlog | 0:4ca9c83d7e14 | 41 | |
vitlog | 0:4ca9c83d7e14 | 42 | //объект по умолчанию |
vitlog | 0:4ca9c83d7e14 | 43 | extern LT1446_t LT1446_0; |
vitlog | 0:4ca9c83d7e14 | 44 | |
vitlog | 0:4ca9c83d7e14 | 45 | /*Функция калибровки (присвоение коэффициентов)*/ |
vitlog | 0:4ca9c83d7e14 | 46 | void LT1446_CalibrateCh(LT1446_Calibr_t *dac,float k, float b); |
vitlog | 0:4ca9c83d7e14 | 47 | void LT1446_CalculateCh(LT1446_Calibr_t *dac); |
vitlog | 0:4ca9c83d7e14 | 48 | /*записать данные в память микросхемы*/ |
vitlog | 0:4ca9c83d7e14 | 49 | void LT1446_Write(LT1446_t *chip); |
nikmaos | 1:b456fe5494fe | 50 | void LTCwrite(LT1446_t *chip); |
vitlog | 0:4ca9c83d7e14 | 51 | /*Конец файла*/ |
vitlog | 0:4ca9c83d7e14 | 52 | #endif |