![]() |
Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for the cyrf6936 2.4GHz radio chip. More...
#include "cyrf6936.h"
#include "mcu_periph/spi.h"
#include "mcu_periph/gpio.h"
#include "mcu_periph/sys_time.h"
#include "modules/radio_control/radio_control.h"
#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
Go to the source code of this file.
Functions | |
static bool | cyrf6936_write_register (struct Cyrf6936 *cyrf, const uint8_t addr, const uint8_t data) |
Write a byte to a register. | |
static bool | cyrf6936_write_block (struct Cyrf6936 *cyrf, const uint8_t addr, const uint8_t data[], const uint8_t length) |
Write multiple bytes to a register. | |
static bool | cyrf6936_read_register (struct Cyrf6936 *cyrf, const uint8_t addr) |
Read a byte from a register. | |
static bool | cyrf6936_read_block (struct Cyrf6936 *cyrf, const uint8_t addr, const uint8_t length) |
Read multiple bytes from a register. | |
void | cyrf6936_init (struct Cyrf6936 *cyrf, struct spi_periph *spi_p, const uint8_t slave_idx, const uint32_t rst_port, const uint16_t rst_pin) |
Initializing the cyrf chip. | |
void | cyrf6936_event (struct Cyrf6936 *cyrf) |
The on event call for the CYRF6936 chip. | |
bool | cyrf6936_write (struct Cyrf6936 *cyrf, const uint8_t addr, const uint8_t data) |
Write to one register. | |
bool | cyrf6936_multi_write (struct Cyrf6936 *cyrf, const uint8_t data[][2], const uint8_t length) |
Write to multiple registers one byte. | |
bool | cyrf6936_write_chan_sop_data_crc (struct Cyrf6936 *cyrf, const uint8_t chan, const uint8_t sop_code[], const uint8_t data_code[], const uint16_t crc_seed) |
Set the channel, SOP code, DATA code and the CRC seed. | |
bool | cyrf6936_read_rx_irq_status_packet (struct Cyrf6936 *cyrf) |
Read the RX IRQ status register, the rx status register and the rx packet. | |
bool | cyrf6936_send (struct Cyrf6936 *cyrf, const uint8_t data[], const uint8_t length) |
Send a packet with a certain length. | |
Driver for the cyrf6936 2.4GHz radio chip.
Definition in file cyrf6936.c.
The on event call for the CYRF6936 chip.
Definition at line 86 of file cyrf6936.c.
References CYRF6936_CHAN_SOP_DATA_CRC, CYRF6936_DATA_CODE, CYRF6936_GET_MFG_ID, CYRF6936_IDLE, CYRF6936_MULTIWRITE, cyrf6936_read_block(), cyrf6936_read_register(), CYRF6936_RX_IRQ_STATUS_PACKET, CYRF6936_SEND, CYRF6936_UNINIT, cyrf6936_write_block(), cyrf6936_write_register(), CYRF_CHANNEL, CYRF_CRC_SEED_LSB, CYRF_CRC_SEED_MSB, CYRF_DATA_CODE, CYRF_MFG_ID, CYRF_RX_BUFFER, CYRF_RX_COUNT, CYRF_RX_IRQ_STATUS, CYRF_RX_STATUS, CYRF_SOP_CODE, CYRF_TX_BUFFER, CYRF_TX_CLR, CYRF_TX_CTRL, CYRF_TX_GO, CYRF_TX_IRQ_STATUS, CYRF_TX_LENGTH, CYRF_TXC_IRQEN, CYRF_TXE_IRQEN, foo, SPITransDone, SPITransFailed, SPITransPending, and SPITransRunning.
Referenced by superbitrf_rc_event().
void cyrf6936_init | ( | struct Cyrf6936 * | cyrf, |
struct spi_periph * | spi_p, | ||
const uint8_t | slave_idx, | ||
const uint32_t | rst_port, | ||
const uint16_t | rst_pin | ||
) |
Initializing the cyrf chip.
Definition at line 47 of file cyrf6936.c.
References CYRF6936_GET_MFG_ID, CYRF6936_UNINIT, cyrf6936_write_register(), CYRF_MFG_ID, foo, gpio_clear(), gpio_set(), gpio_setup_output(), SPICphaEdge1, SPICpolIdleLow, SPIDiv64, SPIDss8bit, SPIMSBFirst, SPISelectUnselect, SPITransDone, spi_periph::status, and sys_time_usleep().
Referenced by superbitrf_init().
Write to multiple registers one byte.
Definition at line 341 of file cyrf6936.c.
References CYRF6936_IDLE, CYRF6936_MULTIWRITE, cyrf6936_write_register(), and foo.
Referenced by cyrf6936_write(), superbitrf_event(), and superbitrf_receive_packet_cb().
|
static |
Read multiple bytes from a register.
Definition at line 312 of file cyrf6936.c.
References foo, spi_submit(), and SPITransDone.
Referenced by cyrf6936_event(), and cyrf6936_read_register().
Read a byte from a register.
Definition at line 304 of file cyrf6936.c.
References cyrf6936_read_block(), and foo.
Referenced by cyrf6936_event(), and cyrf6936_read_rx_irq_status_packet().
Read the RX IRQ status register, the rx status register and the rx packet.
Definition at line 412 of file cyrf6936.c.
References CYRF6936_IDLE, cyrf6936_read_register(), CYRF6936_RX_IRQ_STATUS_PACKET, CYRF_RX_IRQ_STATUS, and foo.
Referenced by superbitrf_event().
Send a packet with a certain length.
Definition at line 432 of file cyrf6936.c.
References CYRF6936_IDLE, CYRF6936_SEND, cyrf6936_write_register(), CYRF_TX_LENGTH, and foo.
Referenced by superbitrf_event().
Write to one register.
Definition at line 330 of file cyrf6936.c.
References cyrf6936_multi_write(), and foo.
Referenced by superbitrf_event().
|
static |
Write multiple bytes to a register.
Definition at line 278 of file cyrf6936.c.
References CYRF_DIR, foo, spi_submit(), and SPITransDone.
Referenced by cyrf6936_event(), and cyrf6936_write_register().
bool cyrf6936_write_chan_sop_data_crc | ( | struct Cyrf6936 * | cyrf, |
const uint8_t | chan, | ||
const uint8_t | sop_code[], | ||
const uint8_t | data_code[], | ||
const uint16_t | crc_seed | ||
) |
Set the channel, SOP code, DATA code and the CRC seed.
Definition at line 373 of file cyrf6936.c.
References CYRF6936_CHAN_SOP_DATA_CRC, CYRF6936_IDLE, cyrf6936_write_register(), CYRF_CRC_SEED_LSB, and foo.
Referenced by superbitrf_event().
|
static |
Write a byte to a register.
Definition at line 270 of file cyrf6936.c.
References cyrf6936_write_block(), and foo.
Referenced by cyrf6936_event(), cyrf6936_init(), cyrf6936_multi_write(), cyrf6936_send(), and cyrf6936_write_chan_sop_data_crc().