You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/SparkFun_u-blox_GNSS_Arduino_Library.h
+17-1Lines changed: 17 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -51,6 +51,8 @@
51
51
52
52
#include<Wire.h>
53
53
54
+
#include<SPI.h>
55
+
54
56
#include"u-blox_config_keys.h"
55
57
#include"u-blox_structs.h"
56
58
@@ -560,6 +562,8 @@ class SFE_UBLOX_GNSS
560
562
boolean begin(TwoWire &wirePort = Wire, uint8_t deviceAddress = 0x42); //Returns true if module is detected
561
563
//serialPort needs to be perviously initialized to correct baud rate
562
564
boolean begin(Stream &serialPort); //Returns true if module is detected
565
+
//SPI - supply instance of SPIClass, slave select pin and SPI speed (in Hz)
566
+
boolean begin(SPIClass &spiPort, uint8_t ssPin, int spiSpeed);
563
567
564
568
voidend(void); //Stop all automatic message processing. Free all used RAM
565
569
@@ -612,6 +616,7 @@ class SFE_UBLOX_GNSS
612
616
613
617
boolean checkUbloxI2C(ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); //Method for I2C polling of data, passing any new bytes to process()
614
618
boolean checkUbloxSerial(ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); //Method for serial polling of data, passing any new bytes to process()
619
+
boolean checkUbloxSpi(ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); //Method for spi polling of data, passing any new bytes to process()
615
620
616
621
// Process the incoming data
617
622
@@ -622,12 +627,13 @@ class SFE_UBLOX_GNSS
622
627
voidprocessUBX(uint8_t incoming, ubxPacket *incomingUBX, uint8_t requestedClass, uint8_t requestedID); //Given a character, file it away into the uxb packet structure
623
628
voidprocessUBXpacket(ubxPacket *msg); //Once a packet has been received and validated, identify this packet's class/id and update internal flags
624
629
625
-
// Send I2C/Serial commands to the module
630
+
// Send I2C/Serial/SPI commands to the module
626
631
627
632
voidcalcChecksum(ubxPacket *msg); //Sets the checksumA and checksumB of a given messages
628
633
sfe_ublox_status_e sendCommand(ubxPacket *outgoingUBX, uint16_t maxWait = defaultMaxWait, boolean expectACKonly = false); //Given a packet and payload, send everything including CRC bytes, return true if we got a response
0 commit comments