From 0fde1b98eee06eda8333ae4099a6731a05a14482 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Thu, 12 Nov 2020 09:45:16 -0500 Subject: firmware reorganize; added more sample rates --- source/dac.hpp | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'source/dac.hpp') diff --git a/source/dac.hpp b/source/dac.hpp index dec1b36..542b4a1 100644 --- a/source/dac.hpp +++ b/source/dac.hpp @@ -13,13 +13,25 @@ #define STMDSP_DAC_HPP_ #include "hal.h" +#undef DAC -namespace dac +class DAC { - void init(); - void write_start(unsigned int channel, dacsample_t *buffer, size_t count); - void write_stop(unsigned int channel); -} +public: + static void begin(); + + static void start(int channel, dacsample_t *buffer, size_t count); + static void stop(int channel); + +private: + static DACDriver *m_driver[2]; + static GPTDriver *m_timer; + static int m_timer_user_count; + + static const DACConfig m_config; + static const DACConversionGroup m_group_config; + static const GPTConfig m_timer_config; +}; #endif // STMDSP_DAC_HPP_ -- cgit v1.2.3