Skip to content

Commit 9a5e7d0

Browse files
committed
Update logicrom SDK to v0.9.4
Signed-off-by: Ajay Bhargav <[email protected]>
1 parent 6768b29 commit 9a5e7d0

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

+1155
-394
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
#include <sys/types.h>
1212

13+
#ifdef __cplusplus
14+
extern "C" {
15+
#endif
16+
1317
/* Address to accept any incoming messages. */
1418
#define INADDR_ANY ((in_addr_t) 0x00000000)
1519
/* Address to send to all hosts. */
@@ -40,10 +44,6 @@ struct in6_addr {
4044
#define s6_addr un.u8_addr
4145
};
4246

43-
#ifdef __cplusplus
44-
extern "C" {
45-
#endif
46-
4747
/**
4848
* Convert IPv4 numbers-and-dots notation into binary data in network byte order.
4949
* @param cp [in] Host address string

cores/logicrom/logicromsdk/include/command.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
#include "private/linker_list.h"
99

10+
#ifdef __cplusplus
11+
extern "C" {
12+
#endif
13+
1014
/**
1115
* Maximum number of allowed arguments
1216
* including command
@@ -112,10 +116,6 @@ typedef struct {
112116
*/
113117
typedef void (*commandproc_cb)(int result, struct cmdinfo_t *info, void *arg);
114118

115-
#ifdef __cplusplus
116-
extern "C" {
117-
#endif
118-
119119
/**
120120
* Execute command buffer
121121
*

cores/logicrom/logicromsdk/include/crypto/arc4.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#ifndef INCLUDE_CRYPTO_ARC4_H_
77
#define INCLUDE_CRYPTO_ARC4_H_
88

9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
913
/**
1014
* @brief ARC4 context structure
1115
*/
@@ -17,10 +21,6 @@ typedef struct
1721
}
1822
arc4_context;
1923

20-
#ifdef __cplusplus
21-
extern "C" {
22-
#endif
23-
2424
/**
2525
* @brief ARC4 key schedule
2626
*

cores/logicrom/logicromsdk/include/crypto/des.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
#ifndef INCLUDE_CRYPTO_DES_H_
77
#define INCLUDE_CRYPTO_DES_H_
88

9+
#ifdef __cplusplus
10+
extern "C" {
11+
#endif
12+
913
/**
1014
* @name op_mode
1115
*/
@@ -22,10 +26,6 @@ typedef struct
2226
}
2327
des_context;
2428

25-
#ifdef __cplusplus
26-
extern "C" {
27-
#endif
28-
2929
/**
3030
* @brief DES key schedule (56-bit, encryption)
3131
*

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

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,20 @@
22
* DHT Temperature & Humidity Sensor library optimized for GSM module
33
*
44
* DHT Library based on Rob Tillaart's DHTlib
5+
*
56
* ref: https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTlib
7+
*
68
* version: 0.1.29
9+
*
710
*/
811

912
#ifndef INC_DRIVER_DHT_H
1013
#define INC_DRIVER_DHT_H
1114

15+
#ifdef __cplusplus
16+
extern "C" {
17+
#endif
18+
1219
#define DHT_LIB_VERSION "0.1.29"
1320

1421
/**
@@ -40,10 +47,6 @@ enum dht_err_e {
4047
*/
4148
#define dht_read44(p,h,t) dht_read(p,h,t)
4249

43-
#ifdef __cplusplus
44-
extern "C" {
45-
#endif
46-
4750
/**
4851
* DHT11 Read function
4952
* @param iohandle [in] GPIO pin handle returned by @ref gpio_request()
@@ -54,13 +57,12 @@ extern "C" {
5457
int dht_read11(int iohandle, double *humidity, double *temperature);
5558

5659
/**
57-
* DHTXX Read function
58-
* where XX is 21,22,33,44
60+
* DHTXX Read function, where XX is 21,22,33,44
61+
*
5962
* A macro based shorthand is also available for code readability.
60-
* @see dht_read21
61-
* @see dht_read22
62-
* @see dht_read33
63-
* @see dht_read44
63+
*
64+
* @see dht_read21, dht_read22, dht_read33, dht_read44
65+
*
6466
* @param iohandle [in] GPIO pin handle @ref gpio_request()
6567
* @param humidity [out] Humidity value
6668
* @param temperature [out] Temperature value

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88

99
#include <inttypes.h>
1010

11+
#ifdef __cplusplus
12+
extern "C" {
13+
#endif
14+
1115
/**
1216
* Sensor type
1317
*/
@@ -18,10 +22,6 @@ enum senstype_e {
1822
DS1822, /**< Sensor type DS1822 */
1923
};
2024

21-
#ifdef __cplusplus
22-
extern "C" {
23-
#endif
24-
2525
/**
2626
* Perform a one wire search for DS18x20 Sensor
2727
* @param ow_handle [in] OneWire bus handle @ref OneWire()

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ extern "C" {
2020
/**
2121
* Register OneWire bus
2222
* @param pin [in] IO pin number @ref gpioname_e
23-
* @return On success, returns handle to OneWire Bus object. On error returns negative value.
23+
* @return On success, returns handle to OneWire Bus object. 0 on error (no memory)
2424
*/
2525
int OneWire(uint8_t pin);
2626

@@ -154,7 +154,9 @@ uint8_t ow_crc8(const uint8_t *addr, uint8_t len);
154154

155155
/**
156156
* Compute the 1-Wire CRC16 and compare it against the received CRC.
157+
*
157158
* Example usage (reading a DS2408):
159+
*
158160
* // Put everything in a buffer so we can compute the CRC easily.
159161
* uint8_t buf[13];
160162
* buf[0] = 0xF0; // Read PIO Registers
Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
/**
2+
* @file gpsdriver.h
3+
* @brief GPS Driver interface used by GPS library
4+
*
5+
*/
6+
#ifndef INC_GPSDRIVER_H_
7+
#define INC_GPSDRIVER_H_
8+
9+
#ifdef __cplusplus
10+
extern "C"
11+
{
12+
#endif
13+
14+
/**
15+
* @brief GNSS message to enable
16+
*
17+
*/
18+
enum gnssmsg_e {
19+
NMEA_GGA = 1 << 0,
20+
NMEA_GLL = 1 << 1,
21+
NMEA_GSA = 1 << 2,
22+
NMEA_GSV = 1 << 3,
23+
NMEA_RMC = 1 << 4,
24+
NMEA_VTG = 1 << 5,
25+
};
26+
27+
/**
28+
* @brief Module operation mode (if supported)
29+
*
30+
*/
31+
enum gnssopmode_e {
32+
OPMODE_NORMAL,
33+
OPMODE_SLOW,
34+
};
35+
36+
/**
37+
* @brief GNSS software reset type
38+
*
39+
*/
40+
enum gnssreset_e {
41+
RESET_HOT,
42+
RESET_WARM,
43+
RESET_COLD,
44+
};
45+
46+
/**
47+
* @brief GPS Driver Structure
48+
*
49+
*/
50+
struct gpsdriver_t {
51+
/** Driver Name */
52+
const char *name;
53+
/** Command require checksum? 1 - yes, 0 - no */
54+
int command_checksum;
55+
/** List of module specific response identifier */
56+
const char ** const response_ident;
57+
/** count of @ref response_ident */
58+
int response_ident_count;
59+
/**
60+
* @brief Perform software reset, NULL if not implemented
61+
*
62+
* @param type reset type @ref gnssreset_e
63+
* @return status, 0 for success
64+
*/
65+
int (*restart)(int type);
66+
/**
67+
* @brief Configure GNSS module, NULL if not implemented
68+
*
69+
* @param msg_type bitwise ORed value of @ref gnssmsg_e, for messages to be enabled
70+
* @param rate_ms output datarate in ms, currently unused (1000ms default)
71+
* @param op_mode Operation mode to configure GNSS module for Normal or slow motion operation
72+
* @return status, 0 for success
73+
*/
74+
int (*config)(unsigned int msg_type, unsigned int rate_ms, int op_mode);
75+
/**
76+
* @brief Setup/change baudrate, called from gpsbaud command handler, NULL if not implemented
77+
*
78+
* @param baud baudrate to set
79+
* @return status, 0 for success
80+
*/
81+
int (*setup_baud)(unsigned int baud);
82+
/**
83+
* @brief callback function for module specific reponse identifiers @var response_ident
84+
* NULL if not implemented
85+
*
86+
* @param msg response (without checksum)
87+
* @return status, 0 for success
88+
*/
89+
int (*response_handler)(const char *msg);
90+
unsigned int reserved; /** must be 0 */
91+
};
92+
93+
/**
94+
* @brief Set GPS driver for chipset with CASIC GNSS recevier protocol e.g. AT6558
95+
*
96+
* This driver is used in following GNSS modules or as integrated GNSS
97+
*
98+
* 1. Neoway N58 LTE Cat.1
99+
* 2. Neoway G2
100+
* 3. Neoway G7A
101+
* 4. AT6558
102+
*
103+
* @return 0 on success
104+
*/
105+
int gps_set_driver_casic(void);
106+
107+
/**
108+
* @brief Set GPS driver to Quectel L89R2.0 GNSS/IRNSS Module
109+
*
110+
* @return 0 on success
111+
*/
112+
int gps_set_driver_l89r2(void);
113+
114+
/**
115+
* @brief Set GPS driver to module using MT3333 or MT3339 chipset
116+
*
117+
* This driver can be used for following GNSS/GSM Modules
118+
*
119+
* 1. Quectel L86
120+
* 2. Quectel MC60
121+
* 3. Quectel MC20
122+
*
123+
* @return 0 on success
124+
*/
125+
int gps_set_driver_mt333x(void);
126+
127+
/**
128+
* @brief GPS driver for SIRF III chipset
129+
*
130+
* @return 0 on success
131+
*/
132+
int gps_set_driver_sirf3(void);
133+
134+
/**
135+
* @brief GPS driver for STA8090 chipset
136+
*
137+
* This driver can be used for Quectel L89 IRNSS module.
138+
*
139+
* @note Please do not confuse with L89 and L89R2, check datasheet
140+
* before using correct driver.
141+
*
142+
* @return int
143+
*/
144+
int gps_set_driver_stirnss(void);
145+
146+
/**
147+
* @brief GPS Driver for uc6226 uc6228 chipset
148+
*
149+
* This driver can be used for following modules:
150+
*
151+
* 1. Quectel L76C
152+
* 2. Quectel L26C
153+
* 3. Quectel BC20 (NB-IoT)
154+
* 4. Quectel EC200UCN-AA LTE Cat.1 Module
155+
*
156+
* @return 0 on success
157+
*/
158+
int gps_set_driver_uc622x(void);
159+
160+
/**
161+
* @brief Set custom defined GPS driver
162+
*
163+
* @param driver GPS module driver structure
164+
* @return 0 on success, negative on failure
165+
*/
166+
int gps_set_driver(const struct gpsdriver_t *driver);
167+
168+
#ifdef __cplusplus
169+
}
170+
#endif
171+
172+
#endif /* INC_GPSDRIVER_H_ */

0 commit comments

Comments
 (0)