Firmware SDK
twr_sam_m8q

Driver for u-blox SAM-M8Q GPS/Galileo/Glonass navigation module. More...

Data Structures

struct  twr_sam_m8q_driver_t
 SAM-M8Q driver. More...
 
struct  twr_sam_m8q_time_t
 Time data structure. More...
 
struct  twr_sam_m8q_position_t
 Position data structure. More...
 
struct  twr_sam_m8q_altitude_t
 Altitude data structure. More...
 
struct  twr_sam_m8q_quality_t
 Quality data structure. More...
 
struct  twr_sam_m8q_accuracy_t
 Accuracy data structure. More...
 

Typedefs

typedef struct twr_sam_m8q_t twr_sam_m8q_t
 SAM-M8Q instance.
 

Enumerations

enum  twr_sam_m8q_event_t {
  TWR_SAM_M8Q_EVENT_ERROR = 0 ,
  TWR_SAM_M8Q_EVENT_START = 1 ,
  TWR_SAM_M8Q_EVENT_UPDATE = 2 ,
  TWR_SAM_M8Q_EVENT_STOP = 3
}
 Callback events. More...
 

Functions

void twr_sam_m8q_init (twr_sam_m8q_t *self, twr_i2c_channel_t channel, uint8_t i2c_address, const twr_sam_m8q_driver_t *driver)
 Initialize SAM-M8Q module driver. More...
 
void twr_sam_m8q_set_event_handler (twr_sam_m8q_t *self, twr_sam_m8q_event_handler_t event_handler, void *event_param)
 Set callback function. More...
 
void twr_sam_m8q_start (twr_sam_m8q_t *self)
 Start navigation module. More...
 
void twr_sam_m8q_stop (twr_sam_m8q_t *self)
 Stop navigation module. More...
 
void twr_sam_m8q_invalidate (twr_sam_m8q_t *self)
 Invalidate navigation data.
 
bool twr_sam_m8q_get_time (twr_sam_m8q_t *self, twr_sam_m8q_time_t *time)
 Get time. More...
 
bool twr_sam_m8q_get_position (twr_sam_m8q_t *self, twr_sam_m8q_position_t *position)
 Get position. More...
 
bool twr_sam_m8q_get_altitude (twr_sam_m8q_t *self, twr_sam_m8q_altitude_t *altitude)
 Get altitude. More...
 
bool twr_sam_m8q_get_quality (twr_sam_m8q_t *self, twr_sam_m8q_quality_t *quality)
 Get quality. More...
 
bool twr_sam_m8q_get_accuracy (twr_sam_m8q_t *self, twr_sam_m8q_accuracy_t *accuracy)
 Get accuracy. More...
 

Variables

bool(* twr_sam_m8q_driver_t::on )(twr_sam_m8q_t *self)
 Callback for power on.
 
bool(* twr_sam_m8q_driver_t::off )(twr_sam_m8q_t *self)
 Callback for power off.
 
int twr_sam_m8q_time_t::year
 Year.
 
int twr_sam_m8q_time_t::month
 Month.
 
int twr_sam_m8q_time_t::day
 Day.
 
int twr_sam_m8q_time_t::hours
 Hours.
 
int twr_sam_m8q_time_t::minutes
 Minutes.
 
int twr_sam_m8q_time_t::seconds
 Seconds.
 
float twr_sam_m8q_position_t::latitude
 Latitude.
 
float twr_sam_m8q_position_t::longitude
 Longitude.
 
float twr_sam_m8q_altitude_t::altitude
 Altitude.
 
char twr_sam_m8q_altitude_t::units
 Units of altitude.
 
int twr_sam_m8q_quality_t::fix_quality
 Fix quality.
 
int twr_sam_m8q_quality_t::satellites_tracked
 Number of satellites tracked.
 
float twr_sam_m8q_accuracy_t::horizontal
 Horizontal accuracy estimate.
 
float twr_sam_m8q_accuracy_t::vertical
 Vertical accuracy estimate.
 

Detailed Description

Driver for u-blox SAM-M8Q GPS/Galileo/Glonass navigation module.

Enumeration Type Documentation

