Code Monkey home page Code Monkey logo

nmea's Introduction

NMEA library for STM32 LL



  • Enable USART (LL Library) and RX interrupt.
  • Set baudrate, stop bits and parity.
  • create a structure of nmea_t.
  • Add nmea_callback() in usart interrupt.
  • Configure nmea_config.h.
  • Call nmea_init().
  • Call nmea_loop() in infinit loop.
  • If using FREERTOS, please create a task for nmea with at least 256 word heap size.

RTOS example:

#include "nmea.h"
nmea_t gps;

int main()
{
  ...  
}

void task_nmea(void const * argument)
{
  nmea_init(&gps, USART1, 1024);
  while (1)
  {
    nmea_loop(&gps);
    osDelay(1);
  }
}

void task_other(void const * argument)
{
  uint8_t time_h; 
  for(;;)
  {
    if (nmea_available(&gps))
    {
      nmea_gnss_time_h(&gps, &time_h);
      nmea_available_reset(&gps);
    }
    osDelay(1);
  }
}

in interrupt file

#include "nmea.h"
extern nmea_t gps;

void USART1_IRQHandler(void)
{
  /* USER CODE BEGIN USART1_IRQn 0 */
	nmea_callback(&gps);
  /* USER CODE END USART1_IRQn 0 */
  /* USER CODE BEGIN USART1_IRQn 1 */

  /* USER CODE END USART1_IRQn 1 */
}

nmea's People

Contributors

nimaltd 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  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  avatar  avatar  avatar

nmea's Issues

bug report

Hello!
When my gps device has no signal,I received something like $GNGGA,081235.319,,,,,0,00,99.99,,M,,M,,4E
,there are five commas behind UTC. The index of UTC is 2,so the index of Lat should be 3.
when program call funcion str = strtok(NULL, ",
"); it will skip directly five commas,and return "0" (Quality).
but variable index is 3. it will put "0" (Quality) on position of Lat.

to minimal change your codes. I'm tring reform strtok.
1
here is my code
2

PMTK commands

Hi! I'm using your library for parsing coordinates. Thank you for that.
But when I try to send PMTK command to the GPS nothing happens.

For example, I'm sending like that;

char TxBuffer[] = "$PMTK314,0,0,0,1,0,0,0,0,0,0,0,0,0,0*35\r\n";
HAL_UART_Transmit(&huart1, (uint8_t *)TxBuffer, sizeof(TxBuffer), 100);

there is no response and GPS keeps dumping all the data packages.

When I try the GPS with ftdi232 and RealTerm app, after that I did send this command GPS giving only GPGGA package.

Is there any solution for this problem?

Thank you.

ارسال مختصات بدست آمده از پورت سریال

سلام
خیلی ممنون از سورسی که قرار دادید.
من با دستور زیر می تونم کل خروجی مکانیاب را که با پورت سریال3 به میکرو ارسال می شه را از طریق پورت سریال 2 به رایانه ارسال کنم.
HAL_UART_Transmit(&huart2,GPS.rxBuffer,sizeof(GPS.rxBuffer),500);

ولی نمی تونم طول و عرض جغرافیایی تبدیل شده را روی پورت سریال2 به تنهایی ارسال کنم.

منظور GPS.GPGGA.LatitudeDecimal و GPS.GPGGA.LongitudeDecimal است.

لطفا راهنمایی بفرمایید.

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.