RingInit.cpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* ----------------------------------------------------------------------
  2. * Project: CMSIS DSP Library
  3. * Title: RingInit.cpp
  4. * Description: Initialization of the ring data structure for an audio source
  5. *
  6. * $Date: 30 July 2021
  7. * $Revision: V1.10.0
  8. *
  9. * Target Processor: Cortex-M and Cortex-A cores
  10. * -------------------------------------------------------------------- */
  11. /*
  12. * Copyright (C) 2010-2021 ARM Limited or its affiliates. All rights reserved.
  13. *
  14. * SPDX-License-Identifier: Apache-2.0
  15. *
  16. * Licensed under the Apache License, Version 2.0 (the License); you may
  17. * not use this file except in compliance with the License.
  18. * You may obtain a copy of the License at
  19. *
  20. * www.apache.org/licenses/LICENSE-2.0
  21. *
  22. * Unless required by applicable law or agreed to in writing, software
  23. * distributed under the License is distributed on an AS IS BASIS, WITHOUT
  24. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  25. * See the License for the specific language governing permissions and
  26. * limitations under the License.
  27. */
  28. #include "arm_math.h"
  29. #include "RingConfig.h"
  30. #include "RingInit.h"
  31. #include "RingBuffer.h"
  32. void initRing(ring_config_t *ringConfigRX,
  33. uint8_t *rxBuffer,
  34. uint32_t bufSizeRX,
  35. int rxInterruptID,
  36. ring_config_t *ringConfigTX,
  37. uint8_t *txBuffer,
  38. uint32_t bufSizeTX,
  39. int txInterruptID,
  40. int timeOut)
  41. {
  42. /* Initialization of the ring buffer data structure */
  43. if (ringConfigRX != NULL)
  44. {
  45. ringInit(ringConfigRX,RING_NBBUFS,bufSizeRX,rxBuffer,rxInterruptID,timeOut);
  46. }
  47. if (ringConfigTX != NULL)
  48. {
  49. ringInit(ringConfigTX,RING_NBBUFS,bufSizeTX,txBuffer,txInterruptID,timeOut);
  50. }
  51. }