sx127x_internal.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Unwired Devices <info@unwds.com>
3  * 2017 Inria Chile
4  * 2017 Inria
5  *
6  * This file is subject to the terms and conditions of the GNU Lesser
7  * General Public License v2.1. See the file LICENSE in the top level
8  * directory for more details.
9  */
10 
22 #ifndef SX127X_INTERNAL_H
23 #define SX127X_INTERNAL_H
24 
25 #include <inttypes.h>
26 #include "sx127x.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 #if defined(MODULE_SX1272)
37 #define SX127X_RSSI_OFFSET (-139)
38 #else /* MODULE_SX1276 */
39 #define SX127X_RSSI_OFFSET_LF (-164)
40 #define SX127X_RSSI_OFFSET_HF (-157)
41 #endif
42 
50 bool sx127x_test(const sx127x_t *dev);
51 
59 void sx127x_reg_write(const sx127x_t *dev, uint8_t addr, uint8_t data);
60 
69 uint8_t sx127x_reg_read(const sx127x_t *dev, uint8_t addr);
70 
79 void sx127x_reg_write_burst(const sx127x_t *dev, uint8_t addr, uint8_t *buffer,
80  uint8_t size);
81 
90 void sx127x_reg_read_burst(const sx127x_t *dev, uint8_t addr, uint8_t *buffer,
91  uint8_t size);
92 
100 void sx127x_write_fifo(const sx127x_t *dev, uint8_t *buffer, uint8_t size);
101 
109 void sx127x_read_fifo(const sx127x_t *dev, uint8_t *buffer, uint8_t size);
110 
120 
128 int16_t sx127x_read_rssi(const sx127x_t *dev);
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* SX127X_INTERNAL_H */
135 
Public interface for SX127X driver.
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_write(const sx127x_t *dev, uint8_t addr, uint8_t data)
Writes the radio register at specified address.
int16_t sx127x_read_rssi(const sx127x_t *dev)
Reads the current RSSI value.
uint8_t sx127x_reg_read(const sx127x_t *dev, uint8_t addr)
Reads the radio register at specified address.
Adds include for missing inttype definitions.
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_read_burst(const sx127x_t *dev, uint8_t addr, uint8_t *buffer, uint8_t size)
Reads multiple radio registers starting at address.
void sx127x_rx_chain_calibration(sx127x_t *dev)
Performs the Rx chain calibration for LF and HF bands.
bool sx127x_test(const sx127x_t *dev)
Tests the transceiver version type.
SX127X device descriptor.
Definition: sx127x.h:219