◆ twr_sam_m8q_event_t

Callback events.

Enumerator
TWR_SAM_M8Q_EVENT_ERROR 

Error event.

TWR_SAM_M8Q_EVENT_START 

Start event.

TWR_SAM_M8Q_EVENT_UPDATE 

Update event.

TWR_SAM_M8Q_EVENT_STOP 

Stop event.

Definition at line 13 of file twr_sam_m8q.h.

Function Documentation

◆ twr_sam_m8q_get_accuracy()

bool twr_sam_m8q_get_accuracy ( twr_sam_m8q_t self,
twr_sam_m8q_accuracy_t accuracy 
)

Get accuracy.

Parameters
[in]selfInstance
[out]accuracyAccuracy data structure
Returns
true On success
false On failure

Definition at line 124 of file twr_sam_m8q.c.

Referenced by twr_module_gps_get_accuracy().

Here is the caller graph for this function:

◆ twr_sam_m8q_get_altitude()

bool twr_sam_m8q_get_altitude ( twr_sam_m8q_t self,
twr_sam_m8q_altitude_t altitude 
)

Get altitude.

Parameters
[in]selfInstance
[out]altitudeAltitude data structure
Returns
true On success
false On failure

Definition at line 94 of file twr_sam_m8q.c.

Referenced by twr_module_gps_get_altitude().

Here is the caller graph for this function:

◆ twr_sam_m8q_get_position()

bool twr_sam_m8q_get_position ( twr_sam_m8q_t self,
twr_sam_m8q_position_t position 
)

Get position.

Parameters
[in]selfInstance
[out]positionPosition data structure
Returns
true On success
false On failure

Definition at line 79 of file twr_sam_m8q.c.

Referenced by twr_module_gps_get_position().

Here is the caller graph for this function:

◆ twr_sam_m8q_get_quality()

bool twr_sam_m8q_get_quality ( twr_sam_m8q_t self,
twr_sam_m8q_quality_t quality 
)

Get quality.

Parameters
[in]selfInstance
[out]qualityQuality data structure
Returns
true On success
false On failure

Definition at line 109 of file twr_sam_m8q.c.

Referenced by twr_module_gps_get_quality().

Here is the caller graph for this function:

◆ twr_sam_m8q_get_time()

bool twr_sam_m8q_get_time ( twr_sam_m8q_t self,
twr_sam_m8q_time_t time 
)

Get time.

Parameters
[in]selfInstance
[out]timeTime data structure
Returns
true On success
false On failure

Definition at line 60 of file twr_sam_m8q.c.

Referenced by twr_module_gps_get_time().

Here is the caller graph for this function:

◆ twr_sam_m8q_init()

void twr_sam_m8q_init ( twr_sam_m8q_t self,
twr_i2c_channel_t  channel,
uint8_t  i2c_address,
const twr_sam_m8q_driver_t driver 
)

Initialize SAM-M8Q module driver.

Parameters
[in]selfInstance
[in]i2c_channelI2C channel
[in]i2c_addressI2C device address
[in]driverOptional driver (can be NULL)

Definition at line 13 of file twr_sam_m8q.c.

Here is the call graph for this function:

◆ twr_sam_m8q_set_event_handler()

void twr_sam_m8q_set_event_handler ( twr_sam_m8q_t self,
twr_sam_m8q_event_handler_t  event_handler,
void *  event_param 
)

Set callback function.

Parameters
[in]selfInstance
[in]event_handlerFunction address
[in]event_paramOptional event parameter (can be NULL)

Definition at line 26 of file twr_sam_m8q.c.

◆ twr_sam_m8q_start()

void twr_sam_m8q_start ( twr_sam_m8q_t self)

Start navigation module.

Parameters
[in]selfInstance

Definition at line 32 of file twr_sam_m8q.c.

Referenced by twr_module_gps_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ twr_sam_m8q_stop()

void twr_sam_m8q_stop ( twr_sam_m8q_t self)

Stop navigation module.

Parameters
[in]selfInstance

Definition at line 43 of file twr_sam_m8q.c.

Referenced by twr_module_gps_stop().

Here is the call graph for this function:
Here is the caller graph for this function: