Go to the documentation of this file.
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
52 #define THINGSTREAM_MAP_MIKROBUS( cfg, mikrobus ) \
53 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
54 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
55 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST )
62 #define THINGSTREAM_OK 0
63 #define THINGSTREAM_ERROR -1
70 #define THINGSTREAM_DRV_RX_BUFFER_SIZE 600
71 #define THINGSTREAM_DRV_TX_BUFFER_SIZE 100
78 #define THINGSTREAM_NEMA_CGNSINF 1
79 #define THINGSTREAM_NEMA_GPGLL 3
80 #define THINGSTREAM_NEMA_CGNSINF_NUM_ELEMENT 20
81 #define THINGSTREAM_NEMA_GPGLL_NUM_ELEMENT 5
88 #define THINGSTREAM_GPGGA_TIME 1
89 #define THINGSTREAM_GPGGA_LATITUDE 2
90 #define THINGSTREAM_GPGGA_LATITUDE_SIDE 3
91 #define THINGSTREAM_GPGGA_LONGITUDE 4
92 #define THINGSTREAM_GPGGA_LONGITUDE_SIDE 5
93 #define THINGSTREAM_GPGGA_QUALITY_INDICATOR 6
94 #define THINGSTREAM_GPGGA_NUMBER_OF_SATELLITES 7
95 #define THINGSTREAM_GPGGA_H_DILUTION_OF_POS 8
96 #define THINGSTREAM_GPGGA_ALTITUDE 9
97 #define THINGSTREAM_GPGGA_ALTITUDE_UNIT 10
98 #define THINGSTREAM_GPGGA_GEOIDAL_SEPARATION 11
99 #define THINGSTREAM_GPGGA_GEOIDAL_SEPARATION_UNIT 12
100 #define THINGSTREAM_GPGGA_TIME_SINCE_LAST_DGPS 13
101 #define THINGSTREAM_GPGGA_DGPS_REFERENCE_STATION_ID 14
108 #define THINGSTREAM_GPGLL_LATITUDE 1
109 #define THINGSTREAM_GPGLL_LATITUDE_SIDE 2
110 #define THINGSTREAM_GPGLL_LONGITUDE 3
111 #define THINGSTREAM_GPGLL_LONGITUDE_SIDE 4
118 #define THINGSTREAM_ERROR_COMMAND_OR_ELEMENT 0xFF
119 #define THINGSTREAM_ERROR_START_OR_END_COMMAND 0x8F
120 #define THINGSTREAM_ERROR_NEXT_ELEMENT 0x4F
121 #define THINGSTREAM_ERROR_CURRENT_ELEMENT 0x2F
122 #define THINGSTREAM_NO_ERROR 0x00
129 #define THINGSTREAM_CGNSINF_RUN_STAT 1
130 #define THINGSTREAM_CGNSINF_FIX_STAT 2
131 #define THINGSTREAM_CGNSINF_DATE_TIME 3
132 #define THINGSTREAM_CGNSINF_LATITUDE 4
133 #define THINGSTREAM_CGNSINF_LONGITUDE 5
134 #define THINGSTREAM_CGNSINF_ALTITUDE 6
135 #define THINGSTREAM_CGNSINF_SPEED 7
136 #define THINGSTREAM_CGNSINF_COURSE 8
137 #define THINGSTREAM_CGNSINF_FIX_MODE 9
138 #define THINGSTREAM_CGNSINF_RESERVED1 10
139 #define THINGSTREAM_CGNSINF_HDOP 11
140 #define THINGSTREAM_CGNSINF_PDOP 12
141 #define THINGSTREAM_CGNSINF_VDOP 13
142 #define THINGSTREAM_CGNSINF_RESERVED2 14
143 #define THINGSTREAM_CGNSINF_SAT_VIEW 15
144 #define THINGSTREAM_CGNSINF_SAT_USED 16
145 #define THINGSTREAM_CGNSINF_GLONASS_VIEW 17
146 #define THINGSTREAM_CGNSINF_RESERVED3 18
147 #define THINGSTREAM_CGNSINF_C_N0 19
148 #define THINGSTREAM_CGNSINF_HPA 20
149 #define THINGSTREAM_CGNSINF_VPA 21
296 uint8_t element,
char *parser_buf );
301 #endif // _THINGSTREAM_H_
void thingstream_send_command(thingstream_t *ctx, char *command)
Send command.
uint32_t baud_rate
Definition: thingstream.h:187
uart_stop_bits_t stop_bit
Definition: thingstream.h:191
uint8_t thingstream_actuator_sw_t
Error type.
Definition: thingstream.h:199
uart_data_bits_t data_bit
Definition: thingstream.h:189
uart_parity_t parity_bit
Definition: thingstream.h:190
void thingstream_cfg_setup(thingstream_cfg_t *cfg)
Config Object Initialization function.
pin_name_t rst
Definition: thingstream.h:184
err_t thingstream_init(thingstream_t *ctx, thingstream_cfg_t *cfg)
Initialization function.
void thingstream_module_power(thingstream_t *ctx, uint8_t power_state)
Power module.
thingstream_error_t thingstream_generic_parser(char *rsp, uint8_t command, uint8_t element, char *parser_buf)
Generic parser function.
#define THINGSTREAM_DRV_TX_BUFFER_SIZE
Definition: thingstream.h:71
uint8_t thingstream_error_t
Definition: thingstream.h:208
pin_name_t tx_pin
Definition: thingstream.h:181
#define THINGSTREAM_DRV_RX_BUFFER_SIZE
Definition: thingstream.h:70
digital_out_t rst
Definition: thingstream.h:164
int16_t thingstream_actuator_cnt_t
Definition: thingstream.h:202
Click configuration structure definition.
Definition: thingstream.h:178
Click ctx object definition.
Definition: thingstream.h:162
pin_name_t rx_pin
Definition: thingstream.h:180
int32_t thingstream_generic_read(thingstream_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
char thingstream_actuator_str_t
Definition: thingstream.h:205
void thingstream_generic_write(thingstream_t *ctx, char *data_buf, uint16_t len)
Generic write function.
void thingstream_reset_pin_state(thingstream_t *ctx, uint8_t state)
Set RST pin state.
uart_t uart
Definition: thingstream.h:167
bool uart_blocking
Definition: thingstream.h:188