Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Bluegiga Bluetooth chip I/O. More...
#include "mcu_periph/link_device.h"
#include "subsystems/datalink/pprz_transport.h"
#include "led.h"
Go to the source code of this file.
Data Structures | |
struct | bluegiga_periph |
Macros | |
#define | BLUEGIGA_BUFFER_SIZE 256 |
#define | BlueGigaCheckAndParse(_dev, _trans) |
Enumerations | |
enum | BlueGigaStatus { BLUEGIGA_UNINIT, BLUEGIGA_IDLE, BLUEGIGA_SENDING, BLUEGIGA_BROADCASTING } |
Functions | |
bool_t | bluegiga_ch_available (struct bluegiga_periph *p) |
void | bluegiga_increment_buf (uint8_t *buf_idx, uint8_t len) |
void | bluegiga_init (struct bluegiga_periph *p) |
void | bluegiga_scan (struct bluegiga_periph *p) |
void | bluegiga_request_all_rssi (struct bluegiga_periph *p) |
static void | bluegiga_read_buffer (struct bluegiga_periph *p, struct pprz_transport *t) |
Variables | |
struct bluegiga_periph | bluegiga_p |
signed char | bluegiga_rssi [] |
Bluegiga Bluetooth chip I/O.
Definition in file bluegiga.h.
struct bluegiga_periph |
Definition at line 48 of file bluegiga.h.
Data Fields | ||
---|---|---|
uint32_t | bytes_recvd_since_last | |
struct link_device | device | Generic device interface. |
uint8_t | end_of_msg | |
uint8_t | rx_buf[BLUEGIGA_BUFFER_SIZE] | |
uint8_t | rx_extract_idx | |
uint8_t | rx_insert_idx | |
uint8_t | tx_buf[BLUEGIGA_BUFFER_SIZE] | |
uint8_t | tx_extract_idx | |
uint8_t | tx_insert_idx | |
uint8_t | work_rx[20] | |
uint8_t | work_tx[20] |
#define BLUEGIGA_BUFFER_SIZE 256 |
Definition at line 41 of file bluegiga.h.
Referenced by bluegiga_increment_buf(), bluegiga_load_tx(), bluegiga_read_buffer(), bluegiga_receive(), and dev_check_free_space().
#define BlueGigaCheckAndParse | ( | _dev, | |
_trans | |||
) |
Definition at line 107 of file bluegiga.h.
enum BlueGigaStatus |
Enumerator | |
---|---|
BLUEGIGA_UNINIT |
The com isn't initialized. |
BLUEGIGA_IDLE |
The com is in idle. |
BLUEGIGA_SENDING |
The com is sending. |
BLUEGIGA_BROADCASTING |
The com is switched from data link to rssi scanning. |
Definition at line 33 of file bluegiga.h.
bool_t bluegiga_ch_available | ( | struct bluegiga_periph * | p | ) |
Definition at line 97 of file bluegiga.c.
References bluegiga_periph::rx_extract_idx, and bluegiga_periph::rx_insert_idx.
Referenced by bluegiga_read_buffer(), and dev_char_available().
Definition at line 103 of file bluegiga.c.
References BLUEGIGA_BUFFER_SIZE.
Referenced by bluegiga_load_tx(), bluegiga_read_buffer(), bluegiga_receive(), bluegiga_transmit(), and dev_get_byte().
void bluegiga_init | ( | struct bluegiga_periph * | p | ) |
Definition at line 126 of file bluegiga.c.
References spi_transaction::after_cb, spi_transaction::bitorder, BLUEGIGA_DRDY_GPIO, BLUEGIGA_DRDY_GPIO_PIN, bluegiga_rssi, bluegiga_spi, BLUEGIGA_UNINIT, bluegiga_periph::bytes_recvd_since_last, spi_transaction::cdiv, link_device::char_available, link_device::check_free_space, coms_status, spi_transaction::cpha, spi_transaction::cpol, DefaultPeriodic, dev_char_available(), dev_check_free_space(), dev_get_byte(), dev_put_byte(), dev_send_message(), bluegiga_periph::device, spi_transaction::dss, bluegiga_periph::end_of_msg, link_device::get_byte, gpio_set(), gpio_setup_output(), spi_transaction::input_buf, spi_transaction::input_length, LED_INIT, spi_transaction::output_buf, spi_transaction::output_length, link_device::periph, link_device::put_byte, register_periodic_telemetry(), bluegiga_periph::rx_extract_idx, bluegiga_periph::rx_insert_idx, spi_transaction::select, link_device::send_message, spi_transaction::slave_idx, spi_slave_register(), SPICphaEdge2, SPICpolIdleHigh, SPIDiv64, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, trans_cb(), bluegiga_periph::tx_extract_idx, bluegiga_periph::tx_insert_idx, bluegiga_periph::work_rx, and bluegiga_periph::work_tx.
Referenced by downlink_init().
|
inlinestatic |
Definition at line 85 of file bluegiga.h.
References BLUEGIGA_BUFFER_SIZE, bluegiga_ch_available(), bluegiga_increment_buf(), FALSE, LED_TOGGLE, transport_rx::msg_received, parse_pprz(), pprz_parse_payload(), bluegiga_periph::rx_buf, bluegiga_periph::rx_extract_idx, bluegiga_periph::rx_insert_idx, and pprz_transport::trans_rx.
void bluegiga_request_all_rssi | ( | struct bluegiga_periph * | p | ) |
Definition at line 322 of file bluegiga.c.
References BLUEGIGA_DRDY_GPIO, BLUEGIGA_DRDY_GPIO_PIN, BLUEGIGA_SENDING, coms_status, gpio_clear(), and bluegiga_periph::work_tx.
void bluegiga_scan | ( | struct bluegiga_periph * | p | ) |
Definition at line 309 of file bluegiga.c.
References BLUEGIGA_DRDY_GPIO, BLUEGIGA_DRDY_GPIO_PIN, BLUEGIGA_SENDING, coms_status, gpio_clear(), and bluegiga_periph::work_tx.
struct bluegiga_periph bluegiga_p |
Definition at line 50 of file bluegiga.c.
Referenced by bluegiga_receive(), and downlink_init().
signed char bluegiga_rssi[] |
Definition at line 53 of file bluegiga.c.
Referenced by bluegiga_init(), and bluegiga_receive().