AXI Schreiben

This commit is contained in:
Matthias Biermann
2025-02-08 17:22:35 +01:00
parent 529f1a10d2
commit 29d2fb8183
234 changed files with 1120297 additions and 301 deletions
+32
View File
@@ -0,0 +1,32 @@
#pragma once
// -------------------------------------------------------------------------------------------------
// Control Register:
// 0 : Run
// 1 : Interrupt Enable
// 31..2 : Reserved
// -------------------------------------------------------------------------------------------------
// Interrupt Status Register:
// 0 :
// 31..1 :
// -------------------------------------------------------------------------------------------------
// Read Address Register:
// 31..0 : First address of data packets
// -------------------------------------------------------------------------------------------------
// Write Address Register:
// 31..0 : Address to write packets + checksum to
// -------------------------------------------------------------------------------------------------
// Packet Size Register:
// 15.. 0 : Packets Size in words minus 1
// 31..16 : Reserved
// -------------------------------------------------------------------------------------------------
// Number Packets Register:
// 15.. 0 : Number of packets minus 1
// 31..16 : Reserved
// -------------------------------------------------------------------------------------------------
// Polynomail Register:
// 31..0 : Polynomial
// -------------------------------------------------------------------------------------------------
// Intial Value Register:
// 31..0 : Initial Value
// -------------------------------------------------------------------------------------------------
+33
View File
@@ -0,0 +1,33 @@
#include <stdint.h>
int main()
{
volatile uint32_t* base = (uint32_t*) 0x43c00000;
// Schreib- und Leseadresse setzen
base[2] = 0x20000000;
base[3] = 0x30000000;
// Packetgroesse stzen
base[4] = 20;
base[5] = 5;
// Generatorpolynom und Initialwert setzen
base[6] = 0x04C11DB7;
base[7] = 00000000;
// Interrupt aktivieren und starten
base[0] = base[0] | 0x00000002;
while (1) {
// Interrupt status abfragen
if ((base[1] & 0x1) == 0x1) {
//Interrupt zuruecksetzen
base[1] &= ~(1<<0);
base[0] |= (1<<0);
}
}
return 0;
}