wm8776.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /****************************************************************************
  2. * include/nuttx/audio/wm8776.h
  3. *
  4. * Licensed to the Apache Software Foundation (ASF) under one or more
  5. * contributor license agreements. See the NOTICE file distributed with
  6. * this work for additional information regarding copyright ownership. The
  7. * ASF licenses this file to you under the Apache License, Version 2.0 (the
  8. * "License"); you may not use this file except in compliance with the
  9. * License. You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  16. * License for the specific language governing permissions and limitations
  17. * under the License.
  18. *
  19. ****************************************************************************/
  20. #ifndef __INCLUDE_NUTTX_AUDIO_WM8776_H
  21. #define __INCLUDE_NUTTX_AUDIO_WM8776_H
  22. /****************************************************************************
  23. * Included Files
  24. ****************************************************************************/
  25. #include <stdint.h>
  26. #include <stdbool.h>
  27. #include <nuttx/irq.h>
  28. #ifdef CONFIG_AUDIO_WM8776
  29. /****************************************************************************
  30. * Public Types
  31. ****************************************************************************/
  32. struct wm8776_lower_s;
  33. struct wm8776_lower_s
  34. {
  35. /* I2C characterization */
  36. uint32_t frequency; /* Initial I2C frequency */
  37. uint8_t address; /* 7-bit I2C address (only bits 0-6 used) */
  38. };
  39. /****************************************************************************
  40. * Public Data
  41. ****************************************************************************/
  42. #ifdef __cplusplus
  43. #define EXTERN extern "C"
  44. extern "C"
  45. {
  46. #else
  47. #define EXTERN extern
  48. #endif
  49. /****************************************************************************
  50. * Public Function Prototypes
  51. ****************************************************************************/
  52. struct i2c_master_s;
  53. struct i2s_dev_s;
  54. struct audio_lowerhalf_s;
  55. FAR struct audio_lowerhalf_s *
  56. wm8776_initialize(FAR struct i2c_master_s *i2c,
  57. FAR struct i2s_dev_s *i2s,
  58. FAR const struct wm8776_lower_s *lower);
  59. #undef EXTERN
  60. #ifdef __cplusplus
  61. }
  62. #endif
  63. #endif /* CONFIG_AUDIO_WM8776 */
  64. #endif /* __INCLUDE_NUTTX_AUDIO_WM8776_H */