First attempt at LoRa USB Tx

Dependencies:   BufferedSerial SX1276GenericLib mbed

Fork of DISCO-L072CZ-LRWAN1_LoRa_PingPong by ST

Committer:
akashvibhute
Date:
Tue Jan 02 06:34:03 2018 +0000
Revision:
11:52f7b34f1d3a
Parent:
0:c43b6919ae15
First attempt at LoRa USB Tx

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Helmut64 0:c43b6919ae15 1 /*
Helmut64 0:c43b6919ae15 2 * Copyright (c) 2017 Helmut Tschemernjak
Helmut64 0:c43b6919ae15 3 * 30826 Garbsen (Hannover) Germany
Helmut64 0:c43b6919ae15 4 * Licensed under the Apache License, Version 2.0);
Helmut64 0:c43b6919ae15 5 */
Helmut64 0:c43b6919ae15 6
Helmut64 0:c43b6919ae15 7 #include "mbed.h"
Helmut64 0:c43b6919ae15 8 #include "PinMap.h"
Helmut64 0:c43b6919ae15 9 #include "BufferedSerial.h"
akashvibhute 11:52f7b34f1d3a 10 #include "sx1276-mbed-hal.h"
Helmut64 0:c43b6919ae15 11
Helmut64 0:c43b6919ae15 12 void SystemClock_Config(void);
Helmut64 0:c43b6919ae15 13
Helmut64 0:c43b6919ae15 14 extern BufferedSerial *ser;
Helmut64 0:c43b6919ae15 15 extern void dump(const char *title, const void *data, int len, bool dwords = false);
Helmut64 0:c43b6919ae15 16
akashvibhute 11:52f7b34f1d3a 17 #define dprintf(...) { ser->printf(__VA_ARGS__); ser->printf("\r\n"); }
akashvibhute 11:52f7b34f1d3a 18
akashvibhute 11:52f7b34f1d3a 19 int SX1276PingPong(void);
akashvibhute 11:52f7b34f1d3a 20 int SX1276Comm(uint8_t *commDataTx, bool mode, bool ack);
akashvibhute 11:52f7b34f1d3a 21 /*
akashvibhute 11:52f7b34f1d3a 22 * Callback functions prototypes
akashvibhute 11:52f7b34f1d3a 23 */
akashvibhute 11:52f7b34f1d3a 24 /*!
akashvibhute 11:52f7b34f1d3a 25 * @brief Function to be executed on Radio Tx Done event
akashvibhute 11:52f7b34f1d3a 26 */
akashvibhute 11:52f7b34f1d3a 27 void OnTxDone(void *radio);
akashvibhute 11:52f7b34f1d3a 28
akashvibhute 11:52f7b34f1d3a 29 /*!
akashvibhute 11:52f7b34f1d3a 30 * @brief Function to be executed on Radio Rx Done event
akashvibhute 11:52f7b34f1d3a 31 */
akashvibhute 11:52f7b34f1d3a 32 void OnRxDone(void *radio, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr );
akashvibhute 11:52f7b34f1d3a 33
akashvibhute 11:52f7b34f1d3a 34 /*!
akashvibhute 11:52f7b34f1d3a 35 * @brief Function executed on Radio Tx Timeout event
akashvibhute 11:52f7b34f1d3a 36 */
akashvibhute 11:52f7b34f1d3a 37 void OnTxTimeout(void *radio);
akashvibhute 11:52f7b34f1d3a 38
akashvibhute 11:52f7b34f1d3a 39 /*!
akashvibhute 11:52f7b34f1d3a 40 * @brief Function executed on Radio Rx Timeout event
akashvibhute 11:52f7b34f1d3a 41 */
akashvibhute 11:52f7b34f1d3a 42 void OnRxTimeout(void *radio);
akashvibhute 11:52f7b34f1d3a 43
akashvibhute 11:52f7b34f1d3a 44 /*!
akashvibhute 11:52f7b34f1d3a 45 * @brief Function executed on Radio Rx Error event
akashvibhute 11:52f7b34f1d3a 46 */
akashvibhute 11:52f7b34f1d3a 47 void OnRxError(void *radio);
akashvibhute 11:52f7b34f1d3a 48
akashvibhute 11:52f7b34f1d3a 49 /*!
akashvibhute 11:52f7b34f1d3a 50 * @brief Function executed on Radio Fhss Change Channel event
akashvibhute 11:52f7b34f1d3a 51 */
akashvibhute 11:52f7b34f1d3a 52 void OnFhssChangeChannel(void *radio, uint8_t channelIndex );
akashvibhute 11:52f7b34f1d3a 53
akashvibhute 11:52f7b34f1d3a 54 /*!
akashvibhute 11:52f7b34f1d3a 55 * @brief Function executed on CAD Done event
akashvibhute 11:52f7b34f1d3a 56 */
akashvibhute 11:52f7b34f1d3a 57 void OnCadDone(void *radio);