Loading...
Searching...
No Matches
sx127x_internal.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 Unwired Devices <info@unwds.com>
3 * SPDX-FileCopyrightText: 2017 Inria Chile
4 * SPDX-FileCopyrightText: 2017 Inria
5 * SPDX-License-Identifier: LGPL-2.1-only
6 */
7
8#pragma once
9
20
21#include <inttypes.h>
22#include "sx127x.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
32#if defined(MODULE_SX1272)
33#define SX127X_RSSI_OFFSET (-139)
34#else /* MODULE_SX1276 */
35#define SX127X_RSSI_OFFSET_LF (-164)
36#define SX127X_RSSI_OFFSET_HF (-157)
37#endif
39
44#if defined(MODULE_SX1272)
45#define SX127X_POR_ACTIVE_LOGIC_LEVEL (1)
46#else /* MODULE_SX1276 */
47#define SX127X_POR_ACTIVE_LOGIC_LEVEL (0)
48#endif
50
60
68void sx127x_reg_write(const sx127x_t *dev, uint8_t addr, uint8_t data);
69
78uint8_t sx127x_reg_read(const sx127x_t *dev, uint8_t addr);
79
88void sx127x_reg_write_burst(const sx127x_t *dev, uint8_t addr, uint8_t *buffer,
89 uint8_t size);
90
99void sx127x_reg_read_burst(const sx127x_t *dev, uint8_t addr, uint8_t *buffer,
100 uint8_t size);
101
109void sx127x_write_fifo(const sx127x_t *dev, uint8_t *buffer, uint8_t size);
110
118void sx127x_read_fifo(const sx127x_t *dev, uint8_t *buffer, uint8_t size);
119
127int16_t sx127x_read_rssi(const sx127x_t *dev);
128
129#if defined(MODULE_SX1276)
138void sx1276_rx_chain_calibration(sx127x_t *dev);
139#endif
140
141#ifdef __cplusplus
142}
143#endif
144
Adds include for missing inttype definitions.
SX127X device descriptor.
Definition sx127x.h:239
Public interface for SX127X driver.
uint8_t sx127x_reg_read(const sx127x_t *dev, uint8_t addr)
Reads the radio register at specified address.
int16_t sx127x_read_rssi(const sx127x_t *dev)
Reads the current RSSI value.
void sx127x_reg_write_burst(const sx127x_t *dev, uint8_t addr, uint8_t *buffer, uint8_t size)
Writes multiple radio registers starting at address (burst-mode).
void sx127x_reg_read_burst(const sx127x_t *dev, uint8_t addr, uint8_t *buffer, uint8_t size)
Reads multiple radio registers starting at address.
int sx127x_check_version(const sx127x_t *dev)
Check the transceiver version.
void sx127x_write_fifo(const sx127x_t *dev, uint8_t *buffer, uint8_t size)
Writes the buffer contents to the SX1276 FIFO.
void sx127x_read_fifo(const sx127x_t *dev, uint8_t *buffer, uint8_t size)
Reads the contents of the SX1276 FIFO.
void sx127x_reg_write(const sx127x_t *dev, uint8_t addr, uint8_t data)
Writes the radio register at specified address.