Pico GPS Teseo I2C
|
#include "hw.h"
#include "sx1280-hal.h"
#include "radio.h"
#include <string.h>
#include "SEGGER_RTT.h"
Go to the source code of this file.
Macros | |
#define | printf(format, ...) |
#define | RADIO_BUSY_PORT RADIO_BUSY_GPIO_Port |
#define | RADIO_BUSY_PIN RADIO_BUSY_Pin |
#define | RADIO_nRESET_PORT RADIO_nRESET_GPIO_Port |
#define | RADIO_nRESET_PIN RADIO_nRESET_Pin |
#define | RADIO_NSS_PORT RADIO_NSS_GPIO_Port |
#define | RADIO_NSS_PIN RADIO_NSS_Pin |
#define | MAX_HAL_BUFFER_SIZE 0xFFF |
Define the size of tx and rx hal buffers. | |
#define | IRQ_HIGH_PRIORITY 0 |
Functions | |
void | SX1280HalSpiTxThenRx (uint16_t tx_len, uint8_t *rx_buffer, uint16_t rx_len) |
void | SX1280HalWaitOnBusy (void) |
Used to block execution waiting for low state on radio busy pin. Essentially used in SPI communications. | |
void | SX1280HalInit (DioIrqHandler **irqHandlers) |
void | HAL_GPIO_EXTI_Callback (uint16_t GPIO_Pin) |
void | SX1280HalIoIrqInit (DioIrqHandler **irqHandlers) |
void | SX1280HalReset (void) |
Soft resets the radio. | |
void | SX1280HalWakeup (void) |
Wakes up the radio. | |
void | SX1280HalWriteCommand (RadioCommands_t command, uint8_t *buffer, uint16_t size) |
Send a command that write data to the radio. | |
void | SX1280HalReadCommand (RadioCommands_t command, uint8_t *buffer, uint16_t size) |
Send a command that read data from the radio. | |
void | SX1280HalWriteRegisters (uint16_t address, uint8_t *buffer, uint16_t size) |
Write data to the radio memory. | |
void | SX1280HalWriteRegister (uint16_t address, uint8_t value) |
Write a single byte of data to the radio memory. | |
void | SX1280HalReadRegisters (uint16_t address, uint8_t *buffer, uint16_t size) |
Read data from the radio memory. | |
uint8_t | SX1280HalReadRegister (uint16_t address) |
Read a single byte of data from the radio memory. | |
void | SX1280HalWriteBuffer (uint8_t offset, uint8_t *buffer, uint8_t size) |
Write data to the buffer holding the payload in the radio. | |
void | SX1280HalReadBuffer (uint8_t offset, uint8_t *buffer, uint8_t size) |
Read data from the buffer holding the payload in the radio. | |
uint8_t | SX1280HalGetDioStatus (void) |
Returns the status of DIOs pins. | |
Variables | |
const struct Radio_s | Radio |
Radio driver. | |
SPI_HandleTypeDef | RADIO_SPI_HANDLE |
DMA_HandleTypeDef | RADIO_SPI_DMA_RX |
DMA_HandleTypeDef | RADIO_SPI_DMA_TX |
#define IRQ_HIGH_PRIORITY 0 |
Definition at line 55 of file sx1280-hal.c.
#define MAX_HAL_BUFFER_SIZE 0xFFF |
Define the size of tx and rx hal buffers.
The Tx and Rx hal buffers are used for SPI communication to store data to be sent/receive to/from the chip.
Definition at line 53 of file sx1280-hal.c.
#define printf | ( | format, | |
... ) |
Definition at line 23 of file sx1280-hal.c.
#define RADIO_BUSY_PIN RADIO_BUSY_Pin |
Definition at line 30 of file sx1280-hal.c.
#define RADIO_BUSY_PORT RADIO_BUSY_GPIO_Port |
Definition at line 27 of file sx1280-hal.c.
#define RADIO_nRESET_PIN RADIO_nRESET_Pin |
Definition at line 36 of file sx1280-hal.c.
#define RADIO_nRESET_PORT RADIO_nRESET_GPIO_Port |
Definition at line 33 of file sx1280-hal.c.
#define RADIO_NSS_PIN RADIO_NSS_Pin |
Definition at line 42 of file sx1280-hal.c.
#define RADIO_NSS_PORT RADIO_NSS_GPIO_Port |
Definition at line 39 of file sx1280-hal.c.
uint8_t SX1280HalGetDioStatus | ( | void | ) |
Returns the status of DIOs pins.
dioStatus | A byte where each bit represents a DIO state: [ DIOx | BUSY ] |
Definition at line 452 of file sx1280-hal.c.
void SX1280HalInit | ( | DioIrqHandler ** | irqHandlers | ) |
Definition at line 257 of file sx1280-hal.c.
void SX1280HalIoIrqInit | ( | DioIrqHandler ** | irqHandlers | ) |
Definition at line 269 of file sx1280-hal.c.
void SX1280HalReadBuffer | ( | uint8_t | offset, |
uint8_t * | buffer, | ||
uint8_t | size ) |
Read data from the buffer holding the payload in the radio.
[in] | offset | The offset to start reading the payload |
[out] | buffer | A pointer to a buffer holding the data from the radio |
[in] | size | The number of byte to be read |
Definition at line 435 of file sx1280-hal.c.
void SX1280HalReadCommand | ( | RadioCommands_t | opcode, |
uint8_t * | buffer, | ||
uint16_t | size ) |
Send a command that read data from the radio.
[in] | opcode | Opcode of the command |
[out] | buffer | Buffer holding data from the radio |
[in] | size | Size of the buffer |
Definition at line 350 of file sx1280-hal.c.
uint8_t SX1280HalReadRegister | ( | uint16_t | address | ) |
Read a single byte of data from the radio memory.
[in] | address | The address of the first byte to write in the radio |
value | The value of the byte at the given address in radio's memory |
Definition at line 408 of file sx1280-hal.c.
void SX1280HalReadRegisters | ( | uint16_t | address, |
uint8_t * | buffer, | ||
uint16_t | size ) |
Read data from the radio memory.
[in] | address | The address of the first byte to read from the radio |
[out] | buffer | The buffer that holds data read from radio |
[in] | size | The number of bytes to read from radio's memory |
Definition at line 390 of file sx1280-hal.c.
void SX1280HalReset | ( | void | ) |
Soft resets the radio.
Definition at line 274 of file sx1280-hal.c.
void SX1280HalSpiTxThenRx | ( | uint16_t | tx_len, |
uint8_t * | rx_buffer, | ||
uint16_t | rx_len ) |
Definition at line 216 of file sx1280-hal.c.
void SX1280HalWaitOnBusy | ( | void | ) |
Used to block execution waiting for low state on radio busy pin. Essentially used in SPI communications.
Definition at line 252 of file sx1280-hal.c.
void SX1280HalWakeup | ( | void | ) |
Wakes up the radio.
Definition at line 310 of file sx1280-hal.c.
void SX1280HalWriteBuffer | ( | uint8_t | offset, |
uint8_t * | buffer, | ||
uint8_t | size ) |
Write data to the buffer holding the payload in the radio.
[in] | offset | The offset to start writing the payload |
[in] | buffer | The data to be written (the payload) |
[in] | size | The number of byte to be written |
Definition at line 417 of file sx1280-hal.c.
void SX1280HalWriteCommand | ( | RadioCommands_t | opcode, |
uint8_t * | buffer, | ||
uint16_t | size ) |
Send a command that write data to the radio.
[in] | opcode | Opcode of the command |
[in] | buffer | Buffer to be send to the radio |
[in] | size | Size of the buffer to send |
Definition at line 330 of file sx1280-hal.c.
void SX1280HalWriteRegister | ( | uint16_t | address, |
uint8_t | value ) |
Write a single byte of data to the radio memory.
[in] | address | The address of the first byte to write in the radio |
[in] | value | The data to be written in radio's memory |
Definition at line 385 of file sx1280-hal.c.
void SX1280HalWriteRegisters | ( | uint16_t | address, |
uint8_t * | buffer, | ||
uint16_t | size ) |
Write data to the radio memory.
[in] | address | The address of the first byte to write in the radio |
[in] | buffer | The data to be written in radio's memory |
[in] | size | The number of bytes to write in radio's memory |
Definition at line 366 of file sx1280-hal.c.
const struct Radio_s Radio |
|
extern |
|
extern |
|
extern |