By mysparkfun71451 -
- Wed Feb 12, 2020 9:20 am
#212176
Per the article "How to Set up the PDM to Achieve 48/16/44.1 KHz Audio Data", from the support.ambiqmicro.com website, the following code will fine tune the Apollo 3 PDM to produce nearly exact PCM audio sampling rates of 48/16/44. 1 KHz:
case AM_HAL_CLKGEN_CONTROL_HFADJ_ENABLE:
_VAL2FLD(CLKGEN_HFADJ_HFXTADJ, 0x5DC) /* 49.152 MHz */
or
_VAL2FLD(CLKGEN_HFADJ_HFXTADJ, 0x562) /* 45.1584 MHz */
The case statement comes from the function "uint32_t am_hal_clkgen_control(am_hal_clkgen_control_e eControl, void *pArgs)" that can be found in the file "am_hal_clkgen.c" from the ambiq sdk.
Will the referenced function work on the Redboard Artemis?
I have tried adding "#include <am_hal_clkgen_h>" and calling the function from within the Arduino IDE but it isn't recognizing the function and treats my call as an improper function definition. Is it possible to "#include" the am_hal_clkgen.h and gain access to the functions in am_hal_clkgen.c from within the Arduino IDE or do I need to use a different interface for this?
case AM_HAL_CLKGEN_CONTROL_HFADJ_ENABLE:
_VAL2FLD(CLKGEN_HFADJ_HFXTADJ, 0x5DC) /* 49.152 MHz */
or
_VAL2FLD(CLKGEN_HFADJ_HFXTADJ, 0x562) /* 45.1584 MHz */
The case statement comes from the function "uint32_t am_hal_clkgen_control(am_hal_clkgen_control_e eControl, void *pArgs)" that can be found in the file "am_hal_clkgen.c" from the ambiq sdk.
Will the referenced function work on the Redboard Artemis?
I have tried adding "#include <am_hal_clkgen_h>" and calling the function from within the Arduino IDE but it isn't recognizing the function and treats my call as an improper function definition. Is it possible to "#include" the am_hal_clkgen.h and gain access to the functions in am_hal_clkgen.c from within the Arduino IDE or do I need to use a different interface for this?