- Thu Mar 11, 2021 11:39 am
#223907
If you are using the Arduino environment, just paste that sample code in your setup() function. You can switch between normal and turbo whenever you want. If battery life is important, leave the processor in normal mode. If your application needs to do some serious crunching for a bit of time, you might want to enable turbo mode, do the crunching, and turn it off again to save power. Honestly, I would bet that 95% of applications don't actually need Turbo mode.
To figure out what the HAL can do for you, the best thing to do is to download it from the Ambiq website and scan over the Ambiq HAL source code header files. It is well documented and easy to read.
Anything in the HAL is available from within Arduino: if you read about a HAL function in the Ambiq source, just call it like I did in the example from the previous post and the Sparkfun Arduino environment will take care of linking it all together. It's quite nice. For the most part, the Arduino environment already takes care of calling the HAL for you. For example, you could call the HAL to do serial IO, but the Arduino environment already implement the Serial class. Using the Arduino classes makes it easier to port in Arduino software libraries written by 3rd parties.