Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
25 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 */
}

Releases

Sponsor this project

Packages

Used by

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.