diff options
author | Clyne Sullivan <clyne@bitgloo.com> | 2020-11-12 09:45:16 -0500 |
---|---|---|
committer | Clyne Sullivan <clyne@bitgloo.com> | 2020-11-12 09:45:16 -0500 |
commit | 0fde1b98eee06eda8333ae4099a6731a05a14482 (patch) | |
tree | 263826f916da816b0d7f8bf92b16f34fcc4aeaf6 /source/dac.hpp | |
parent | 1ade2969fb22c6bab4152f5e157f09e3675e8da1 (diff) |
firmware reorganize; added more sample rates
Diffstat (limited to 'source/dac.hpp')
-rw-r--r-- | source/dac.hpp | 22 |
1 files changed, 17 insertions, 5 deletions
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_ |