From 1cf55e2225faecbdabb0ff8b9b606f7192ae0f91 Mon Sep 17 00:00:00 2001 From: shinyquagsire23 Date: Thu, 6 Jun 2024 00:47:37 -0600 Subject: [PATCH] audio wip, PIO beep but no DMA --- Makefile | 1 + bdk/audio/ahub.c | 276 ++++++++++++++++++++++++++++++++++++ bdk/audio/ahub.h | 192 +++++++++++++++++++++++++ bdk/audio/i2s.h | 99 +++++++++++++ bdk/audio/rt5639.c | 337 ++++++++++++++++++++++++++++++++++++++++++++ bdk/audio/rt5639.h | 222 +++++++++++++++++++++++++++++ bdk/bdk.h | 1 + bdk/soc/clock.c | 116 ++++++++++++++- bdk/soc/clock.h | 17 ++- bdk/soc/hw_init.c | 3 + bdk/soc/pinmux.c | 5 + bdk/soc/pinmux.h | 11 ++ bdk/soc/pmc.c | 16 +++ bdk/soc/pmc.h | 12 +- bdk/soc/t210.h | 2 + bootloader/link.ld | 1 + nyx/nyx_gui/link.ld | 1 + 17 files changed, 1303 insertions(+), 9 deletions(-) create mode 100644 bdk/audio/ahub.c create mode 100644 bdk/audio/ahub.h create mode 100644 bdk/audio/i2s.h create mode 100644 bdk/audio/rt5639.c create mode 100644 bdk/audio/rt5639.h diff --git a/Makefile b/Makefile index 58f0134..c508d0a 100755 --- a/Makefile +++ b/Makefile @@ -31,6 +31,7 @@ OBJS = $(addprefix $(BUILDDIR)/$(TARGET)/, \ # Hardware. OBJS += $(addprefix $(BUILDDIR)/$(TARGET)/, \ + rt5639.o ahub.o \ bpmp.o ccplex.o clock.o di.o i2c.o irq.o timer.o \ mc.o sdram.o minerva.o \ gpio.o pinmux.o pmc.o se.o smmu.o tsec.o uart.o \ diff --git a/bdk/audio/ahub.c b/bdk/audio/ahub.c new file mode 100644 index 0000000..b0948aa --- /dev/null +++ b/bdk/audio/ahub.c @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2018 naehrwert + * Copyright (c) 2018-2024 CTCaer + * Copyright (c) 2018-2024 shinyquagsire23 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope 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 . + */ + +#include + +#include