Add sound manager initial source code
[staging/soundmanager.git] / sample / radio_qml / binding / radio_impl.h
1 /*
2  * Copyright (C) 2017 Konsulko Group
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #ifndef _RADIO_IMPL_H
18 #define _RADIO_IMPL_H
19
20 #include <stdint.h>
21
22 typedef enum {
23         BAND_AM = 0,
24         BAND_FM
25 } radio_band_t;
26
27 typedef enum {
28         SCAN_FORWARD = 0,
29         SCAN_BACKWARD
30 } radio_scan_direction_t;
31
32 typedef void (*radio_scan_callback_t)(uint32_t frequency, void *data);
33
34 typedef void (*radio_freq_callback_t)(uint32_t frequency, void *data);
35
36 typedef enum {
37         MONO = 0,
38         STEREO
39 } radio_stereo_mode_t;
40
41 int radio_impl_init(void);
42
43 uint32_t radio_impl_get_frequency(void);
44
45 void radio_impl_set_frequency(uint32_t frequency);
46
47 void radio_impl_set_frequency_callback(radio_freq_callback_t callback,
48                                        void *data);
49
50 radio_band_t radio_impl_get_band(void);
51
52 void radio_impl_set_band(radio_band_t band);
53
54 int radio_impl_band_supported(radio_band_t band);
55
56 uint32_t radio_impl_get_min_frequency(radio_band_t band);
57
58 uint32_t radio_impl_get_max_frequency(radio_band_t band);
59
60 uint32_t radio_impl_get_frequency_step(radio_band_t band);
61
62 void radio_impl_start(void);
63
64 void radio_impl_stop(void);
65
66 void radio_impl_scan_start(radio_scan_direction_t direction,
67                            radio_scan_callback_t callback,
68                            void *data);
69
70 void radio_impl_scan_stop(void);
71
72 radio_stereo_mode_t radio_impl_get_stereo_mode(void);
73
74 void radio_impl_set_stereo_mode(radio_stereo_mode_t mode);
75
76 #endif /* _RADIO_IMPL_H */