Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Maxstream XBee serial input and output. More...
#include "mcu_periph/sys_time.h"
#include "subsystems/datalink/uart_print.h"
#include "subsystems/datalink/xbee.h"
#include "subsystems/datalink/downlink.h"
Go to the source code of this file.
Macros | |
#define | GROUND_STATION_ADDR 0x100 |
Ground station address. More... | |
#define | XBEE_MY_ADDR AC_ID |
Aircraft address. More... | |
#define | TX_OPTIONS 0x00 |
Constants for the API protocol. More... | |
#define | NO_FRAME_ID 0 |
#define | XBEE_API_OVERHEAD 5 /* start + len_msb + len_lsb + API_id + checksum */ |
#define | AT_COMMAND_SEQUENCE "+++" |
#define | AT_SET_MY "ATMY" |
#define | AT_AP_MODE "ATAP1\r" |
#define | AT_EXIT "ATCN\r" |
#define | XBEE_BAUD_ALTERNATE B57600 |
#define | XBEE_ATBD_CODE "ATBD3\rATWR\r" |
Functions | |
static void | put_1byte (struct xbee_transport *trans, struct link_device *dev, const uint8_t byte) |
Xbee protocol implementation. More... | |
static void | put_bytes (struct xbee_transport *trans, struct link_device *dev, enum TransportDataType type, enum TransportDataFormat format, uint8_t len, const void *bytes) |
static void | put_named_byte (struct xbee_transport *trans, struct link_device *dev, enum TransportDataType type, enum TransportDataFormat format, uint8_t byte, const char *name) |
static uint8_t | size_of (struct xbee_transport *trans, uint8_t len) |
static void | start_message (struct xbee_transport *trans, struct link_device *dev, uint8_t payload_len) |
static void | end_message (struct xbee_transport *trans, struct link_device *dev) |
static void | overrun (struct xbee_transport *trans, struct link_device *dev) |
static void | count_bytes (struct xbee_transport *trans, struct link_device *dev, uint8_t bytes) |
static int | check_available_space (struct xbee_transport *trans, struct link_device *dev, uint8_t bytes) |
static uint8_t | xbee_text_reply_is_ok (struct link_device *dev) |
static uint8_t | xbee_try_to_enter_api (struct link_device *dev) |
void | xbee_init (void) |
Initialisation in API mode and setting of the local address FIXME: busy wait. More... | |
Variables | |
struct xbee_transport | xbee_tp |
Maxstream XBee serial input and output.
Definition in file xbee.c.
#define AT_AP_MODE "ATAP1\r" |
Definition at line 47 of file xbee.c.
Referenced by xbee_init().
#define AT_COMMAND_SEQUENCE "+++" |
Definition at line 45 of file xbee.c.
Referenced by xbee_try_to_enter_api().
#define AT_EXIT "ATCN\r" |
Definition at line 48 of file xbee.c.
Referenced by xbee_init().
#define AT_SET_MY "ATMY" |
Definition at line 46 of file xbee.c.
Referenced by xbee_init().
#define XBEE_API_OVERHEAD 5 /* start + len_msb + len_lsb + API_id + checksum */ |
Definition at line 41 of file xbee.c.
Referenced by size_of(), and start_message().
#define XBEE_ATBD_CODE "ATBD3\rATWR\r" |
Definition at line 154 of file xbee.c.
Referenced by xbee_init().
#define XBEE_BAUD_ALTERNATE B57600 |
Definition at line 153 of file xbee.c.
Referenced by xbee_init().
#define XBEE_MY_ADDR AC_ID |
|
static |
Definition at line 113 of file xbee.c.
References link_device::check_free_space, and link_device::periph.
Referenced by xbee_init().
|
static |
Definition at line 107 of file xbee.c.
References link_device::nb_bytes.
Referenced by xbee_init().
|
static |
Definition at line 94 of file xbee.c.
References xbee_transport::cs_tx, link_device::periph, link_device::put_byte, and link_device::send_message.
Referenced by xbee_init().
|
static |
Definition at line 101 of file xbee.c.
References link_device::nb_ovrn.
Referenced by xbee_init().
|
static |
Xbee protocol implementation.
Definition at line 52 of file xbee.c.
References xbee_transport::cs_tx, link_device::periph, and link_device::put_byte.
Referenced by put_bytes(), and put_named_byte().
|
static |
Definition at line 58 of file xbee.c.
References put_1byte().
Referenced by start_message(), and xbee_init().
|
static |
Definition at line 69 of file xbee.c.
References put_1byte().
Referenced by xbee_init().
|
static |
Definition at line 76 of file xbee.c.
References XBEE_API_OVERHEAD, and XBEE_TX_OVERHEAD.
Referenced by xbee_init().
|
static |
Definition at line 82 of file xbee.c.
References xbee_transport::cs_tx, DL_FORMAT_SCALAR, DL_TYPE_UINT8, link_device::nb_msgs, link_device::periph, link_device::put_byte, put_bytes(), XBEE_API_OVERHEAD, XBEE_START, XBEE_TX_HEADER, and XBEE_TX_OVERHEAD.
Referenced by xbee_init().
void xbee_init | ( | void | ) |
Initialisation in API mode and setting of the local address FIXME: busy wait.
Setting my address
Switching back to normal mode
Definition at line 165 of file xbee.c.
References AT_AP_MODE, AT_EXIT, AT_SET_MY, link_device::char_available, transport_tx::check_available_space, check_available_space(), transport_tx::count_bytes, count_bytes(), end_message(), transport_tx::end_message, FALSE, link_device::get_byte, transport_tx::impl, transport_rx::msg_received, transport_tx::overrun, overrun(), link_device::periph, print_hex16(), print_string(), put_bytes(), transport_tx::put_bytes, put_named_byte(), transport_tx::put_named_byte, size_of(), transport_tx::size_of, start_message(), transport_tx::start_message, xbee_transport::status, sys_time_usleep(), xbee_transport::trans_rx, xbee_transport::trans_tx, uart_periph_set_baudrate(), XBEE_ATBD_CODE, XBEE_BAUD_ALTERNATE, XBEE_MY_ADDR, xbee_tp, xbee_try_to_enter_api(), and XBEE_UNINIT.
Referenced by downlink_init().
|
static |
Definition at line 119 of file xbee.c.
References link_device::char_available, FALSE, link_device::get_byte, link_device::periph, and TRUE.
Referenced by xbee_try_to_enter_api().
|
static |
Switching to AT mode (FIXME: busy waiting)
Definition at line 139 of file xbee.c.
References AT_COMMAND_SEQUENCE, print_string(), sys_time_usleep(), and xbee_text_reply_is_ok().
Referenced by xbee_init().
struct xbee_transport xbee_tp |
Definition at line 43 of file xbee.c.
Referenced by xbee_init().