drv_ac97.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * File : drv_ac97.h
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2017, RT-Thread Development Team
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. * Change Logs:
  21. * Date Author Notes
  22. * 2018-05-25 RT-Thread the first version
  23. */
  24. #ifndef __DRV_AC97_H__
  25. #define __DRV_AC97_H__
  26. /* Register offsets */
  27. #define AC97_RESET 0x00
  28. #define AC97_MASTER 0x02
  29. #define AC97_HEADPHONE 0x04
  30. #define AC97_MASTER_MONO 0x06
  31. #define AC97_MASTER_TONE 0x08
  32. #define AC97_PC_BEEP 0x0A //mixer volume
  33. #define AC97_PHONE 0x0C
  34. #define AC97_MIC 0x0E //qwert db
  35. #define AC97_LINE 0x10
  36. #define AC97_CD 0x12
  37. #define AC97_VIDEO 0x14
  38. #define AC97_AUX 0x16
  39. #define AC97_PCM 0x18
  40. #define AC97_REC_SEL 0x1A //0 represent mic
  41. #define AC97_REC_GAIN 0x1C
  42. #define AC97_REC_GAIN_MIC 0x1E
  43. #define AC97_GENERAL_PURPOSE 0x20
  44. #define AC97_3D_CONTROL 0x22
  45. #define AC97_INT_PAGING 0x24 //qwert
  46. #define AC97_POWERDOWN 0x26
  47. #define AC97_PCM_FRONT_DAC_RATE 0x2c /* PCM Front DAC Rate */
  48. #define AC97_PCM_SURR_DAC_RATE 0x2e /* PCM Surround DAC Rate */
  49. #define AC97_PCM_LFE_DAC_RATE 0x30 /* PCM LFE DAC Rate */
  50. #define AC97_PCM_LR_ADC_RATE 0x32 /* PCM LR ADC Rate */
  51. #define AC97_PCM_MIC_ADC_RATE 0x34 /* PCM MIC ADC Rate */
  52. #define AC97_DAC_SLOT_MAP 0x6C
  53. #define AC97_ADC_SLOT_MAP 0x6E
  54. void ac97_reset(void);
  55. rt_err_t ac97_set_vol(int vol);
  56. int ac97_get_vol(void);
  57. rt_err_t ac97_set_rate(int rate);
  58. int ac97_get_rate(void);
  59. #endif