drv_ac97.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2018-05-25 RT-Thread the first version
  9. */
  10. #ifndef __DRV_AC97_H__
  11. #define __DRV_AC97_H__
  12. /* Register offsets */
  13. #define AC97_RESET 0x00
  14. #define AC97_MASTER 0x02
  15. #define AC97_HEADPHONE 0x04
  16. #define AC97_MASTER_MONO 0x06
  17. #define AC97_MASTER_TONE 0x08
  18. #define AC97_PC_BEEP 0x0A //mixer volume
  19. #define AC97_PHONE 0x0C
  20. #define AC97_MIC 0x0E //qwert db
  21. #define AC97_LINE 0x10
  22. #define AC97_CD 0x12
  23. #define AC97_VIDEO 0x14
  24. #define AC97_AUX 0x16
  25. #define AC97_PCM 0x18
  26. #define AC97_REC_SEL 0x1A //0 represent mic
  27. #define AC97_REC_GAIN 0x1C
  28. #define AC97_REC_GAIN_MIC 0x1E
  29. #define AC97_GENERAL_PURPOSE 0x20
  30. #define AC97_3D_CONTROL 0x22
  31. #define AC97_INT_PAGING 0x24 //qwert
  32. #define AC97_POWERDOWN 0x26
  33. #define AC97_PCM_FRONT_DAC_RATE 0x2c /* PCM Front DAC Rate */
  34. #define AC97_PCM_SURR_DAC_RATE 0x2e /* PCM Surround DAC Rate */
  35. #define AC97_PCM_LFE_DAC_RATE 0x30 /* PCM LFE DAC Rate */
  36. #define AC97_PCM_LR_ADC_RATE 0x32 /* PCM LR ADC Rate */
  37. #define AC97_PCM_MIC_ADC_RATE 0x34 /* PCM MIC ADC Rate */
  38. #define AC97_DAC_SLOT_MAP 0x6C
  39. #define AC97_ADC_SLOT_MAP 0x6E
  40. void ac97_reset(void);
  41. rt_err_t ac97_set_vol(int vol);
  42. int ac97_get_vol(void);
  43. rt_err_t ac97_set_rate(int rate);
  44. int ac97_get_rate(void);
  45. #endif