Skip to content

Commit 4b3a4ea

Browse files
committed
Update SDK include files
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 7330892 commit 4b3a4ea

File tree

13 files changed

+1394
-26
lines changed

13 files changed

+1394
-26
lines changed

include/audio.h

Lines changed: 235 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,235 @@
1+
/**
2+
* @file audio.h
3+
* @brief Audio APIs for modules based on RDA8910 chipset.
4+
* @date 2023-12-15
5+
*
6+
*/
7+
8+
#ifndef INC_AUDIO_H_
9+
#define INC_AUDIO_H_
10+
11+
#include <stdint.h>
12+
13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
17+
/**
18+
* @brief Audio output channel list
19+
*
20+
*/
21+
enum audio_out_e {
22+
AUDIO_OUTPUT_RECEIVER = 0, /**< receiver */
23+
AUDIO_OUTPUT_HEADPHONE = 1, /**< headphone */
24+
AUDIO_OUTPUT_SPEAKER = 2, /**< speaker */
25+
};
26+
27+
/**
28+
* @brief Audio input channel list
29+
*
30+
*/
31+
enum audio_in_e {
32+
AUDIO_INPUT_MAINMIC = 0, /**< main mic */
33+
AUDIO_INPUT_AUXMIC = 1, /**< auxilary mic */
34+
AUDIO_INPUT_DUALMIC = 2, /**< dual mic */
35+
AUDIO_INPUT_HPMIC_L = 3, /**< headphone mic left */
36+
AUDIO_INPUT_HPMIC_R = 4, /**< headphone mic right */
37+
};
38+
39+
/**
40+
* @brief Audio playback path select
41+
*
42+
*/
43+
enum audio_play_e {
44+
AUDIO_PLAY_LOCAL = 1, /**< Play to local audio path */
45+
AUDIO_PLAY_VOICE = 2, /**< Play to uplink remote during voice call */
46+
};
47+
48+
/**
49+
* @brief Audio recorder path select
50+
*
51+
*/
52+
enum audio_rec_e {
53+
AUDIO_REC_TYPE_MIC = 1, /**< Record from microphone. */
54+
AUDIO_REC_TYPE_VOICE = 2, /**< Record for voice call. The recorded stream is the mixed with uplink and downlink channels */
55+
};
56+
57+
enum audio_qual_e {
58+
AUDIO_QUALITY_LOW, /**< quality low */
59+
AUDIO_QUALITY_MEDIUM, /**< quality medium */
60+
AUDIO_QUALITY_HIGH, /**< quality high */
61+
AUDIO_QUALITY_BEST, /**< quality best */
62+
};
63+
64+
/**
65+
* @brief Audio event callback
66+
*
67+
*/
68+
typedef void (*audio_statuscb_f)(int ev);
69+
70+
/**
71+
* @brief Set output channel for Audio playback
72+
*
73+
* @param ch output channel @ref audio_out_e
74+
* @return 0 for success, error code otherwise
75+
*/
76+
int audio_set_outputchannel(uint32_t ch);
77+
78+
/**
79+
* @brief Get current output channel @ref audio_out_e
80+
*
81+
* @return output channel
82+
*/
83+
int audio_get_outputchannel(void);
84+
85+
/**
86+
* @brief Set audio input channel for recording
87+
*
88+
* @param ch input channel value @ref audio_in_e
89+
* @return 0 for success, error code otherwise
90+
*/
91+
int audio_set_inputchannel(uint32_t ch);
92+
93+
/**
94+
* @brief Get current input channel for recording @ref audio_in_e
95+
*
96+
* @return audio input channel
97+
*/
98+
int audio_get_inputchannel(void);
99+
100+
/**
101+
* @brief Set playback volume. Volume level should in [0, 100].
102+
* 0 is the minimal volume, and 100 is the maximum volume.
103+
* It is possible that the supported volume levels is not 100.
104+
* And then the output is the same for multiple vol.
105+
*
106+
* @param vol Volume level between 0 to 100
107+
* @return 0 for success, error code otherwise
108+
*/
109+
int audio_set_volume(int vol);
110+
111+
/**
112+
* @brief Get current playback volume level.
113+
*
114+
* @return volume level between 0 to 100
115+
*/
116+
int audio_get_volume(void);
117+
118+
/**
119+
* @brief Set volume level for voice call between 0 to 100.
120+
* 0 is the minimal volume, and 100 is the maximum volume.
121+
* It is possible that the supported volume levels is not 100.
122+
* And then the output is the same for multiple vol.
123+
*
124+
* @param vol volume level between 0 to 100
125+
* @return 0 for success, error code otherwise
126+
*/
127+
int audio_set_callvolume(int vol);
128+
129+
/**
130+
* @brief Get current voice call volume.
131+
*
132+
* @return volume level between 0 to 100
133+
*/
134+
int audio_get_callvolume(void);
135+
136+
/**
137+
* @brief mute or unmute audio output device. This setting
138+
* won't be stored, the initial value is always unmute.
139+
*
140+
* @param mute true for mute, false for unmute
141+
* @return 0 for success, error code otherwise
142+
*/
143+
int audio_set_mute(int mute);
144+
145+
/**
146+
* @brief check whether audio output device is muted
147+
*
148+
* @return true if mute, false if unmute
149+
*/
150+
int audio_get_mute(void);
151+
152+
/**
153+
* @brief Play DTMF tone
154+
*
155+
* @param tone DTMF string with valid DTMF characters (0-9,*,#,A,B,C,D)
156+
* @param duration Duration of DTMF tone in milliseconds, 100 to 1000ms.
157+
* @param block True to block till playback finishes, false for non-blocking call
158+
* @param cb Callback function for playback status events
159+
* @return 0 for success, error code otherwise
160+
*/
161+
int audio_play_dtmf(const char *tone, unsigned duration, int block, audio_statuscb_f cb);
162+
163+
/**
164+
* @brief Play audio file. Supported audio file types:
165+
* Raw PCM file
166+
* Wav file
167+
* MP3 audio file
168+
* AMR audio file
169+
*
170+
* @param file Filesystem path of audio file to play
171+
* @param path Aduio output path @ref audio_play_e
172+
* @param cb Callback function for playback status events
173+
* @return 0 for success, error code otherwise
174+
*/
175+
int audio_file_play(const char *file, int path, audio_statuscb_f cb);
176+
177+
/**
178+
* @brief Pause audio file player
179+
*
180+
* @return 0 for success, error code otherwise
181+
*/
182+
int audio_file_pause(void);
183+
184+
/**
185+
* @brief Resume audio file player
186+
*
187+
* @return 0 for success, error code otherwise
188+
*/
189+
int audio_file_resume(void);
190+
191+
/**
192+
* @brief Stop audio file player
193+
*
194+
* @return 0 for success, error code otherwise
195+
*/
196+
int audio_file_stop(void);
197+
198+
/**
199+
* @brief Start audio recorder.
200+
*
201+
* @param fname Filename to store
202+
* @param path Audio recorder path @ref audio_rec_e
203+
* @param quality Audio encoder quality @ref audio_qual_e
204+
* @param duration duration of recording in ms, 0 for continuous recording until stopped or call ends
205+
* @param cb Callback function for recorder status events
206+
* @return 0 for success, error code otherwise
207+
*/
208+
int audio_record_start(const char *fname, int path, int quality, int duration, audio_statuscb_f cb);
209+
210+
/**
211+
* @brief Pause audio recorder
212+
*
213+
* @return 0 for success, error code otherwise
214+
*/
215+
int audio_record_pause(void);
216+
217+
/**
218+
* @brief Resume audio recorder
219+
*
220+
* @return 0 for success, error code otherwise
221+
*/
222+
int audio_record_resume(void);
223+
224+
/**
225+
* @brief Stop audio recorder
226+
*
227+
* @return 0 for success, error code otherwise
228+
*/
229+
int audio_record_stop(void);
230+
231+
#ifdef __cplusplus
232+
}
233+
#endif
234+
235+
#endif /* INC_AUDIO_H_ */

