summaryrefslogtreecommitdiffstats
path: root/usb
diff options
context:
space:
mode:
Diffstat (limited to 'usb')
-rw-r--r--usb/bdt.h24
-rw-r--r--usb/descriptors.h24
-rw-r--r--usb/endpt0.c18
-rw-r--r--usb/endpt0.h24
-rw-r--r--usb/endpt1.c18
-rw-r--r--usb/endpt1.h24
-rw-r--r--usb/hid.h24
-rw-r--r--usb/usb.c18
-rw-r--r--usb/usb.h24
9 files changed, 180 insertions, 18 deletions
diff --git a/usb/bdt.h b/usb/bdt.h
index f4bc57d..486111d 100644
--- a/usb/bdt.h
+++ b/usb/bdt.h
@@ -1,5 +1,23 @@
-#ifndef USB_BDT_H
-#define USB_BDT_H
+/*
+ * usb/bdt.h -- USB BDT
+ *
+ * Copyright (C) 2016-2017 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef FMK_USB_BDT_H
+#define FMK_USB_BDT_H
#include <reg/usbotg.h>
@@ -10,4 +28,4 @@ extern volatile struct usb0_bd usb_bdt[2][2][2];
#define BDT_EVEN 0
#define BDT_ODD 1
-#endif /* USB_BDT_H */
+#endif /* FMK_USB_BDT_H */
diff --git a/usb/descriptors.h b/usb/descriptors.h
index 6ebfded..122ba5c 100644
--- a/usb/descriptors.h
+++ b/usb/descriptors.h
@@ -1,5 +1,23 @@
-#ifndef USB_DESCRIPTORS_H
-#define USB_DESCRIPTORS_H
+/*
+ * usb/descriptors.h -- USB Descriptors
+ *
+ * Copyright (C) 2016-2017 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef FMK_USB_DESCRIPTORS_H
+#define FMK_USB_DESCRIPTORS_H
#include "hid.h"
@@ -130,4 +148,4 @@ unsigned char ds_str1[] = {
};
_Static_assert(sizeof ds_str1 == DS_STR1_SIZE, "sizeof ds_str1 != DS_STR1_SIZE");
-#endif /* USB_DESCRIPTORS_H */
+#endif /* FMK_USB_DESCRIPTORS_H */
diff --git a/usb/endpt0.c b/usb/endpt0.c
index c4c3360..57c994e 100644
--- a/usb/endpt0.c
+++ b/usb/endpt0.c
@@ -1,3 +1,21 @@
+/*
+ * usb/endpt0.c -- USB endpoint 0 (control) handling
+ *
+ * Copyright (C) 2016-2017 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <arrlen.h>
#include <le.h>
#include <reg/usbotg.h>
diff --git a/usb/endpt0.h b/usb/endpt0.h
index 4ba89ed..706b9f5 100644
--- a/usb/endpt0.h
+++ b/usb/endpt0.h
@@ -1,5 +1,23 @@
-#ifndef USB_ENDPT0_H
-#define USB_ENDPT0_H
+/*
+ * usb/endpt0.h -- USB endpoint 0 (control) handling
+ *
+ * Copyright (C) 2016 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef FMK_USB_ENDPT0_H
+#define FMK_USB_ENDPT0_H
#include <stdint.h>
@@ -7,4 +25,4 @@ void usb_endpt0_disable(void);
void usb_endpt0_enable(void);
void usb_endpt0_token(uint8_t state);
-#endif /* USB_ENDPT0_H */
+#endif /* FMK_USB_ENDPT0_H */
diff --git a/usb/endpt1.c b/usb/endpt1.c
index 65684b5..3139104 100644
--- a/usb/endpt1.c
+++ b/usb/endpt1.c
@@ -1,3 +1,21 @@
+/*
+ * usb/endpt1.c -- USB endpoit 1 (HID) handling
+ *
+ * Copyright (C) 2016-2017 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <reg/usbotg.h>
#include <stddef.h>
#include <stdint.h>
diff --git a/usb/endpt1.h b/usb/endpt1.h
index 9be7522..fa26bd9 100644
--- a/usb/endpt1.h
+++ b/usb/endpt1.h
@@ -1,8 +1,26 @@
-#ifndef USB_ENDPT1_H
-#define USB_ENDPT1_H
+/*
+ * usb/endpt1.h -- USB endpoit 1 (HID) handling
+ *
+ * Copyright (C) 2016 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef FMK_USB_ENDPT1_H
+#define FMK_USB_ENDPT1_H
void usb_endpt1_enable(void);
void usb_endpt1_disable(void);
void usb_endpt1_token(uint8_t state);
-#endif /* USB_ENDPT1_H */
+#endif /* FMK_USB_ENDPT1_H */
diff --git a/usb/hid.h b/usb/hid.h
index 949cf8e..102cece 100644
--- a/usb/hid.h
+++ b/usb/hid.h
@@ -1,5 +1,23 @@
-#ifndef USB_HID_H
-#define USB_HID_H
+/*
+ * usb/hid.h -- USB HID definitions
+ *
+ * Copyright (C) 2017 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef FMK_USB_HID_H
+#define FMK_USB_HID_H
#define SHORT_ITEM(tag, type, size) (((tag) & 0xf) << 4 | \
((type) & 0x3) << 2 | \
@@ -84,4 +102,4 @@
#define HR_BIT_FIELD (0)
#define HR_BUFFERED_BYTES (1 << 8)
-#endif /* USB_HID_H */
+#endif /* FMK_USB_HID_H */
diff --git a/usb/usb.c b/usb/usb.c
index 5a76825..5f00fe0 100644
--- a/usb/usb.c
+++ b/usb/usb.c
@@ -1,3 +1,21 @@
+/*
+ * usb/usb.c -- USB 2.0 implementation
+ *
+ * Copyright (C) 2016-2017 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
#include <cm4.h>
#include <reg/gpio.h>
#include <reg/sim.h>
diff --git a/usb/usb.h b/usb/usb.h
index 64d0585..1d84968 100644
--- a/usb/usb.h
+++ b/usb/usb.h
@@ -1,7 +1,25 @@
-#ifndef USB_H
-#define USB_H
+/*
+ * usb/usb.h -- USB 2.0 implementation
+ *
+ * Copyright (C) 2016 Tomasz Kramkowski <tk@the-tk.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef FMK_USB_H
+#define FMK_USB_H
void usb_setup(void);
void usb_isr(void);
-#endif /* USB_H */
+#endif /* FMK_USB_H */