Damian Gabino / picoGW_mcu
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers loragw_radio.h Source File

loragw_radio.h

00001 /*
00002  / _____)             _              | |
00003 ( (____  _____ ____ _| |_ _____  ____| |__
00004  \____ \| ___ |    (_   _) ___ |/ ___)  _ \
00005  _____) ) ____| | | || |_| ____( (___| | | |
00006 (______/|_____)_|_|_| \__)_____)\____)_| |_|
00007   (C)2017 Semtech-Cycleo
00008 
00009 Description:
00010     Functions used to handle LoRa concentrator radios.
00011 
00012 License: Revised BSD License, see LICENSE.TXT file include in the project
00013 
00014 */
00015 
00016 #ifndef _LORAGW_RADIO_H
00017 #define _LORAGW_RADIO_H
00018 
00019 /* -------------------------------------------------------------------------- */
00020 /* --- DEPENDANCIES --------------------------------------------------------- */
00021 
00022 #include <stdint.h>     /* C99 types */
00023 #include <stdbool.h>    /* bool type */
00024 
00025 /* -------------------------------------------------------------------------- */
00026 /* --- PUBLIC CONSTANTS ----------------------------------------------------- */
00027 
00028 #define LGW_REG_SUCCESS 0
00029 #define LGW_REG_ERROR -1
00030 
00031 #define SX125x_32MHz_FRAC 15625 /* irreductible fraction for PLL register caculation */
00032 
00033 /* -------------------------------------------------------------------------- */
00034 /* --- PUBLIC CONSTANTS ----------------------------------------------------- */
00035 
00036 enum lgw_sx127x_rxbw_e {
00037     LGW_SX127X_RXBW_2K6_HZ,
00038     LGW_SX127X_RXBW_3K1_HZ,
00039     LGW_SX127X_RXBW_3K9_HZ,
00040     LGW_SX127X_RXBW_5K2_HZ,
00041     LGW_SX127X_RXBW_6K3_HZ,
00042     LGW_SX127X_RXBW_7K8_HZ,
00043     LGW_SX127X_RXBW_10K4_HZ,
00044     LGW_SX127X_RXBW_12K5_HZ,
00045     LGW_SX127X_RXBW_15K6_HZ,
00046     LGW_SX127X_RXBW_20K8_HZ,
00047     LGW_SX127X_RXBW_25K_HZ,
00048     LGW_SX127X_RXBW_31K3_HZ,
00049     LGW_SX127X_RXBW_41K7_HZ,
00050     LGW_SX127X_RXBW_50K_HZ,
00051     LGW_SX127X_RXBW_62K5_HZ,
00052     LGW_SX127X_RXBW_83K3_HZ,
00053     LGW_SX127X_RXBW_100K_HZ,
00054     LGW_SX127X_RXBW_125K_HZ,
00055     LGW_SX127X_RXBW_166K7_HZ,
00056     LGW_SX127X_RXBW_200K_HZ,
00057     LGW_SX127X_RXBW_250K_HZ
00058 };
00059 
00060 /* -------------------------------------------------------------------------- */
00061 /* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */
00062 
00063 int lgw_setup_sx125x(uint8_t rf_chain, uint8_t rf_clkout, bool rf_enable, uint8_t rf_radio_type, uint32_t freq_hz);
00064 
00065 int lgw_setup_sx127x(uint32_t frequency, uint8_t modulation, enum lgw_sx127x_rxbw_e rxbw_khz, int8_t rssi_offset);
00066 
00067 int lgw_sx127x_reg_w(uint8_t address, uint8_t reg_value);
00068 
00069 int lgw_sx127x_reg_r(uint8_t address, uint8_t *reg_value);
00070 
00071 
00072 #endif
00073 /* --- EOF ------------------------------------------------------------------ */