Paparazzi UAS
v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
pprz link device for Ublox over I2C More...
Go to the source code of this file.
Data Structures | |
struct | GpsUbxI2C |
ubx_i2c state More... | |
Macros | |
#define | GPS_I2C_BUF_SIZE 255 |
Typedefs | |
typedef enum GpsI2CReadState | GpsI2CReadState |
read states More... | |
typedef enum GpsI2CWriteState | GpsI2CWriteState |
write states More... | |
Enumerations | |
enum | GpsI2CReadState { gps_i2c_read_standby , gps_i2c_read_sizeof , gps_i2c_read_data } |
read states More... | |
enum | GpsI2CWriteState { gps_i2c_write_standby , gps_i2c_write_request_size , gps_i2c_write_cfg } |
write states More... | |
Functions | |
void | gps_ubx_i2c_init (void) |
init function More... | |
void | gps_ubx_i2c_periodic (void) |
handle message sending More... | |
void | gps_ubx_i2c_read_event (void) |
handle message reception More... | |
bool | gps_i2c_tx_is_ready (void) |
is driver ready to send a message More... | |
void | gps_i2c_begin (void) |
config is done, begin reading messages More... | |
static void | GpsUbxi2cEvent (void) |
i2c event More... | |
Variables | |
struct GpsUbxI2C | gps_i2c |
pprz link device for Ublox over I2C
This module adds i2c functionality for the ublox using existing driver
Definition in file gps_ubx_i2c.h.
struct GpsUbxI2C |
ubx_i2c state
Definition at line 61 of file gps_ubx_i2c.h.
Data Fields | ||
---|---|---|
int | baudrate | baudrate, unused |
struct link_device | device | ppz link device |
GpsI2CReadState | read_state | |
uint8_t | rx_buf[GPS_I2C_BUF_SIZE] | receive buffer |
uint16_t | rx_buf_avail | how many bytes are waiting to be read |
uint16_t | rx_buf_idx | rx buf index |
struct i2c_transaction | trans | i2c transaction |
uint8_t | tx_buf[GPS_I2C_BUF_SIZE] | transmit buffer |
uint16_t | tx_buf_idx | tx buf index |
bool | tx_rdy | are we ready to transmit |
GpsI2CWriteState | write_state |
#define GPS_I2C_BUF_SIZE 255 |
Definition at line 39 of file gps_ubx_i2c.h.
typedef enum GpsI2CReadState GpsI2CReadState |
read states
typedef enum GpsI2CWriteState GpsI2CWriteState |
write states
enum GpsI2CReadState |
read states
Enumerator | |
---|---|
gps_i2c_read_standby | dont read anything |
gps_i2c_read_sizeof | read size of ubx buffer |
gps_i2c_read_data | read data from ubx buffer |
Definition at line 43 of file gps_ubx_i2c.h.
enum GpsI2CWriteState |
write states
Enumerator | |
---|---|
gps_i2c_write_standby | wait for gps_ubx to read buffer or ucenter to transmit |
gps_i2c_write_request_size | request size of ubx buffer |
gps_i2c_write_cfg | send a config msg and get reply |
Definition at line 52 of file gps_ubx_i2c.h.
void gps_i2c_begin | ( | void | ) |
config is done, begin reading messages
Definition at line 160 of file gps_ubx_i2c.c.
References gps_ubx_i2c_ucenter_done, and TRUE.
Referenced by gps_ubx_ucenter_periodic().
bool gps_i2c_tx_is_ready | ( | void | ) |
is driver ready to send a message
Definition at line 155 of file gps_ubx_i2c.c.
References gps_i2c, and GpsUbxI2C::tx_rdy.
Referenced by gps_ubx_ucenter_periodic().
void gps_ubx_i2c_init | ( | void | ) |
init function
< check if transmit buffer is not full
< put one byte
< put several bytes
< send completed buffer
< check if a new character is available
< get a new char
< set device baudrate
Definition at line 97 of file gps_ubx_i2c.c.
References GpsUbxI2C::device, FALSE, gps_i2c, gps_i2c_char_available(), gps_i2c_check_free_space(), gps_i2c_getch(), gps_i2c_msg_ready(), gps_i2c_put_buffer(), gps_i2c_put_byte(), gps_i2c_read_standby, gps_i2c_write_standby, gps_ubx_i2c_ucenter_done, I2CTransDone, null_function(), GpsUbxI2C::read_state, GpsUbxI2C::rx_buf_avail, GpsUbxI2C::rx_buf_idx, i2c_transaction::status, GpsUbxI2C::trans, TRUE, GpsUbxI2C::tx_buf_idx, GpsUbxI2C::tx_rdy, and GpsUbxI2C::write_state.
void gps_ubx_i2c_periodic | ( | void | ) |
handle message sending
Definition at line 170 of file gps_ubx_i2c.c.
References i2c_transaction::buf, gps_i2c, GPS_I2C_ADDR_NB_AVAIL_BYTES, GPS_I2C_BUF_SIZE, gps_i2c_char_available(), gps_i2c_read_sizeof, gps_i2c_read_standby, GPS_I2C_SLAVE_ADDR, gps_i2c_write_cfg, gps_i2c_write_request_size, gps_i2c_write_standby, gps_ubx_i2c_bytes_to_read, gps_ubx_i2c_ucenter_done, i2c_transceive(), i2c_transmit(), I2CTransDone, GpsUbxI2C::read_state, i2c_transaction::status, GpsUbxI2C::trans, TRUE, GpsUbxI2C::tx_buf, GpsUbxI2C::tx_buf_idx, GpsUbxI2C::tx_rdy, and GpsUbxI2C::write_state.
void gps_ubx_i2c_read_event | ( | void | ) |
handle message reception
Definition at line 209 of file gps_ubx_i2c.c.
References i2c_transaction::buf, gps_i2c, GPS_I2C_ADDR_DATA, GPS_I2C_BUF_SIZE, gps_i2c_read_data, gps_i2c_read_sizeof, gps_i2c_read_standby, GPS_I2C_SLAVE_ADDR, gps_i2c_write_request_size, gps_i2c_write_standby, gps_ubx_i2c_bytes_to_read, i2c_transceive(), I2CTransDone, GpsUbxI2C::read_state, GpsUbxI2C::rx_buf, GpsUbxI2C::rx_buf_avail, GpsUbxI2C::rx_buf_idx, i2c_transaction::status, GpsUbxI2C::trans, and GpsUbxI2C::write_state.
Referenced by GpsUbxi2cEvent().
|
inlinestatic |
i2c event
Definition at line 101 of file gps_ubx_i2c.h.
References gps_i2c, gps_ubx_i2c_read_event(), I2CTransDone, I2CTransFailed, I2CTransSuccess, i2c_transaction::status, and GpsUbxI2C::trans.
|
extern |
Definition at line 1 of file gps_ubx_i2c.c.
Referenced by gps_i2c_char_available(), gps_i2c_check_free_space(), gps_i2c_getch(), gps_i2c_msg_ready(), gps_i2c_put_byte(), gps_i2c_tx_is_ready(), gps_ubx_i2c_init(), gps_ubx_i2c_periodic(), gps_ubx_i2c_read_event(), and GpsUbxi2cEvent().