Pico GPS Teseo I2C
|
Driver class for ST Teseo IC. More...
Public Member Functions | |
teseo () | |
constructor. | |
callbackmanager::Callback< void, const std::string & > & | writer () |
expose the callback manager for writing to Teseo. | |
callbackmanager::Callback< void, std::string & > & | reader () |
expose the callback manager for reading from Teseo | |
callbackmanager::Callback< void > & | resetter () |
expose the callback manager for resetting the Teseo | |
void | initialize () |
configure the Teseo for use as a position sensor (optional). | |
void | write (const std::string &s) |
write command to the Teseo | |
void | read (std::string &s) |
read data from the Teseo | |
bool | ask_nmea (const nmea_rr &command, std::string &s) |
send NMEA request to the Teseo and return reply | |
bool | ask_nmea_multiple (const nmea_rr &command, std::span< std::string > strings, unsigned int &count) |
send NMEA request to the Teseo and return multi line reply | |
bool | ask_gll (std::string &s) |
get GLL request to the Teseo and read reply | |
bool | ask_gsv (std::span< std::string > strings, unsigned int &count) |
get GSV request to the Teseo and read reply | |
bool | ask_gsa (std::span< std::string > strings, unsigned int &count) |
get GSA request to the Teseo and read reply | |
bool | ask_rmc (std::string &s) |
get RMC request to the Teseo and read reply | |
bool | ask_gga (std::string &s) |
get GGA request to the Teseo and read reply | |
bool | ask_vtg (std::string &s) |
get VTG request to the Teseo and read reply | |
Static Public Member Functions | |
static bool | parse_multiline_reply (std::span< std::string > strings, const std::string s, unsigned int &count, const nmea_rr &command) |
utility to parse a multiline Teseo reply into separate strings | |
Driver class for ST Teseo IC.
Understands the Teseo command set and replies. For the communication, it relies on I2C or UART functions that the user has to provide.
Callbacks are required for:
Definition at line 28 of file teseo_iface.cpp.
|
inlineexport |
constructor.
Definition at line 32 of file teseo_iface.cpp.
|
export |
|
export |
|
export |
|
export |
|
export |
|
export |
send NMEA request to the Teseo and return multi line reply
command | const nmea_rr reference holds the NMEA command. |
strings | astd::span<std::string> gets the replies. |
count | unsigned int reference count of strings parsed. |
Send NMEA request that expects more than 1 reply to the Teseo. Validate and Return the repies.
|
export |
|
export |
|
export |
configure the Teseo for use as a position sensor (optional).
init() is used for dynamic configuration of the Teseo.
Precondition (asserted): the handlers have to be set by the developer before calling init().
Optional. When the Teseo is preset for i2c according to AN5203, init is not required, and developer can cut the 4s 10ms from the startup sequence, that are consumed during the reset sequence.
https://www.st.com/resource/en/application_note/an5203-teseoliv3f–i2c-positioning-sensor–stmicroelectronics.pdf
In that case, the developer doesn't need to provide a resetter callback handler.
|
staticexport |
utility to parse a multiline Teseo reply into separate strings
strings | std::span<std::string> will get the individual strings. |
s | constant std::string reference string to be parsed. |
count | unsigned int reference gets count of strings parsed. |
command | nmea_rr const reference used to validate the status line. |
split a big Teseo reply in its individual strings. The separator is "\r\n"
|
export |
|
inlineexport |
expose the callback manager for reading from Teseo
The developer has to register the logic for reading from the device.
Callback parameter: std::string reference where the data returned by the Teseo will be stored.
For instructions on how to register your handler, check the documentation of writer().
Definition at line 65 of file teseo_iface.cpp.
|
inlineexport |
expose the callback manager for resetting the Teseo
The developer has to register the logic that resets the device. It is optional. See the init() documentation.
The handler has to pull reset low then high. Then it needs to wait 4 seconds to allow the Teseo to boot.
Callback parameter: none.
For instructions on how to register your handler, check the documentation of writer().
Definition at line 76 of file teseo_iface.cpp.
|
export |
|
inlineexport |
expose the callback manager for writing to Teseo.
The developer has to register the logic for writing to the device.
Callback parameter: const std::string reference with data to be written to Teseo.
This can be a C style function, an object method, a static class object method, or lambda code.
Example code:
Definition at line 55 of file teseo_iface.cpp.