5 #include <twr_scheduler.h>
121 TWR_SAM_M8Q_STATE_ERROR = -1,
122 TWR_SAM_M8Q_STATE_START = 0,
123 TWR_SAM_M8Q_STATE_READ = 1,
124 TWR_SAM_M8Q_STATE_UPDATE = 2,
125 TWR_SAM_M8Q_STATE_STOP = 3
127 } twr_sam_m8q_state_t;
134 uint8_t _i2c_address;
137 twr_sam_m8q_event_handler_t *_event_handler;
141 twr_sam_m8q_state_t _state;
142 uint8_t _ddc_buffer[64];
144 char _line_buffer[128];
twr_i2c_channel_t
I2C channels.
void twr_sam_m8q_stop(twr_sam_m8q_t *self)
Stop navigation module.
void twr_sam_m8q_invalidate(twr_sam_m8q_t *self)
Invalidate navigation data.
void twr_sam_m8q_start(twr_sam_m8q_t *self)
Start navigation module.
float longitude
Longitude.
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.
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.
float horizontal
Horizontal accuracy estimate.
int satellites_tracked
Number of satellites tracked.
bool twr_sam_m8q_get_quality(twr_sam_m8q_t *self, twr_sam_m8q_quality_t *quality)
Get quality.
bool twr_sam_m8q_get_accuracy(twr_sam_m8q_t *self, twr_sam_m8q_accuracy_t *accuracy)
Get accuracy.
struct twr_sam_m8q_t twr_sam_m8q_t
SAM-M8Q instance.
float vertical
Vertical accuracy estimate.
twr_sam_m8q_event_t
Callback events.
bool twr_sam_m8q_get_time(twr_sam_m8q_t *self, twr_sam_m8q_time_t *time)
Get time.
bool twr_sam_m8q_get_position(twr_sam_m8q_t *self, twr_sam_m8q_position_t *position)
Get position.
int fix_quality
Fix quality.
char units
Units of altitude.
bool twr_sam_m8q_get_altitude(twr_sam_m8q_t *self, twr_sam_m8q_altitude_t *altitude)
Get altitude.
@ TWR_SAM_M8Q_EVENT_ERROR
Error event.
@ TWR_SAM_M8Q_EVENT_STOP
Stop event.
@ TWR_SAM_M8Q_EVENT_START
Start event.
@ TWR_SAM_M8Q_EVENT_UPDATE
Update event.
size_t twr_scheduler_task_id_t
Task ID assigned by scheduler.