include/console.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,18 @@ enum cli_auth_rc {
3030
typedef int (*cliauth_f)(const char *user, const char *pass);
3131

3232
/**
33-
* Set Authentication function
33+
* Initialize and enable Command line interface for STDIO port
34+
*
3435
* @param fn Pointer to auth function of type @ref cliauth_f
36+
* Set NULL to disable login.
37+
* @return 0 on success, negative value on error
38+
*/
39+
int cli_init(cliauth_f fn);
40+
41+
/**
42+
* Set/Change Authentication function
43+
* @param fn Pointer to auth function of type @ref cliauth_f
44+
* Set NULL to disable login.
3545
* @return 0 on success, negative value on error
3646
*/
3747
int cli_set_authfn(cliauth_f fn);

include/fota.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ int fota_in_progress(void);
3636
/**
3737
* @brief Register with Logicrom FOTA server for automatic firmware
3838
* updates via Device management console. Automatic firmware update
39-
* is checked once a day on server.
39+
* is checked once a day on Waybyte server. This function also enable
40+
* core firmware update checks.
4041
*
4142
* This function also add additional options in "fota" command
4243
*

include/gpslib.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ extern "C"
1616
#endif
1717

1818
/**
19-
* @brief Default harsh breaking/deceleration value - 0.55g
19+
* @brief Default harsh braking/deceleration value - 0.55g
2020
*/
21-
#define DEF_HARSHBREAK 0.55
21+
#define DEF_HARSHBRAKE 0.55
2222
/**
2323
* @brief Default Harsh acceleration value - 0.43g
2424
*/
@@ -48,7 +48,7 @@ enum gpsevent_e {
4848
GPS_EVENT_MOTION_STOP, /**< Motion stop event */
4949
GPS_EVENT_MOTION_START,/**< Motion start event. use @ref gps_get_starttrace
5050
function to get complete movement trace. */
51-
GPS_EVENT_HARSHBREAK, /**< Harsh break detected */
51+
GPS_EVENT_HARSHBRAKE, /**< Harsh brake detected */
5252
GPS_EVENT_OVERACCEL, /**< Harsh/over acceleration detected */
5353
GPS_EVENT_OVERSPEED, /**< Over-speed detected */
5454
GPS_EVENT_SPEED_NORMAL,/**< Speed back to normal, Occurs after over-speed
@@ -68,15 +68,16 @@ enum gpsevent_e {
6868
* GPS Configuration parameter type
6969
*/
7070
enum gpsparam_e {
71-
GPS_PARAM_HARSHBREAK_LIMIT, /**< Set threshold for Harsh breaking in
71+
GPS_PARAM_HARSHBRAKE_LIMIT, /**< Set threshold for Harsh braking in
7272
g (m/s2). Expects param as float */
7373
GPS_PARAM_OVERACCEL_LIMIT, /**< Set threshold for Harsh acceleration in
7474
g (m/s2). Expects param as float */
7575
GPS_PARAM_SPEEDLIMIT, /**< Set over-speed limit in Km/h, expects
7676
param as float */
7777
GPS_PARAM_TURNINGSPEED_LIMIT,/**< Set harsh turning speed limit in Km/h,
7878
expects parameter as float */
79-
GPS_PARAM_ODOMETER, /**< Set odometer value in meters */
79+
GPS_PARAM_ODOMETER, /**< Set odometer value in meters,
80+
expects parameter as double */
8081
};
8182

8283
/**
@@ -129,7 +130,7 @@ struct gpsconfig_t {
129130
int baud; /**< GPS Baudrate */
130131
float speedlimit; /**< Over-speed limit in Km/h */
131132
float harshturn; /**< Harsh Turning speed limit in Km/h */
132-
float harshbrk; /**< Harsh breaking limit in g (m/s2) */
133+
float harshbrake; /**< Harsh braking limit in g (m/s2) */
133134
float overaccel; /**< Harsh acceleration limit in g (m/s2) */
134135
/**
135136
* GPS event callback function

include/hw/bluetooth.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
#ifndef INC_HW_BLUETOOTH_H_
77
#define INC_HW_BLUETOOTH_H_
88

9+
#include "bluetooth_le.h"
10+
911
#ifdef __cplusplus
1012
extern "C"
1113
{
@@ -75,7 +77,8 @@ struct btinfo_t {
7577
* Initialize Bluetooth hardware
7678
* @param mode [in] Bluetooth controller mode see @ref btmode_e
7779
* @param name [in] Name of device shown to other bluetooth device while searching
78-
* @param use_btcli [in] Bluetooth console select (1 to enable, 0 to disable).
80+
* @param use_btcli [in] Bluetooth console select to enable or disable command line interface (CLI)
81+
* on bluetooth(LE) UART interface. (1 to enable, 0 to disable).
7982
* When enabled, /dev/bthost0 device file will not be available
8083
* to the application.
8184
* @return For return value see @ref bterr_e

0 commit comments

Comments
 (0)