STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
gnss_core.c File Reference
#include "gnss_core.h"
#include <string.h>
Include dependency graph for gnss_core.c:

Go to the source code of this file.

Macros

#define BAUD_COUNT   (sizeof(kBauds) / sizeof(kBauds[0]))

Functions

static void open_at (gnss_core_t *c, uint32_t baud)
static void detect (gnss_core_t *c, uint32_t now_us)
static void send_config (gnss_core_t *c, uint32_t now_us)
static void configure (gnss_core_t *c, uint32_t now_us)
static void restart (gnss_core_t *c, uint32_t now_us)
void gnss_core_init (gnss_core_t *c, uint32_t now_us)
void gnss_core_set_pps (gnss_core_t *c, uint32_t edge_us)
static void on_pvt (gnss_core_t *c, uint32_t now_us)
static void on_frame (gnss_core_t *c, gnss_frame_kind_t kind, uint32_t now_us)
void gnss_core_feed (gnss_core_t *c, const uint8_t *bytes, size_t n, uint32_t now_us)
void gnss_core_poll (gnss_core_t *c, uint32_t now_us)
bool gnss_core_request_status (gnss_core_t *c)
uint32_t gnss_core_wait_us (const gnss_core_t *c, uint32_t now_us)

Variables

static const uint32_t kBauds [] = {9600U, 38400U, GNSS_RUN_BAUD}

Macro Definition Documentation

◆ BAUD_COUNT

#define BAUD_COUNT   (sizeof(kBauds) / sizeof(kBauds[0]))

Definition at line 6 of file gnss_core.c.

Referenced by gnss_core_poll().

Function Documentation

◆ configure()

◆ detect()

void detect ( gnss_core_t * c,
uint32_t now_us )
static

◆ gnss_core_feed()

void gnss_core_feed ( gnss_core_t * c,
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 * c,
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()

◆ gnss_core_request_status()

bool gnss_core_request_status ( gnss_core_t * c)

◆ gnss_core_set_pps()

void gnss_core_set_pps ( gnss_core_t * c,
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 * c,
uint32_t now_us )

Definition at line 183 of file gnss_core.c.

References gnss_core_t::deadline_us.

Referenced by gnss_task().

◆ on_frame()

◆ on_pvt()

◆ open_at()

void open_at ( gnss_core_t * c,
uint32_t baud )
static

◆ restart()

void restart ( gnss_core_t * c,
uint32_t now_us )
static

Definition at line 47 of file gnss_core.c.

References gnss_core_t::candidate, detect(), and gnss_core_t::resets.

Referenced by gnss_core_poll(), and on_frame().

◆ send_config()

Variable Documentation

◆ kBauds

const uint32_t kBauds[] = {9600U, 38400U, GNSS_RUN_BAUD}
static

Definition at line 5 of file gnss_core.c.

Referenced by detect().