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.
Diff: LT1446.cpp
- Revision:
- 0:4ca9c83d7e14
diff -r 000000000000 -r 4ca9c83d7e14 LT1446.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/LT1446.cpp Mon Jun 22 09:52:25 2020 +0000
@@ -0,0 +1,33 @@
+#include "LT1446.h"
+//повторное объявление из-за использования внешней переменной и ошибки множественного объявления
+LT1446_MEM_t LT1446_MEM;
+//экземпляр по умолчанию
+LT1446_t LT1446_0;
+
+ void LT1446_CalibrateCh(LT1446_Calibr_t *dac,float k, float b)
+{
+ dac->k=k;
+ dac->b=b;
+}
+//Вычислить значение для передачи в ЦАП
+void LT1446_CalculateCh(LT1446_Calibr_t *dac)
+{
+ dac->Code=(uint16_t)(dac->k*dac->Volts+dac->b);
+ if (dac->Code>4095) dac->Code=4095;
+}
+
+void LT1446_Write(LT1446_t *chip)
+{
+
+
+ LT1446_MEM.DACA=chip->dacA.Code;
+ LT1446_MEM.DACB=chip->dacB.Code;
+ Cs=0;
+ TED2.write(LT1446_MEM.b3);
+ TED2.write(LT1446_MEM.b2);
+ TED2.write(LT1446_MEM.b1);
+ Cs=1;
+}
+
+
+