aboutsummaryrefslogtreecommitdiff
path: root/02-usart/include
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-22 01:06:30 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-22 01:06:30 -0700
commit9f28e53c71d28d04e2775c59944d2887a99f1e86 (patch)
treec0ecb2872c6d27acf08aa73919d709f949200de5 /02-usart/include
parentebb9123c00d1e9629376b6f0a2f1f4e7e550c2af (diff)
downloadstm32l4-9f28e53c71d28d04e2775c59944d2887a99f1e86.tar.gz
stm32l4-9f28e53c71d28d04e2775c59944d2887a99f1e86.tar.bz2
stm32l4-9f28e53c71d28d04e2775c59944d2887a99f1e86.zip
Large reorganization.
What was in core/ is now moved to arch/stm34l4xxx/peripherals. This new directory is *supposed to* to contain raw header files defining just the pertinent register structures for the various peripherals. Peripheral management belongs somewhere in the new `kern/..` directories. This is not completely the case at the moment, so more refactoring needs to be done. What was sitting in the root has now been moved into the kern/ directory. The kern/ directory is to contain everything else other than raw device register definitions. The root of the kern/ tree is reserved for standard library-esque headers. The kern/<peripheral> directory contains management systems for that peripheral. (At the moment DMA is the only peripheral with a decent management system.) Preferably these peripheral systems should only include their correlating header in arch/stm34l4xxx/peripherals, and use other management systems for handling other peripherals rather than manipulating their raw registers directly. (Though this ideal will require much more critical mass of management systems.)
Diffstat (limited to '02-usart/include')
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/apb.h (renamed from 02-usart/include/core/apb.h)0
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/clock.h (renamed from 02-usart/include/core/clock.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/dma.h (renamed from 02-usart/include/core/dma.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/flash.h (renamed from 02-usart/include/core/flash.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/gpio.h (renamed from 02-usart/include/core/gpio.h)4
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/irq.h (renamed from 02-usart/include/core/irq.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/isrs.inc (renamed from 02-usart/include/core/isrs.inc)0
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/nvic.h (renamed from 02-usart/include/core/nvic.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/rcc.h (renamed from 02-usart/include/core/rcc.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/spi.h (renamed from 02-usart/include/core/spi.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/system.h (renamed from 02-usart/include/core/system.h)2
-rw-r--r--02-usart/include/arch/stm32l4xxx/peripherals/usart.h (renamed from 02-usart/include/core/usart.h)4
-rw-r--r--02-usart/include/kern/common.h (renamed from 02-usart/include/common.h)0
-rw-r--r--02-usart/include/kern/delay.h (renamed from 02-usart/include/delay.h)0
-rw-r--r--02-usart/include/kern/dma/dma_manager.h (renamed from 02-usart/include/peri/dma.h)6
-rw-r--r--02-usart/include/kern/lib.h (renamed from 02-usart/include/lib.h)0
-rw-r--r--02-usart/include/kern/mem.h (renamed from 02-usart/include/mem.h)0
-rw-r--r--02-usart/include/kern/spin.h (renamed from 02-usart/include/spin.h)0
-rw-r--r--02-usart/include/kern/string.h6
19 files changed, 21 insertions, 15 deletions
diff --git a/02-usart/include/core/apb.h b/02-usart/include/arch/stm32l4xxx/peripherals/apb.h
index 11fa7ab..11fa7ab 100644
--- a/02-usart/include/core/apb.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/apb.h
diff --git a/02-usart/include/core/clock.h b/02-usart/include/arch/stm32l4xxx/peripherals/clock.h
index c3c58d7..6e461de 100644
--- a/02-usart/include/core/clock.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/clock.h
@@ -2,7 +2,7 @@
#define CORE_CLOCK_H__
#include <stdint.h>
-#include "rcc.h"
+#include "arch/stm32l4xxx/peripherals/rcc.h"
#define PERIPH_BASE ((uint32_t)0x40000000)
#define AHBPERIPH_BASE (PERIPH_BASE + 0x00020000)
diff --git a/02-usart/include/core/dma.h b/02-usart/include/arch/stm32l4xxx/peripherals/dma.h
index 8e4896d..f62a92b 100644
--- a/02-usart/include/core/dma.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/dma.h
@@ -10,7 +10,7 @@
* There are 2 DMA's on the chip. Each with 7 channels.
*/
-#include "common.h"
+#include "kern/common.h"
#include <arch.h>
#include <stdint.h>
diff --git a/02-usart/include/core/flash.h b/02-usart/include/arch/stm32l4xxx/peripherals/flash.h
index a163a25..28a3d6c 100644
--- a/02-usart/include/core/flash.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/flash.h
@@ -1,7 +1,7 @@
#ifndef H__FLASH_
#define H__FLASH_
-#include "common.h"
+#include "kern/common.h"
/*
* Header file for dealing with flash.
diff --git a/02-usart/include/core/gpio.h b/02-usart/include/arch/stm32l4xxx/peripherals/gpio.h
index 54963b1..20acf71 100644
--- a/02-usart/include/core/gpio.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/gpio.h
@@ -1,8 +1,8 @@
#ifndef CORE_GPIO_H__
#define CORE_GPIO_H__
-#include "common.h"
-#include "rcc.h"
+#include "kern/common.h"
+#include "arch/stm32l4xxx/peripherals/rcc.h"
#include <stdint.h>
diff --git a/02-usart/include/core/irq.h b/02-usart/include/arch/stm32l4xxx/peripherals/irq.h
index f2fe8d9..52878ca 100644
--- a/02-usart/include/core/irq.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/irq.h
@@ -11,7 +11,7 @@ typedef enum {
#define IRQ_RESERVED(n)
#define IRQ(name_, uname, num) \
IRQ_##uname = num,
-#include "core/isrs.inc"
+#include "arch/stm32l4xxx/peripherals//isrs.inc"
#undef IRQ
#undef IRQ_RESERVED
} interrupt_t;
diff --git a/02-usart/include/core/isrs.inc b/02-usart/include/arch/stm32l4xxx/peripherals/isrs.inc
index 0682238..0682238 100644
--- a/02-usart/include/core/isrs.inc
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/isrs.inc
diff --git a/02-usart/include/core/nvic.h b/02-usart/include/arch/stm32l4xxx/peripherals/nvic.h
index c761574..1645a2d 100644
--- a/02-usart/include/core/nvic.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/nvic.h
@@ -2,7 +2,7 @@
#define NVIC_H_
#include "arch.h"
-#include "common.h"
+#include "kern/common.h"
typedef __IO struct {
#define nvic_intlinesnum (0x0F << 0)
diff --git a/02-usart/include/core/rcc.h b/02-usart/include/arch/stm32l4xxx/peripherals/rcc.h
index 45f64b5..861504e 100644
--- a/02-usart/include/core/rcc.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/rcc.h
@@ -2,7 +2,7 @@
#define H__RCC_
#include "arch.h"
-#include "common.h"
+#include "kern/common.h"
#include <stdint.h>
typedef struct {
diff --git a/02-usart/include/core/spi.h b/02-usart/include/arch/stm32l4xxx/peripherals/spi.h
index 77cd61e..a39a0bb 100644
--- a/02-usart/include/core/spi.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/spi.h
@@ -1,7 +1,7 @@
#ifndef CORE_SPI_H_
#define CORE_SPI_H_
-#include "common.h"
+#include "kern/common.h"
#include "arch.h"
#define SPI1 (*((spi_t*)(SPI1_BASE)))
diff --git a/02-usart/include/core/system.h b/02-usart/include/arch/stm32l4xxx/peripherals/system.h
index a636729..b6ff0a6 100644
--- a/02-usart/include/core/system.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/system.h
@@ -2,7 +2,7 @@
#define CORE_SYSTEM_H_
#include <stdint.h>
-#include "common.h"
+#include "kern/common.h"
typedef __IO struct {
uint32_t actl_r; /* Auxiliary Control Register, ACTLR on page 4-5 */
diff --git a/02-usart/include/core/usart.h b/02-usart/include/arch/stm32l4xxx/peripherals/usart.h
index 8d841df..e42e31e 100644
--- a/02-usart/include/core/usart.h
+++ b/02-usart/include/arch/stm32l4xxx/peripherals/usart.h
@@ -4,8 +4,8 @@
#include <arch.h>
#include <stdint.h>
-#include "common.h"
-#include "rcc.h"
+#include "kern/common.h"
+#include "arch/stm32l4xxx/peripherals/rcc.h"
#include <assert.h>
#define USART1 (* (usart_t*) USART1_BASE)
diff --git a/02-usart/include/common.h b/02-usart/include/kern/common.h
index 653279e..653279e 100644
--- a/02-usart/include/common.h
+++ b/02-usart/include/kern/common.h
diff --git a/02-usart/include/delay.h b/02-usart/include/kern/delay.h
index 65a26d6..65a26d6 100644
--- a/02-usart/include/delay.h
+++ b/02-usart/include/kern/delay.h
diff --git a/02-usart/include/peri/dma.h b/02-usart/include/kern/dma/dma_manager.h
index d3cac4b..0d17bd5 100644
--- a/02-usart/include/peri/dma.h
+++ b/02-usart/include/kern/dma/dma_manager.h
@@ -1,9 +1,9 @@
#ifndef PERI_DMA_H_
#define PERI_DMA_H_
-#include "common.h"
-#include "core/dma.h" /* Access to the DMA registers. */
-#include "core/irq.h"
+#include "kern/common.h"
+#include "arch/stm32l4xxx/peripherals/dma.h" /* Access to the DMA registers. */
+#include "arch/stm32l4xxx/peripherals/irq.h"
#define DMA_ERROR_CHANNEL_IN_USE 1
diff --git a/02-usart/include/lib.h b/02-usart/include/kern/lib.h
index be0e8e9..be0e8e9 100644
--- a/02-usart/include/lib.h
+++ b/02-usart/include/kern/lib.h
diff --git a/02-usart/include/mem.h b/02-usart/include/kern/mem.h
index d150744..d150744 100644
--- a/02-usart/include/mem.h
+++ b/02-usart/include/kern/mem.h
diff --git a/02-usart/include/spin.h b/02-usart/include/kern/spin.h
index a23d25b..a23d25b 100644
--- a/02-usart/include/spin.h
+++ b/02-usart/include/kern/spin.h
diff --git a/02-usart/include/kern/string.h b/02-usart/include/kern/string.h
new file mode 100644
index 0000000..3c9f0b4
--- /dev/null
+++ b/02-usart/include/kern/string.h
@@ -0,0 +1,6 @@
+#ifndef STRING_H_
+#define STRING_H_
+
+void kstrcpy(char* into, const char* from);
+
+#endif /* STRING_H_ */