Giter VIP home page Giter VIP logo

gps's Introduction

STM32 HAL library for GPS module NEO-6M

English note

A simple C library (STM32 HAL) for working with the GPS module NEO-6M https://ru.aliexpress.com/wholesale?trafficChannel=main&d=y&CatId=0&SearchText=neo-6m&ltype=wholesale&SortType=total_tranpro_desc&groupsort=1&page=1

Configure STM32CubeMX by setting "General peripheral Initalizion as a pair of '.c / .h' file per peripheral" in the project settings.

Add NVIC global interrupt for UART

Copy the library header and source file to the appropriate project directories (Inc, Src).

Config you GPS module UART and if need DEBUG over USB on gps.h file

#define GPS_DEBUG	0
#define	GPS_USART	&huart2

In the head file of your project (main.c), include the header file

/ * USER CODE BEGIN Includes * /
#include "gps.h"
/ * USER CODE END Includes * /

add UART call back

/* USER CODE BEGIN 0 */
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
	if(huart == &huart2) GPS_UART_CallBack();
}
/* USER CODE END 0 */

add in main function section for initial initialization of the GPS module NEO-6M

/* USER CODE BEGIN 2 */
  GPS_Init();
/* USER CODE END 2 */

On this project setup is ready. After starting the program, information from the GPS module NEO-6M will be available through the GPS structure

GPS.dec_latitude
GPS.dec_longitude
...

Russian note

Простая библиотека на С (STM32 HAL) для работы с GPS модулем module NEO-6M https://ru.aliexpress.com/wholesale?trafficChannel=main&d=y&CatId=0&SearchText=neo-6m&ltype=wholesale&SortType=total_tranpro_desc&groupsort=1&page=1

Сконфигурируйте STM32CubeMX установив "General peripheral Initalizion as a pair of '.c/.h' file per peripheral" в настройках проекта.

Незабудьте включить глобальные прерывания для вашего UART.

Скопируйте заголовочный и исходный файл библиотеки в соотвесвтующие директории проекта (Inc, Src).

Сконфигурируйте UART порт куда подключен ваш модуль и вуключите если необходимо отладку через USB в gps.h file

#define GPS_DEBUG	0
#define	GPS_USART	&huart2

В головном файл вашего проекта (main.c) подключите заголовочный файл

/ * USER CODE BEGIN Includes * /
#include "gps.h"
/ * USER CODE END Includes * /

добавьте функцию вызова по прерыванию UART

/* USER CODE BEGIN 0 */
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
	if(huart == &huart2) GPS_UART_CallBack();
}
/* USER CODE END 0 */

добавьте в секцию функции main(void) код инициализации модуля

/* USER CODE BEGIN 2 */
  GPS_Init();
/* USER CODE END 2 */

На этом настройка проекта готова. После запуска программы информация от вашего GPS модуля будет доступна через структуру GPS

GPS.dec_latitude
GPS.dec_longitude
...

gps's People

Contributors

leech001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gps's Issues

Any possibility of adding communication option via SPI or I2C?

Hi, great job!

Any possibility to add communication option via SPI and I2C?

I found it interesting to use SPI or I2C to make it a little more difficult to falsify the GPS signal, in the case of tracking devices left in lending mode on clients.

The idea is to need the GPS signal to update the RTC and also to generate a product key for periodic unlocking.

Thank you.

1.12.1 UART
NEO-6 modules include one configurable UART interface for serial communication (for information about configuration see section 1.15).

1.12.2 USB
NEO-6 modules provide a USB version 2.0 FS (Full Speed, 12Mbit/s) interface as an alternative to the UART. The pull-up resistor on USB_DP is integrated to signal a full-speed device to the host. The VDDUSB pin supplies the USB interface. u-blox provides a Microsoft® certified USB driver for Windows XP, Windows Vista and Windows 7 operating systems.

1.12.3 Serial Peripheral Interface (SPI)
The SPI interface allows for the connection of external devices with a serial interface, e.g. serial flash to save configuration and AssistNow Offline A-GPS data or to interface to a host CPU. The interface can be operated in master or slave mode. In master mode, one chip select signal is available to select external slaves. In slave mode a single chip select signal enables communication with the host.
The maximum bandwidth is 100kbit/s.

1.12.4 Display Data Channel (DDC)
The I2C compatible DDC interface can be used either to access external devices with a serial interface EEPROM or to interface with a host CPU. It is capable of master and slave operation. The DDC interface is I2C Standard Mode compliant. For timing parameters consult the I2C standard.
The DDC Interface supports serial communication with u-blox wireless modules. See the specification of the applicable wireless module to confirm compatibility.
The maximum bandwidth is 100kbit/s.

https://www.u-blox.com/sites/default/files/products/documents/NEO-6_DataSheet_(GPS.G6-HW-09005).pdf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.