Skip to content

Commit 4e4e1cb

Browse files
committed
Update logicrom SDK files
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 6ae1aa4 commit 4e4e1cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+840
-3171
lines changed

cores/logicrom/logicromsdk/include/arpa/inet.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ uint32_t ntohl(uint32_t x);
9494
*/
9595
uint16_t ntohs(uint16_t x);
9696

97-
#if defined(PLATFORM_BC20) || defined(_DOXYGEN_)
9897
/**
9998
* Convert IPv4 and IPv6 addresses from binary to text form
99+
* @note unavailable on GSM platform
100+
*
100101
* @param af [in] Address family
101102
* @param src [in] Source buffer containing binary address
102103
* @param dst [out] destination buffer to store converted text
@@ -107,13 +108,14 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
107108

108109
/**
109110
* Convert IPv4 and IPv6 addresses from text to binary form
111+
* @note unavailable on GSM platform
112+
*
110113
* @param af [in] Address family
111114
* @param src [in] points to a character string containing an IPv4/IPv6 network address
112115
* @param dst [out] pointer to which to save the address in network order
113116
* @return
114117
*/
115118
int inet_pton(int af, const char *src, void *dst);
116-
#endif
117119

118120
#ifdef __cplusplus
119121
}

cores/logicrom/logicromsdk/include/driver/onewire.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* OneWire library based optimized for GSM Module
2+
* OneWire library optimized for Wireless Modules
33
*
44
* This library is based on:
55
* https://github.com/PaulStoffregen/OneWire
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/**
2+
* @file filter.h
3+
* @author Ajay Bhargav
4+
* @brief Filter library to use with ADC
5+
*
6+
*/
7+
8+
#ifndef INC_FILTER_H_
9+
#define INC_FILTER_H_
10+
11+
#ifdef __cplusplus
12+
extern "C"
13+
{
14+
#endif
15+
16+
typedef void* filter_t;
17+
18+
/**
19+
* @brief Initialize filter
20+
*
21+
* @param init_val Initial value to set or start with
22+
* @return filter handle
23+
*/
24+
filter_t filter_init(float init_val);
25+
26+
/**
27+
* @brief Update filter and get current estimate value
28+
*
29+
* @param handle filter handle returned by filter_init()
30+
* @param val measured value
31+
* @return current estimate value
32+
*/
33+
float filter_update(filter_t handle, float val);
34+
35+
/**
36+
* @brief Set filter level
37+
*
38+
* Level value range from 0 to 10. 0 means faster update
39+
* and 10 means slower update when filter is updated
40+
*
41+
* @param handle filter handle returned by filter_init()
42+
* @param level filter level 0 to 10
43+
* @return 1 if filter is updated, 0 if no change is made and current level is same as set level
44+
*/
45+
int filter_setlevel(filter_t handle, int level);
46+
47+
/**
48+
* @brief Get filter level
49+
*
50+
* The return level is from 0 to 10 for preset values of variance_q and estimate error.
51+
* when custom value is set 11 is returned.
52+
*
53+
* @param handle filter handle returned by filter_init()
54+
* @return filter level value from 0 to 11
55+
*/
56+
int filter_getlevel(filter_t handle);
57+
58+
/**
59+
* @brief Set custom q and estimate error values
60+
*
61+
* @param handle filter handle returned by filter_init()
62+
* @param variance_q Covariance Q value lower the value, slower the response
63+
* @param est_error Estimate error to start with
64+
* @return 1 if filter is updated, 0 if no change is made
65+
*/
66+
int filter_setconfig(filter_t handle, float variance_q, float est_error);
67+
68+
/**
69+
* @brief Get values set for filter
70+
*
71+
* @param handle filter handle returned by filter_init()
72+
* @param variance_q Covariance Q value
73+
* @param est_error Estimate error value
74+
* @return returns 0 always
75+
*/
76+
int filter_getconfig(filter_t handle, float *variance_q, float *est_error);
77+
78+
/**
79+
* @brief Get error estimate calculated by filter
80+
*
81+
* @param handle filter handle returned by filter_init()
82+
* @return current measured error estimate
83+
*/
84+
float filter_get_estmate_error(filter_t handle);
85+
86+
/**
87+
* @brief Get filter gain
88+
*
89+
* @param handle filter handle returned by filter_init()
90+
* @return current filter gain
91+
*/
92+
float filter_get_gain(filter_t handle);
93+
94+
#ifdef __cplusplus
95+
}
96+
#endif
97+
98+
#endif /* INC_FILTER_H_ */

cores/logicrom/logicromsdk/include/fota.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ extern "C" {
1212

1313
/**
1414
* Start Firmware Update
15-
* @param [in] HTTP URL to download firmware
15+
* @param in_url [in] HTTP URL to download firmware
1616
* @return 0 on success, negative value on error
1717
*/
1818
int fota_start(const char *in_url);

cores/logicrom/logicromsdk/include/gpslib.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
#include <time.h>
1010

11+
#ifdef __cplusplus
12+
extern "C"
13+
{
14+
#endif
15+
1116
/**
1217
* GPS Module type
1318
*/
@@ -220,4 +225,8 @@ time_t gpsmktime(char *date_in, char *time_in);
220225
*/
221226
int geofence_check(int type, struct point_t *fence, unsigned int corners_radius, struct point_t *point);
222227

228+
#ifdef __cplusplus
229+
}
230+
#endif
231+
223232
#endif /* INC_GPSLIB_H_ */

cores/logicrom/logicromsdk/include/hw/bluetooth.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
#ifndef INC_HW_BLUETOOTH_H_
77
#define INC_HW_BLUETOOTH_H_
88

9+
#ifdef __cplusplus
10+
extern "C"
11+
{
12+
#endif
13+
914
#ifndef PLATFORM_BC20
1015
/**
1116
* @note Bluetooth is not available on MT2625 (NB-IoT) Platform.
@@ -190,4 +195,8 @@ int bt_manager_init(void);
190195

191196
#endif /* PLATFORM_BC20 */
192197

198+
#ifdef __cplusplus
199+
}
200+
#endif
201+
193202
#endif /* INC_HW_BLUETOOTH_H_ */

cores/logicrom/logicromsdk/include/hw/gpio.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,23 @@ int gpio_setuserdata(int handle, void *arg);
133133
*/
134134
void *gpio_getuserdata(int handle);
135135

136+
/**
137+
* GPIO Fast read
138+
* Use with valid IO @a handle only
139+
* @param handle Handle to gpio object returned by @ref gpio_request
140+
* @return input gpio level @ref gpio_level_e
141+
*/
142+
int gpio_readfast(int handle);
143+
144+
/**
145+
* GPIO Fast write
146+
* Use with valid IO @a handle only
147+
* @param handle Handle to gpio object returned by @ref gpio_request
148+
* @param value gpio level to set @ref gpio_level_e
149+
* @return 0 on success, negative value on failure
150+
*/
151+
int gpio_writefast(int handle, int value);
152+
136153
#ifdef __cplusplus
137154
}
138155
#endif

0 commit comments

Comments
 (0)