From 960c8956b2a9e2692a5649f15e1467ed26ce8300 Mon Sep 17 00:00:00 2001 From: Paul Mathieu Date: Sat, 13 Mar 2021 15:47:24 -0800 Subject: [PATCH] wave: add header --- wave/wave.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 wave/wave.h diff --git a/wave/wave.h b/wave/wave.h new file mode 100644 index 0000000..50fe93b --- /dev/null +++ b/wave/wave.h @@ -0,0 +1,20 @@ +#pragma once + +struct pdmout { + volatile uint16_t amplitude; + volatile uint16_t flags; +}; + +#define PDMOUT_FLAG_ENABLE_pos 0 +#define PDMOUT_FLAG_ENABLE_msk (1 << PDMOUT_FLAG_ENABLE_pos) + +struct square { + volatile uint16_t period; + volatile uint16_t high_val; + volatile uint16_t low_val; + volatile uint16_t output_address; + volatile uint16_t flags; +}; + +#define SQUARE_FLAG_ENABLE_pos 0 +#define SQUARE_FLAG_ENABLE_msk (1 << SQUARE_FLAG_ENABLE_pos)