adac.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Squeezelite for esp32
  3. *
  4. * (c) Sebastien 2019
  5. * Philippe G. 2019, philippe_44@outlook.com
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #include "freertos/FreeRTOS.h"
  22. #include "driver/i2s.h"
  23. typedef enum { ADAC_ON = 0, ADAC_STANDBY, ADAC_OFF } adac_power_e;
  24. struct adac_s {
  25. bool (*init)(int i2c_port_num, int i2s_num, i2s_config_t *config);
  26. void (*deinit)(void);
  27. void (*power)(adac_power_e mode);
  28. void (*speaker)(bool active);
  29. void (*headset)(bool active);
  30. void (*volume)(unsigned left, unsigned right);
  31. };
  32. extern struct adac_s dac_tas57xx;
  33. extern struct adac_s dac_a1s;
  34. extern struct adac_s dac_null;