drv_i2s.h 848 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2006-2023, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2023-03-12 Vandoul the first version
  9. */
  10. #ifndef __DRV_I2S_H__
  11. #define __DRV_I2S_H__
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #include <rtthread.h>
  16. #pragma pack(push,1)
  17. struct lpc_i2s_config
  18. {
  19. uint32_t sampling_rate;
  20. uint8_t mode;
  21. uint8_t data_bits;
  22. uint8_t channels;
  23. uint8_t is_blocking;
  24. };
  25. #pragma pack(pop)
  26. #define LPC_I2S_CONFIG_MODE_NULL 0
  27. #define LPC_I2S_CONFIG_MODE_SLAVE 1
  28. #define LPC_I2S_CONFIG_MODE_MASTER 2
  29. #define RT_I2S_CTRL_RESET (RT_DEVICE_CTRL_BASE(Bus) + 1)
  30. #define RT_I2S_CTRL_SET_CONFIG (RT_DEVICE_CTRL_BASE(Bus) + 2)
  31. #ifdef __cplusplus
  32. }
  33. #endif
  34. #endif