STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
gnss_core.h File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "gnss_frame.h"
#include "records.h"
#include "ubx.h"
Include dependency graph for gnss_core.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  gnss_io_t
struct  gnss_core_t

Macros

#define GNSS_RUN_BAUD   115200U
#define GNSS_LISTEN_US   1500000U /* > one 1 Hz NMEA period */
#define GNSS_ACK_US   500000U
#define GNSS_CONFIG_TRIES   3U
#define GNSS_SILENCE_US   2000000U
#define GNSS_RATE_MS   100U /* 10 Hz NAV-PVT (data sheet p.4: up to 10 Hz) */

Enumerations

enum  gnss_state_t { GNSS_DETECT = 0 , GNSS_CONFIG , GNSS_RUN }

Functions

void gnss_core_init (gnss_core_t *core, uint32_t now_us)
void gnss_core_feed (gnss_core_t *core, const uint8_t *bytes, size_t n, uint32_t now_us)
void gnss_core_poll (gnss_core_t *core, uint32_t now_us)
void gnss_core_set_pps (gnss_core_t *core, uint32_t edge_us)
bool gnss_core_request_status (gnss_core_t *core)
uint32_t gnss_core_wait_us (const gnss_core_t *core, uint32_t now_us)

Macro Definition Documentation

◆ GNSS_ACK_US

#define GNSS_ACK_US   500000U

Definition at line 34 of file gnss_core.h.

Referenced by send_config().

◆ GNSS_CONFIG_TRIES

#define GNSS_CONFIG_TRIES   3U

Definition at line 35 of file gnss_core.h.

Referenced by gnss_core_poll().

◆ GNSS_LISTEN_US

#define GNSS_LISTEN_US   1500000U /* > one 1 Hz NMEA period */

Definition at line 33 of file gnss_core.h.

Referenced by detect().

◆ GNSS_RATE_MS

#define GNSS_RATE_MS   100U /* 10 Hz NAV-PVT (data sheet p.4: up to 10 Hz) */

Definition at line 37 of file gnss_core.h.

Referenced by send_config().

◆ GNSS_RUN_BAUD

#define GNSS_RUN_BAUD   115200U

Definition at line 32 of file gnss_core.h.

Referenced by configure().

◆ GNSS_SILENCE_US

#define GNSS_SILENCE_US   2000000U

Definition at line 36 of file gnss_core.h.

Referenced by on_frame(), and on_pvt().

Enumeration Type Documentation

◆ gnss_state_t

Enumerator
GNSS_DETECT 
GNSS_CONFIG 
GNSS_RUN 

Definition at line 48 of file gnss_core.h.

Function Documentation

◆ gnss_core_feed()

void gnss_core_feed ( gnss_core_t * core,
const uint8_t * bytes,
size_t n,
uint32_t now_us )

Definition at line 139 of file gnss_core.c.

References gnss_frame_feed(), GNSS_FRAME_NONE, on_frame(), and gnss_core_t::parser.

Referenced by fly(), gnss_task(), and run().

◆ gnss_core_init()

void gnss_core_init ( gnss_core_t * core,
uint32_t now_us )

Definition at line 53 of file gnss_core.c.

References gnss_core_t::candidate, detect(), GNSS_DETECT, gnss_core_t::pps_us, and gnss_core_t::state.

Referenced by gnss_task(), rig(), and world_init().

◆ gnss_core_poll()

void gnss_core_poll ( gnss_core_t * core,
uint32_t now_us )

◆ gnss_core_request_status()

bool gnss_core_request_status ( gnss_core_t * core)

◆ gnss_core_set_pps()

void gnss_core_set_pps ( gnss_core_t * core,
uint32_t edge_us )

Definition at line 60 of file gnss_core.c.

References gnss_core_t::pps_us.

Referenced by fly(), gnss_task(), and test_pps_is_stamped().

◆ gnss_core_wait_us()

uint32_t gnss_core_wait_us ( const gnss_core_t * core,
uint32_t now_us )

Definition at line 183 of file gnss_core.c.

References gnss_core_t::deadline_us.

Referenced by gnss_task().