Skip to content
This repository was archived by the owner on Jan 28, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
directory reorganisation
  • Loading branch information
vid553 committed Nov 4, 2020
commit a2ad45fa67fe97ad7544d87d20889c306c06b27f
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ Temporary Items
*.swp

# Zephyr build files
examples/Example_Zephyr/build/*
examples/Zephyr/*/build/*
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ project(sparkfun_ublox_zephyr_library)

zephyr_compile_options(-fdiagnostics-color=always)

zephyr_include_directories(../../src/)
target_sources(app PRIVATE ../../src/SparkFun_Ublox_Zephyr_Library.cpp)
target_sources(app PRIVATE ../../src/ublox_lib_interface.cpp)
zephyr_include_directories(.)
target_sources(app PRIVATE src/SparkFun_Ublox_Zephyr_Library.cpp)
target_sources(app PRIVATE src/SparkFun_Ublox_Zephyr_Interface.cpp)

target_sources(app PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src/main.c)
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

This port was made by Vid Rajtmajer <vid@irnas.eu>, www.irnas.eu
*/
#include "ublox_lib_interface.h"
#include "SparkFun_Ublox_Zephyr_Interface.h"

#include <errno.h>
#include <stdio.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
/*
Read NMEA sentences over I2C using Ublox module SAM-M8Q, NEO-M8P, ZED-F9P, etc
By: Nathan Seidle
SparkFun Electronics
Date: August 22nd, 2018
License: MIT. See license file for more information but you can
basically do whatever you want with this code.
Reading lat, long and UTC time via UBX binary commands
By: Nathan Seidle
SparkFun Electronics
Date: August 22nd, 2018
License: MIT. See license file for more information but you can
basically do whatever you want with this code.

This example reads the NMEA setences from the Ublox module over I2c and outputs
them to the serial port
This example reads the NMEA setences from the Ublox module over I2c and outputs
them to the serial port

Open the serial monitor at 115200 baud to see the output
I2C clock speed: 100 kHz
Open the serial monitor at 115200 baud to see the output
I2C clock speed: 100 kHz

Ported to Zephyr by Vid Rajtmajer <vid@irnas.eu>, www.irnas.eu
Ported to Zephyr by Vid Rajtmajer <vid@irnas.eu>, www.irnas.eu

To build: west build -b <BOARD_NAME> -p
To flash: west flash --erase
Development environment specifics: NCS v1.0.3 release

To build: west build -b <BOARD_NAME> -p Can also read NMEA sentences over I2C with check_ublox function
To flash: west flash --erase
*/
#include <device.h>
#include <drivers/i2c.h>
#include <errno.h>
#include <zephyr.h>
#include <zephyr/types.h>

#include "ublox_lib_interface.h"
#include "SparkFun_Ublox_Zephyr_Interface.h"


#define I2C_DEV "I2C_0"
Expand Down Expand Up @@ -74,7 +76,7 @@ uint8_t init_gps(void) {


void main(void) {
printk("Ublox Zephyr example\n");
printk("Zephyr Ublox example\n");

int err;
err = init_gpio();
Expand All @@ -92,9 +94,9 @@ void main(void) {
}

while(1) {
//check_ublox(); // See if new data is available. Process bytes as they come in.
//check_ublox(); // See if new data is available. Process bytes as they come in.
get_position();
get_datetime();
k_msleep(250); // Don't pound too hard on the I2C bus
k_msleep(250); // Don't pound too hard on the I2C bus
}
}