فهرست منبع

Добавил инициализацию MAX2870

Anatoliy Chigirinskiy 1 سال پیش
والد
کامیت
178f490dd0
4فایلهای تغییر یافته به همراه31 افزوده شده و 0 حذف شده
  1. 1 0
      CMakeLists.txt
  2. 22 0
      Devices/max2870.c
  3. 6 0
      Devices/max2870.h
  4. 2 0
      main.c

+ 1 - 0
CMakeLists.txt

@@ -6,6 +6,7 @@ add_executable(TMSG44_CoolPi command.c main.c
         Devices/lmk04821.c
         Devices/lmx2594.c
         Devices/dac8811.c
+        Devices/max2870.c
         Devices/tmsgheaders.c)
 
 target_link_libraries(TMSG44_CoolPi m)

+ 22 - 0
Devices/max2870.c

@@ -0,0 +1,22 @@
+#include "max2870.h"
+
+
+const uint32_t max2870_regs[] ={
+    0x80280000,
+    0x800303E9,
+    0x94005E42,
+    0x00000133,
+    0x638E80FC,
+    0x01400005
+};
+
+void max2870_init(void *bar1) {
+    //Init Header
+    uint32_t *ptr = bar1 + MAX2870_BASE_ADDR;
+    *ptr = InitMAX2870Header;
+    //Init Data
+    for (int k = 0; k < sizeof(max2870_regs)/4; k++) {
+        uint32_t *ptr = bar1 + MAX2870_BASE_ADDR;
+        *ptr = max2870_regs[k];
+    }
+}

+ 6 - 0
Devices/max2870.h

@@ -0,0 +1,6 @@
+#include "tmsgheaders.h"
+
+
+#define     MAX2870_BASE_ADDR       0x04
+
+void max2870_init(void *bar1);

+ 2 - 0
main.c

@@ -12,6 +12,7 @@
 
 #include "Devices//tmsgheaders.h"
 #include "Devices//lmx2594.h"
+#include "Devices//max2870.h"
 #include "Devices//lmk04821.h"
 #include "Devices//ad9912.h"
 
@@ -107,6 +108,7 @@ int main(int argc, char *argv[])
     rst_for_fpga(bar1);
     shift_reg(bar1);
     ad9912_init(bar1);
+	max2870_init(bar1);
     lmx2594_init(bar1);
 
 	// Установка обработчика сигналов