GPS working with LoRa code - can't transmit faster that once every 6 seconds

Dependencies:   mbed LoRaWAN-lib_gps_lora SingleFrequencyLora

Committer:
Rishin
Date:
Wed Nov 29 15:01:09 2017 +0000
Revision:
15:b4d11baea8bc
Parent:
13:66d854ad31d8
publishining gps with lora

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Rishin 13:66d854ad31d8 1 /*
Rishin 13:66d854ad31d8 2 / _____) _ | |
Rishin 13:66d854ad31d8 3 ( (____ _____ ____ _| |_ _____ ____| |__
Rishin 13:66d854ad31d8 4 \____ \| ___ | (_ _) ___ |/ ___) _ \
Rishin 13:66d854ad31d8 5 _____) ) ____| | | || |_| ____( (___| | | |
Rishin 13:66d854ad31d8 6 (______/|_____)_|_|_| \__)_____)\____)_| |_|
Rishin 13:66d854ad31d8 7 (C)2013 Semtech
Rishin 13:66d854ad31d8 8
Rishin 13:66d854ad31d8 9 Description: Helper functions implementation
Rishin 13:66d854ad31d8 10
Rishin 13:66d854ad31d8 11 License: Revised BSD License, see LICENSE.TXT file include in the project
Rishin 13:66d854ad31d8 12
Rishin 13:66d854ad31d8 13 Maintainer: Miguel Luis and Gregory Cristian
Rishin 13:66d854ad31d8 14 */
Rishin 13:66d854ad31d8 15 #ifndef __UTILITIES_H__
Rishin 13:66d854ad31d8 16 #define __UTILITIES_H__
Rishin 13:66d854ad31d8 17
Rishin 13:66d854ad31d8 18 /*!
Rishin 13:66d854ad31d8 19 * \brief Returns the minimum value betwen a and b
Rishin 13:66d854ad31d8 20 *
Rishin 13:66d854ad31d8 21 * \param [IN] a 1st value
Rishin 13:66d854ad31d8 22 * \param [IN] b 2nd value
Rishin 13:66d854ad31d8 23 * \retval minValue Minimum value
Rishin 13:66d854ad31d8 24 */
Rishin 13:66d854ad31d8 25 #define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
Rishin 13:66d854ad31d8 26
Rishin 13:66d854ad31d8 27 /*!
Rishin 13:66d854ad31d8 28 * \brief Returns the maximum value betwen a and b
Rishin 13:66d854ad31d8 29 *
Rishin 13:66d854ad31d8 30 * \param [IN] a 1st value
Rishin 13:66d854ad31d8 31 * \param [IN] b 2nd value
Rishin 13:66d854ad31d8 32 * \retval maxValue Maximum value
Rishin 13:66d854ad31d8 33 */
Rishin 13:66d854ad31d8 34 #define MAX( a, b ) ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
Rishin 13:66d854ad31d8 35
Rishin 13:66d854ad31d8 36 /*!
Rishin 13:66d854ad31d8 37 * \brief Returns 2 raised to the power of n
Rishin 13:66d854ad31d8 38 *
Rishin 13:66d854ad31d8 39 * \param [IN] n power value
Rishin 13:66d854ad31d8 40 * \retval result of raising 2 to the power n
Rishin 13:66d854ad31d8 41 */
Rishin 13:66d854ad31d8 42 #define POW2( n ) ( 1 << n )
Rishin 13:66d854ad31d8 43
Rishin 13:66d854ad31d8 44 /*!
Rishin 13:66d854ad31d8 45 * \brief Initializes the pseudo ramdom generator initial value
Rishin 13:66d854ad31d8 46 *
Rishin 13:66d854ad31d8 47 * \param [IN] seed Pseudo ramdom generator initial value
Rishin 13:66d854ad31d8 48 */
Rishin 13:66d854ad31d8 49 void srand1( uint32_t seed );
Rishin 13:66d854ad31d8 50
Rishin 13:66d854ad31d8 51 /*!
Rishin 13:66d854ad31d8 52 * \brief Computes a random number between min and max
Rishin 13:66d854ad31d8 53 *
Rishin 13:66d854ad31d8 54 * \param [IN] min range minimum value
Rishin 13:66d854ad31d8 55 * \param [IN] max range maximum value
Rishin 13:66d854ad31d8 56 * \retval random random value in range min..max
Rishin 13:66d854ad31d8 57 */
Rishin 13:66d854ad31d8 58 int32_t randr( int32_t min, int32_t max );
Rishin 13:66d854ad31d8 59
Rishin 13:66d854ad31d8 60 /*!
Rishin 13:66d854ad31d8 61 * \brief Copies size elements of src array to dst array
Rishin 13:66d854ad31d8 62 *
Rishin 13:66d854ad31d8 63 * \remark STM32 Standard memcpy function only works on pointers that are aligned
Rishin 13:66d854ad31d8 64 *
Rishin 13:66d854ad31d8 65 * \param [OUT] dst Destination array
Rishin 13:66d854ad31d8 66 * \param [IN] src Source array
Rishin 13:66d854ad31d8 67 * \param [IN] size Number of bytes to be copied
Rishin 13:66d854ad31d8 68 */
Rishin 13:66d854ad31d8 69 void memcpy1( uint8_t *dst, const uint8_t *src, uint16_t size );
Rishin 13:66d854ad31d8 70
Rishin 13:66d854ad31d8 71 /*!
Rishin 13:66d854ad31d8 72 * \brief Copies size elements of src array to dst array reversing the byte order
Rishin 13:66d854ad31d8 73 *
Rishin 13:66d854ad31d8 74 * \param [OUT] dst Destination array
Rishin 13:66d854ad31d8 75 * \param [IN] src Source array
Rishin 13:66d854ad31d8 76 * \param [IN] size Number of bytes to be copied
Rishin 13:66d854ad31d8 77 */
Rishin 13:66d854ad31d8 78 void memcpyr( uint8_t *dst, const uint8_t *src, uint16_t size );
Rishin 13:66d854ad31d8 79
Rishin 13:66d854ad31d8 80 /*!
Rishin 13:66d854ad31d8 81 * \brief Set size elements of dst array with value
Rishin 13:66d854ad31d8 82 *
Rishin 13:66d854ad31d8 83 * \remark STM32 Standard memset function only works on pointers that are aligned
Rishin 13:66d854ad31d8 84 *
Rishin 13:66d854ad31d8 85 * \param [OUT] dst Destination array
Rishin 13:66d854ad31d8 86 * \param [IN] value Default value
Rishin 13:66d854ad31d8 87 * \param [IN] size Number of bytes to be copied
Rishin 13:66d854ad31d8 88 */
Rishin 13:66d854ad31d8 89 void memset1( uint8_t *dst, uint8_t value, uint16_t size );
Rishin 13:66d854ad31d8 90
Rishin 13:66d854ad31d8 91 /*!
Rishin 13:66d854ad31d8 92 * \brief Converts a nibble to an hexadecimal character
Rishin 13:66d854ad31d8 93 *
Rishin 13:66d854ad31d8 94 * \param [IN] a Nibble to be converted
Rishin 13:66d854ad31d8 95 * \retval hexChar Converted hexadecimal character
Rishin 13:66d854ad31d8 96 */
Rishin 13:66d854ad31d8 97 int8_t Nibble2HexChar( uint8_t a );
Rishin 13:66d854ad31d8 98
Rishin 13:66d854ad31d8 99 #endif // __UTILITIES_H__