Simple FM radio playback
Simple FM radio playback for defined frequency. The frequency to set [87500 ~ 108000] (kHz). Radio is available only when headset is lugged in.
#include <dlog.h> // for logging purposes
#include <radio.h>
radio_h radio_handle;
void
start_radio(int frequency) {
if(radio_create(&radio_handle) == RADIO_ERROR_NONE) {
if(radio_set_frequency(radio_handle, frequency) == RADIO_ERROR_NONE) {
radio_start(radio_handle);
LOGI("Radio listen started");
}
}
// To stop radio use:
// radio_stop(radio_handle);
// To destroy radio handle and release all its resources use:
// radio_destroy(radio_handle);
}