|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
39 #define GPS_I2C_SLAVE_ADDR (0x42 << 1)
41 #ifndef GPS_UBX_I2C_DEV
42 #error "GPS_UBX_I2C_DEV needs to be defined (e.g. to i2c1)"
44 PRINT_CONFIG_VAR(GPS_UBX_I2C_DEV)
46 #define GPS_I2C_ADDR_NB_AVAIL_BYTES 0xFD
47 #define GPS_I2C_ADDR_DATA 0xFF
134 for (i = 0; i < len; i++) {
#define GPS_I2C_ADDR_NB_AVAIL_BYTES
number of bytes available register
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
bool gps_ubx_i2c_ucenter_done
ucenter finished configuring flag
@ gps_i2c_write_cfg
send a config msg and get reply
int baudrate
baudrate, unused
void gps_i2c_put_buffer(struct GpsUbxI2C *p, long fd, uint8_t *data, uint16_t len)
Put bytes into transmit buffer.
GpsI2CReadState read_state
void gps_i2c_put_byte(struct GpsUbxI2C *p, long fd, uint8_t data)
Put byte into transmit buffer.
uint16_t tx_buf_idx
tx buf index
uint8_t gps_i2c_getch(struct GpsUbxI2C *p)
get a new char
void null_function(struct GpsUbxI2C *p, uint32_t baudrate)
null function
void gps_ubx_i2c_read_event(void)
handle message reception
struct i2c_transaction trans
i2c transaction
uint8_t rx_buf[GPS_I2C_BUF_SIZE]
receive buffer
#define GPS_I2C_SLAVE_ADDR
void gps_ubx_i2c_periodic(void)
handle message sending
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
uint8_t tx_buf[GPS_I2C_BUF_SIZE]
transmit buffer
uint16_t rx_buf_idx
rx buf index
bool tx_rdy
are we ready to transmit
@ gps_i2c_write_standby
wait for gps_ubx to read buffer or ucenter to transmit
#define GPS_I2C_ADDR_DATA
data stream register
struct link_device device
ppz link device
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
uint16_t gps_ubx_i2c_bytes_to_read
ublox bytes to read
@ gps_i2c_read_data
read data from ubx buffer
enum I2CTransactionStatus status
Transaction status.
Common code for AP and FBW telemetry.
GpsI2CWriteState write_state
int gps_i2c_check_free_space(struct GpsUbxI2C *p, long *fd, uint16_t len)
Check available space in transmit buffer.
void gps_i2c_begin(void)
config is done, begin reading messages
void gps_i2c_msg_ready(struct GpsUbxI2C *p, long fd)
send buffer when ready
void gps_ubx_i2c_init(void)
init function
@ I2CTransDone
transaction set to done by user level
uint8_t gps_i2c_char_available(struct GpsUbxI2C *p)
check if a new character is available
uint16_t rx_buf_avail
how many bytes are waiting to be read
@ gps_i2c_read_standby
dont read anything
@ gps_i2c_read_sizeof
read size of ubx buffer
@ gps_i2c_write_request_size
request size of ubx buffer
bool gps_i2c_tx_is_ready(void)
is driver ready to send a message