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)"
46#define GPS_I2C_ADDR_NB_AVAIL_BYTES 0xFD
47#define GPS_I2C_ADDR_DATA 0xFF
134 for (i = 0; i < len; i++) {
152 return (((
int)
gps_i2c.rx_buf_avail - (
int)
gps_i2c.rx_buf_idx) > 0);
Common code for AP and FBW telemetry.
void gps_ubx_i2c_init(void)
init function
#define GPS_I2C_ADDR_DATA
data stream register
void gps_i2c_begin(void)
config is done, begin reading messages
int gps_i2c_check_free_space(struct GpsUbxI2C *p, long *fd, uint16_t len)
Check available space in transmit buffer.
uint8_t gps_i2c_getch(struct GpsUbxI2C *p)
get a new char
bool gps_ubx_i2c_ucenter_done
ucenter finished configuring flag
uint16_t gps_ubx_i2c_bytes_to_read
ublox bytes to read
bool gps_i2c_tx_is_ready(void)
is driver ready to send a message
#define GPS_I2C_ADDR_NB_AVAIL_BYTES
number of bytes available register
void gps_ubx_i2c_periodic(void)
handle message sending
#define GPS_I2C_SLAVE_ADDR
void gps_ubx_i2c_read_event(void)
handle message reception
void gps_i2c_put_byte(struct GpsUbxI2C *p, long fd, uint8_t data)
Put byte into transmit buffer.
void gps_i2c_msg_ready(struct GpsUbxI2C *p, long fd)
send buffer when ready
int gps_i2c_char_available(struct GpsUbxI2C *p)
check if a new character is available
void gps_i2c_put_buffer(struct GpsUbxI2C *p, long fd, uint8_t *data, uint16_t len)
Put bytes into transmit buffer.
void null_function(struct GpsUbxI2C *p, uint32_t baudrate)
null function
pprz link device for Ublox over I2C
@ gps_i2c_read_data
read data from ubx buffer
@ gps_i2c_read_standby
dont read anything
@ gps_i2c_read_sizeof
read size of ubx buffer
@ gps_i2c_write_cfg
send a config msg and get reply
@ gps_i2c_write_request_size
request size of ubx buffer
@ gps_i2c_write_standby
wait for gps_ubx to read buffer or ucenter to transmit
int baudrate
baudrate, unused
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
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.
@ I2CTransDone
transaction set to done by user level
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
static int null_function(struct SuperbitRF *p)
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.