Host driver/HAL to build a LoRa Picocell Gateway which communicates through USB with a concentrator board based on Semtech SX1308 multi-channel modem and SX1257/SX1255 RF transceivers.
libloragw/inc/loragw_aux.h@0:102b50f941d0, 2018-04-11 (annotated)
- Committer:
- dgabino
- Date:
- Wed Apr 11 14:38:42 2018 +0000
- Revision:
- 0:102b50f941d0
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dgabino | 0:102b50f941d0 | 1 | /* |
dgabino | 0:102b50f941d0 | 2 | / _____) _ | | |
dgabino | 0:102b50f941d0 | 3 | ( (____ _____ ____ _| |_ _____ ____| |__ |
dgabino | 0:102b50f941d0 | 4 | \____ \| ___ | (_ _) ___ |/ ___) _ \ |
dgabino | 0:102b50f941d0 | 5 | _____) ) ____| | | || |_| ____( (___| | | | |
dgabino | 0:102b50f941d0 | 6 | (______/|_____)_|_|_| \__)_____)\____)_| |_| |
dgabino | 0:102b50f941d0 | 7 | (C)2017 Semtech-Cycleo |
dgabino | 0:102b50f941d0 | 8 | |
dgabino | 0:102b50f941d0 | 9 | Description: |
dgabino | 0:102b50f941d0 | 10 | LoRa concentrator HAL common auxiliary functions |
dgabino | 0:102b50f941d0 | 11 | |
dgabino | 0:102b50f941d0 | 12 | License: Revised BSD License, see LICENSE.TXT file include in the project |
dgabino | 0:102b50f941d0 | 13 | |
dgabino | 0:102b50f941d0 | 14 | */ |
dgabino | 0:102b50f941d0 | 15 | |
dgabino | 0:102b50f941d0 | 16 | |
dgabino | 0:102b50f941d0 | 17 | #ifndef _LORAGW_AUX_H |
dgabino | 0:102b50f941d0 | 18 | #define _LORAGW_AUX_H |
dgabino | 0:102b50f941d0 | 19 | |
dgabino | 0:102b50f941d0 | 20 | /* -------------------------------------------------------------------------- */ |
dgabino | 0:102b50f941d0 | 21 | /* --- DEPENDANCIES --------------------------------------------------------- */ |
dgabino | 0:102b50f941d0 | 22 | |
dgabino | 0:102b50f941d0 | 23 | #include "config.h" /* library configuration options (dynamically generated) */ |
dgabino | 0:102b50f941d0 | 24 | |
dgabino | 0:102b50f941d0 | 25 | /* -------------------------------------------------------------------------- */ |
dgabino | 0:102b50f941d0 | 26 | /* --- PUBLIC MACROS -------------------------------------------------------- */ |
dgabino | 0:102b50f941d0 | 27 | |
dgabino | 0:102b50f941d0 | 28 | /** |
dgabino | 0:102b50f941d0 | 29 | @brief Get a particular bit value from a byte |
dgabino | 0:102b50f941d0 | 30 | @param b [in] Any byte from which we want a bit value |
dgabino | 0:102b50f941d0 | 31 | @param p [in] Position of the bit in the byte [0..7] |
dgabino | 0:102b50f941d0 | 32 | @param n [in] Number of bits we want to get |
dgabino | 0:102b50f941d0 | 33 | @return The value corresponding the requested bits |
dgabino | 0:102b50f941d0 | 34 | */ |
dgabino | 0:102b50f941d0 | 35 | #define TAKE_N_BITS_FROM(b, p, n) (((b) >> (p)) & ((1 << (n)) - 1)) |
dgabino | 0:102b50f941d0 | 36 | |
dgabino | 0:102b50f941d0 | 37 | /* -------------------------------------------------------------------------- */ |
dgabino | 0:102b50f941d0 | 38 | /* --- PUBLIC FUNCTIONS PROTOTYPES ------------------------------------------ */ |
dgabino | 0:102b50f941d0 | 39 | |
dgabino | 0:102b50f941d0 | 40 | /** |
dgabino | 0:102b50f941d0 | 41 | @brief Wait for a certain time (millisecond accuracy) |
dgabino | 0:102b50f941d0 | 42 | @param t number of milliseconds to wait. |
dgabino | 0:102b50f941d0 | 43 | */ |
dgabino | 0:102b50f941d0 | 44 | void wait_ms_linux(unsigned long t); |
dgabino | 0:102b50f941d0 | 45 | void wait_ns_linux(unsigned long t); |
dgabino | 0:102b50f941d0 | 46 | void wait_ms(unsigned long t); |
dgabino | 0:102b50f941d0 | 47 | void wait_ns(unsigned long t); |
dgabino | 0:102b50f941d0 | 48 | |
dgabino | 0:102b50f941d0 | 49 | #endif |
dgabino | 0:102b50f941d0 | 50 | |
dgabino | 0:102b50f941d0 | 51 | /* --- EOF ------------------------------------------------------------------ */ |