nRF51 SDK - S210 SoftDevice
|
The ADC HAL Example demonstrates the use of the analog-to-digital converter (ADC) peripheral in a simple way. It uses the ADC hardware abstraction layer (HAL).
The example initializes ADC and constantly samples the analog input on pin 2. The output is printed on UART. The example is event-driven, which means that no busy loops are used. Therefore, the CPU can be turned off during inactive periods.
The ADC IRQ handler is called when a new sampling result is available, to store the result in a buffer. The UART event handler is used to manage serial communication by filling the transmission buffer with the string to be sent. The main loop of the example is empty. It is used only to put the CPU into low-power consumption mode.
The name of the example is adc_simple_pca10028. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder: <InstallFolder>\examples\peripheral\adc_simple
Test the ADC HAL Example application by performing the following steps: