mirror of https://github.com/ARMmbed/mbed-os.git
commit
db49c1edeb
|
@ -16,7 +16,7 @@
|
|||
#ifndef MBED_H
|
||||
#define MBED_H
|
||||
|
||||
#define MBED_LIBRARY_VERSION 120
|
||||
#define MBED_LIBRARY_VERSION 121
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
|
||||
*
|
||||
* The information contained herein is property of Nordic Semiconductor ASA.
|
||||
* Terms and conditions of usage are described in detail in NORDIC
|
||||
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
|
||||
*
|
||||
* Licensees are granted free, non-transferable use of the information. NO
|
||||
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
|
||||
* the file.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file
|
||||
*
|
||||
* @defgroup crc_compute CRC compute
|
||||
* @{
|
||||
* @ingroup hci_transport
|
||||
*
|
||||
* @brief This module implements the CRC-16 calculation in the blocks.
|
||||
*/
|
||||
|
||||
#ifndef CRC16_H__
|
||||
#define CRC16_H__
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**@brief Function for calculating CRC-16 in blocks.
|
||||
*
|
||||
* Feed each consecutive data block into this function, along with the current value of p_crc as
|
||||
* returned by the previous call of this function. The first call of this function should pass NULL
|
||||
* as the initial value of the crc in p_crc.
|
||||
*
|
||||
* @param[in] p_data The input data block for computation.
|
||||
* @param[in] size The size of the input data block in bytes.
|
||||
* @param[in] p_crc The previous calculated CRC-16 value or NULL if first call.
|
||||
*
|
||||
* @return The updated CRC-16 value, based on the input supplied.
|
||||
*/
|
||||
uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // CRC16_H__
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,152 @@
|
|||
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
|
||||
*
|
||||
* The information contained herein is property of Nordic Semiconductor ASA.
|
||||
* Terms and conditions of usage are described in detail in NORDIC
|
||||
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
|
||||
*
|
||||
* Licensees are granted free, non-transferable use of the information. NO
|
||||
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
|
||||
* the file.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file
|
||||
*
|
||||
* @defgroup app_scheduler Scheduler
|
||||
* @{
|
||||
* @ingroup app_common
|
||||
*
|
||||
* @brief The scheduler is used for transferring execution from the interrupt context to the main
|
||||
* context.
|
||||
*
|
||||
* @details See @ref seq_diagrams_sched for sequence diagrams illustrating the flow of events
|
||||
* when using the Scheduler.
|
||||
*
|
||||
* @section app_scheduler_req Requirements:
|
||||
*
|
||||
* @subsection main_context_logic Logic in main context:
|
||||
*
|
||||
* - Define an event handler for each type of event expected.
|
||||
* - Initialize the scheduler by calling the APP_SCHED_INIT() macro before entering the
|
||||
* application main loop.
|
||||
* - Call app_sched_execute() from the main loop each time the application wakes up because of an
|
||||
* event (typically when sd_app_evt_wait() returns).
|
||||
*
|
||||
* @subsection int_context_logic Logic in interrupt context:
|
||||
*
|
||||
* - In the interrupt handler, call app_sched_event_put()
|
||||
* with the appropriate data and event handler. This will insert an event into the
|
||||
* scheduler's queue. The app_sched_execute() function will pull this event and call its
|
||||
* handler in the main context.
|
||||
*
|
||||
* @if (SD_S110 && !SD_S310)
|
||||
* For an example usage of the scheduler, see the implementations of
|
||||
* @ref ble_sdk_app_hids_mouse and @ref ble_sdk_app_hids_keyboard.
|
||||
* @endif
|
||||
*
|
||||
* @image html scheduler_working.jpg The high level design of the scheduler
|
||||
*/
|
||||
|
||||
#ifndef APP_SCHEDULER_H__
|
||||
#define APP_SCHEDULER_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include "app_error.h"
|
||||
|
||||
#define APP_SCHED_EVENT_HEADER_SIZE 8 /**< Size of app_scheduler.event_header_t (only for use inside APP_SCHED_BUF_SIZE()). */
|
||||
|
||||
/**@brief Compute number of bytes required to hold the scheduler buffer.
|
||||
*
|
||||
* @param[in] EVENT_SIZE Maximum size of events to be passed through the scheduler.
|
||||
* @param[in] QUEUE_SIZE Number of entries in scheduler queue (i.e. the maximum number of events
|
||||
* that can be scheduled for execution).
|
||||
*
|
||||
* @return Required scheduler buffer size (in bytes).
|
||||
*/
|
||||
#define APP_SCHED_BUF_SIZE(EVENT_SIZE, QUEUE_SIZE) \
|
||||
(((EVENT_SIZE) + APP_SCHED_EVENT_HEADER_SIZE) * ((QUEUE_SIZE) + 1))
|
||||
|
||||
/**@brief Scheduler event handler type. */
|
||||
typedef void (*app_sched_event_handler_t)(void * p_event_data, uint16_t event_size);
|
||||
|
||||
/**@brief Macro for initializing the event scheduler.
|
||||
*
|
||||
* @details It will also handle dimensioning and allocation of the memory buffer required by the
|
||||
* scheduler, making sure the buffer is correctly aligned.
|
||||
*
|
||||
* @param[in] EVENT_SIZE Maximum size of events to be passed through the scheduler.
|
||||
* @param[in] QUEUE_SIZE Number of entries in scheduler queue (i.e. the maximum number of events
|
||||
* that can be scheduled for execution).
|
||||
*
|
||||
* @note Since this macro allocates a buffer, it must only be called once (it is OK to call it
|
||||
* several times as long as it is from the same location, e.g. to do a reinitialization).
|
||||
*/
|
||||
#define APP_SCHED_INIT(EVENT_SIZE, QUEUE_SIZE) \
|
||||
do \
|
||||
{ \
|
||||
static uint32_t APP_SCHED_BUF[CEIL_DIV(APP_SCHED_BUF_SIZE((EVENT_SIZE), (QUEUE_SIZE)), \
|
||||
sizeof(uint32_t))]; \
|
||||
uint32_t ERR_CODE = app_sched_init((EVENT_SIZE), (QUEUE_SIZE), APP_SCHED_BUF); \
|
||||
APP_ERROR_CHECK(ERR_CODE); \
|
||||
} while (0)
|
||||
|
||||
/**@brief Function for initializing the Scheduler.
|
||||
*
|
||||
* @details It must be called before entering the main loop.
|
||||
*
|
||||
* @param[in] max_event_size Maximum size of events to be passed through the scheduler.
|
||||
* @param[in] queue_size Number of entries in scheduler queue (i.e. the maximum number of
|
||||
* events that can be scheduled for execution).
|
||||
* @param[in] p_evt_buffer Pointer to memory buffer for holding the scheduler queue. It must
|
||||
* be dimensioned using the APP_SCHED_BUFFER_SIZE() macro. The buffer
|
||||
* must be aligned to a 4 byte boundary.
|
||||
*
|
||||
* @note Normally initialization should be done using the APP_SCHED_INIT() macro, as that will both
|
||||
* allocate the scheduler buffer, and also align the buffer correctly.
|
||||
*
|
||||
* @retval NRF_SUCCESS Successful initialization.
|
||||
* @retval NRF_ERROR_INVALID_PARAM Invalid parameter (buffer not aligned to a 4 byte
|
||||
* boundary).
|
||||
*/
|
||||
uint32_t app_sched_init(uint16_t max_event_size, uint16_t queue_size, void * p_evt_buffer);
|
||||
|
||||
/**@brief Function for executing all scheduled events.
|
||||
*
|
||||
* @details This function must be called from within the main loop. It will execute all events
|
||||
* scheduled since the last time it was called.
|
||||
*/
|
||||
void app_sched_execute(void);
|
||||
|
||||
/**@brief Function for scheduling an event.
|
||||
*
|
||||
* @details Puts an event into the event queue.
|
||||
*
|
||||
* @param[in] p_event_data Pointer to event data to be scheduled.
|
||||
* @param[in] event_size Size of event data to be scheduled.
|
||||
* @param[in] handler Event handler to receive the event.
|
||||
*
|
||||
* @return NRF_SUCCESS on success, otherwise an error code.
|
||||
*/
|
||||
uint32_t app_sched_event_put(void * p_event_data,
|
||||
uint16_t event_size,
|
||||
app_sched_event_handler_t handler);
|
||||
|
||||
#ifdef APP_SCHEDULER_WITH_PAUSE
|
||||
/**@brief A function to pause the scheduler.
|
||||
*
|
||||
* @details When the scheduler is paused events are not pulled from the scheduler queue for
|
||||
* processing. The function can be called multiple times. To unblock the scheduler the
|
||||
* function @ref app_sched_resume has to be called the same number of times.
|
||||
*/
|
||||
void app_sched_pause(void);
|
||||
|
||||
/**@brief A function to resume a scheduler.
|
||||
*
|
||||
* @details To unblock the scheduler this function has to be called the same number of times as
|
||||
* @ref app_sched_pause function.
|
||||
*/
|
||||
void app_sched_resume(void);
|
||||
#endif
|
||||
#endif // APP_SCHEDULER_H__
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,92 @@
|
|||
/* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved.
|
||||
*
|
||||
* The information contained herein is property of Nordic Semiconductor ASA.
|
||||
* Terms and conditions of usage are described in detail in NORDIC
|
||||
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
|
||||
*
|
||||
* Licensees are granted free, non-transferable use of the information. NO
|
||||
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
|
||||
* the file.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file
|
||||
*
|
||||
* @defgroup app_error Common application error handler
|
||||
* @{
|
||||
* @ingroup app_common
|
||||
*
|
||||
* @brief Common application error handler and macros for utilizing a common error handler.
|
||||
*/
|
||||
|
||||
#ifndef APP_ERROR_H__
|
||||
#define APP_ERROR_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "nrf_error.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**@brief Function for error handling, which is called when an error has occurred.
|
||||
*
|
||||
* @param[in] error_code Error code supplied to the handler.
|
||||
* @param[in] line_num Line number where the handler is called.
|
||||
* @param[in] p_file_name Pointer to the file name.
|
||||
*/
|
||||
void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t * p_file_name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/**@brief Macro for calling error handler function.
|
||||
*
|
||||
* @param[in] ERR_CODE Error code supplied to the error handler.
|
||||
*/
|
||||
#ifdef DEBUG
|
||||
#define APP_ERROR_HANDLER(ERR_CODE) \
|
||||
do \
|
||||
{ \
|
||||
app_error_handler((ERR_CODE), __LINE__, (uint8_t*) __FILE__); \
|
||||
} while (0)
|
||||
#else
|
||||
#define APP_ERROR_HANDLER(ERR_CODE) \
|
||||
do \
|
||||
{ \
|
||||
app_error_handler((ERR_CODE), 0, 0); \
|
||||
} while (0)
|
||||
#endif
|
||||
/**@brief Macro for calling error handler function if supplied error code any other than NRF_SUCCESS.
|
||||
*
|
||||
* @param[in] ERR_CODE Error code supplied to the error handler.
|
||||
*/
|
||||
#define APP_ERROR_CHECK(ERR_CODE) \
|
||||
do \
|
||||
{ \
|
||||
const uint32_t LOCAL_ERR_CODE = (ERR_CODE); \
|
||||
if (LOCAL_ERR_CODE != NRF_SUCCESS) \
|
||||
{ \
|
||||
APP_ERROR_HANDLER(LOCAL_ERR_CODE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/**@brief Macro for calling error handler function if supplied boolean value is false.
|
||||
*
|
||||
* @param[in] BOOLEAN_VALUE Boolean value to be evaluated.
|
||||
*/
|
||||
#define APP_ERROR_CHECK_BOOL(BOOLEAN_VALUE) \
|
||||
do \
|
||||
{ \
|
||||
const uint32_t LOCAL_BOOLEAN_VALUE = (BOOLEAN_VALUE); \
|
||||
if (!LOCAL_BOOLEAN_VALUE) \
|
||||
{ \
|
||||
APP_ERROR_HANDLER(0); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#endif // APP_ERROR_H__
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,234 @@
|
|||
/* Copyright (c) 2012 Nordic Semiconductor. All Rights Reserved.
|
||||
*
|
||||
* The information contained herein is property of Nordic Semiconductor ASA.
|
||||
* Terms and conditions of usage are described in detail in NORDIC
|
||||
* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
|
||||
*
|
||||
* Licensees are granted free, non-transferable use of the information. NO
|
||||
* WARRANTY of ANY KIND is provided. This heading must NOT be removed from
|
||||
* the file.
|
||||
*
|
||||
*/
|
||||
|
||||
/** @file
|
||||
*
|
||||
* @defgroup app_util Utility Functions and Definitions
|
||||
* @{
|
||||
* @ingroup app_common
|
||||
*
|
||||
* @brief Various types and definitions available to all applications.
|
||||
*/
|
||||
|
||||
#ifndef APP_UTIL_H__
|
||||
#define APP_UTIL_H__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "compiler_abstraction.h"
|
||||
|
||||
enum
|
||||
{
|
||||
UNIT_0_625_MS = 625, /**< Number of microseconds in 0.625 milliseconds. */
|
||||
UNIT_1_25_MS = 1250, /**< Number of microseconds in 1.25 milliseconds. */
|
||||
UNIT_10_MS = 10000 /**< Number of microseconds in 10 milliseconds. */
|
||||
};
|
||||
|
||||
/**@brief Macro for doing static (i.e. compile time) assertion.
|
||||
*
|
||||
* @note If the assertion fails when compiling using Keil, the compiler will report error message
|
||||
* "error: #94: the size of an array must be greater than zero" (while gcc will list the
|
||||
* symbol static_assert_failed, making the error message more readable).
|
||||
* If the supplied expression can not be evaluated at compile time, Keil will report
|
||||
* "error: #28: expression must have a constant value".
|
||||
*
|
||||
* @note The macro is intentionally implemented not using do while(0), allowing it to be used
|
||||
* outside function blocks (e.g. close to global type- and variable declarations).
|
||||
* If used in a code block, it must be used before any executable code in this block.
|
||||
*
|
||||
* @param[in] EXPR Constant expression to be verified.
|
||||
*/
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define STATIC_ASSERT(EXPR) typedef char __attribute__((unused)) static_assert_failed[(EXPR) ? 1 : -1]
|
||||
#elif defined(__ICCARM__)
|
||||
#define STATIC_ASSERT(EXPR) extern char static_assert_failed[(EXPR) ? 1 : -1]
|
||||
#else
|
||||
#define STATIC_ASSERT(EXPR) typedef char static_assert_failed[(EXPR) ? 1 : -1]
|
||||
#endif
|
||||
|
||||
|
||||
/**@brief type for holding an encoded (i.e. little endian) 16 bit unsigned integer. */
|
||||
typedef uint8_t uint16_le_t[2];
|
||||
|
||||
/**@brief type for holding an encoded (i.e. little endian) 32 bit unsigned integer. */
|
||||
typedef uint8_t uint32_le_t[4];
|
||||
|
||||
/**@brief Byte array type. */
|
||||
typedef struct
|
||||
{
|
||||
uint16_t size; /**< Number of array entries. */
|
||||
uint8_t * p_data; /**< Pointer to array entries. */
|
||||
} uint8_array_t;
|
||||
|
||||
/**@brief Perform rounded integer division (as opposed to truncating the result).
|
||||
*
|
||||
* @param[in] A Numerator.
|
||||
* @param[in] B Denominator.
|
||||
*
|
||||
* @return Rounded (integer) result of dividing A by B.
|
||||
*/
|
||||
#define ROUNDED_DIV(A, B) (((A) + ((B) / 2)) / (B))
|
||||
|
||||
/**@brief Check if the integer provided is a power of two.
|
||||
*
|
||||
* @param[in] A Number to be tested.
|
||||
*
|
||||
* @return true if value is power of two.
|
||||
* @return false if value not power of two.
|
||||
*/
|
||||
#define IS_POWER_OF_TWO(A) ( ((A) != 0) && ((((A) - 1) & (A)) == 0) )
|
||||
|
||||
/**@brief To convert milliseconds to ticks.
|
||||
* @param[in] TIME Number of milliseconds to convert.
|
||||
* @param[in] RESOLUTION Unit to be converted to in [us/ticks].
|
||||
*/
|
||||
#define MSEC_TO_UNITS(TIME, RESOLUTION) (((TIME) * 1000) / (RESOLUTION))
|
||||
|
||||
|
||||
/**@brief Perform integer division, making sure the result is rounded up.
|
||||
*
|
||||
* @details One typical use for this is to compute the number of objects with size B is needed to
|
||||
* hold A number of bytes.
|
||||
*
|
||||
* @param[in] A Numerator.
|
||||
* @param[in] B Denominator.
|
||||
*
|
||||
* @return Integer result of dividing A by B, rounded up.
|
||||
*/
|
||||
#define CEIL_DIV(A, B) \
|
||||
/*lint -save -e573 */ \
|
||||
((((A) - 1) / (B)) + 1) \
|
||||
/*lint -restore */
|
||||
|
||||
/**@brief Function for encoding a uint16 value.
|
||||
*
|
||||
* @param[in] value Value to be encoded.
|
||||
* @param[out] p_encoded_data Buffer where the encoded data is to be written.
|
||||
*
|
||||
* @return Number of bytes written.
|
||||
*/
|
||||
static __INLINE uint8_t uint16_encode(uint16_t value, uint8_t * p_encoded_data)
|
||||
{
|
||||
p_encoded_data[0] = (uint8_t) ((value & 0x00FF) >> 0);
|
||||
p_encoded_data[1] = (uint8_t) ((value & 0xFF00) >> 8);
|
||||
return sizeof(uint16_t);
|
||||
}
|
||||
|
||||
/**@brief Function for encoding a uint32 value.
|
||||
*
|
||||
* @param[in] value Value to be encoded.
|
||||
* @param[out] p_encoded_data Buffer where the encoded data is to be written.
|
||||
*
|
||||
* @return Number of bytes written.
|
||||
*/
|
||||
static __INLINE uint8_t uint32_encode(uint32_t value, uint8_t * p_encoded_data)
|
||||
{
|
||||
p_encoded_data[0] = (uint8_t) ((value & 0x000000FF) >> 0);
|
||||
p_encoded_data[1] = (uint8_t) ((value & 0x0000FF00) >> 8);
|
||||
p_encoded_data[2] = (uint8_t) ((value & 0x00FF0000) >> 16);
|
||||
p_encoded_data[3] = (uint8_t) ((value & 0xFF000000) >> 24);
|
||||
return sizeof(uint32_t);
|
||||
}
|
||||
|
||||
/**@brief Function for decoding a uint16 value.
|
||||
*
|
||||
* @param[in] p_encoded_data Buffer where the encoded data is stored.
|
||||
*
|
||||
* @return Decoded value.
|
||||
*/
|
||||
static __INLINE uint16_t uint16_decode(const uint8_t * p_encoded_data)
|
||||
{
|
||||
return ( (((uint16_t)((uint8_t *)p_encoded_data)[0])) |
|
||||
(((uint16_t)((uint8_t *)p_encoded_data)[1]) << 8 ));
|
||||
}
|
||||
|
||||
/**@brief Function for decoding a uint32 value.
|
||||
*
|
||||
* @param[in] p_encoded_data Buffer where the encoded data is stored.
|
||||
*
|
||||
* @return Decoded value.
|
||||
*/
|
||||
static __INLINE uint32_t uint32_decode(const uint8_t * p_encoded_data)
|
||||
{
|
||||
return ( (((uint32_t)((uint8_t *)p_encoded_data)[0]) << 0) |
|
||||
(((uint32_t)((uint8_t *)p_encoded_data)[1]) << 8) |
|
||||
(((uint32_t)((uint8_t *)p_encoded_data)[2]) << 16) |
|
||||
(((uint32_t)((uint8_t *)p_encoded_data)[3]) << 24 ));
|
||||
}
|
||||
|
||||
/** @brief Function for converting the input voltage (in milli volts) into percentage of 3.0 Volts.
|
||||
*
|
||||
* @details The calculation is based on a linearized version of the battery's discharge
|
||||
* curve. 3.0V returns 100% battery level. The limit for power failure is 2.1V and
|
||||
* is considered to be the lower boundary.
|
||||
*
|
||||
* The discharge curve for CR2032 is non-linear. In this model it is split into
|
||||
* 4 linear sections:
|
||||
* - Section 1: 3.0V - 2.9V = 100% - 42% (58% drop on 100 mV)
|
||||
* - Section 2: 2.9V - 2.74V = 42% - 18% (24% drop on 160 mV)
|
||||
* - Section 3: 2.74V - 2.44V = 18% - 6% (12% drop on 300 mV)
|
||||
* - Section 4: 2.44V - 2.1V = 6% - 0% (6% drop on 340 mV)
|
||||
*
|
||||
* These numbers are by no means accurate. Temperature and
|
||||
* load in the actual application is not accounted for!
|
||||
*
|
||||
* @param[in] mvolts The voltage in mV
|
||||
*
|
||||
* @return Battery level in percent.
|
||||
*/
|
||||
static __INLINE uint8_t battery_level_in_percent(const uint16_t mvolts)
|
||||
{
|
||||
uint8_t battery_level;
|
||||
|
||||
if (mvolts >= 3000)
|
||||
{
|
||||
battery_level = 100;
|
||||
}
|
||||
else if (mvolts > 2900)
|
||||
{
|
||||
battery_level = 100 - ((3000 - mvolts) * 58) / 100;
|
||||
}
|
||||
else if (mvolts > 2740)
|
||||
{
|
||||
battery_level = 42 - ((2900 - mvolts) * 24) / 160;
|
||||
}
|
||||
else if (mvolts > 2440)
|
||||
{
|
||||
battery_level = 18 - ((2740 - mvolts) * 12) / 300;
|
||||
}
|
||||
else if (mvolts > 2100)
|
||||
{
|
||||
battery_level = 6 - ((2440 - mvolts) * 6) / 340;
|
||||
}
|
||||
else
|
||||
{
|
||||
battery_level = 0;
|
||||
}
|
||||
|
||||
return battery_level;
|
||||
}
|
||||
|
||||
/**@brief Function for checking if a pointer value is aligned to a 4 byte boundary.
|
||||
*
|
||||
* @param[in] p Pointer value to be checked.
|
||||
*
|
||||
* @return TRUE if pointer is aligned to a 4 byte boundary, FALSE otherwise.
|
||||
*/
|
||||
static __INLINE bool is_word_aligned(void * p)
|
||||
{
|
||||
return (((uintptr_t)p & 0x03) == 0);
|
||||
}
|
||||
|
||||
#endif // APP_UTIL_H__
|
||||
|
||||
/** @} */
|
|
@ -0,0 +1,90 @@
|
|||
S110/S120/S130 license agreement
|
||||
|
||||
NORDIC SEMICONDUCTOR ASA SOFTDEVICE LICENSE AGREEMENT
|
||||
|
||||
License Agreement for the Nordic Semiconductor ASA ("Nordic") S110, S120 and S130 Bluetooth SoftDevice software packages ("SoftDevice").
|
||||
You ("You" "Licensee") must carefully and thoroughly read this License Agreement ("Agreement"), and accept to adhere to this Agreement before
|
||||
downloading, installing and/or using any software or content in the SoftDevice provided herewith.
|
||||
|
||||
YOU ACCEPT THIS LICENSE AGREEMENT BY (A) CLICKING ACCEPT OR AGREE TO THIS LICENSE AGREEMENT, WHERE THIS
|
||||
OPTION IS MADE AVAILABLE TO YOU; OR (B) BY ACTUALLY USING THE SOFTDEVICE, IN THIS CASE YOU AGREE THAT THE USE OF
|
||||
THE SOFTDEVICE CONSTITUTES ACCEPTANCE OF THE LICENSING AGREEMENT FROM THAT POINT ONWARDS.
|
||||
|
||||
IF YOU DO NOT AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL/COMPLETE
|
||||
INSTALLATION OF, OR IN ANY OTHER WAY MAKE USE OF THE SOFTDEVICE.
|
||||
|
||||
1. Grant of License
|
||||
Subject to the terms in this Agreement Nordic grants Licensee a limited, non-exclusive, non-transferable, non-sub licensable, revocable license
|
||||
("License"): (a) to use the SoftDevice solely in connection with a Nordic integrated circuit, and (b) to distribute the SoftDevice solely as integrated
|
||||
in Licensee Product. Licensee shall not use the SoftDevice for any purpose other than specifically authorized herein. It is a material breach of this
|
||||
agreement to use or modify the SoftDevice for use on any wireless connectivity integrated circuit other than a Nordic integrated circuit.
|
||||
|
||||
2. Title
|
||||
Nordic retains full rights, title, and ownership to the SoftDevice and any and all patents, copyrights, trade secrets, trade names, trademarks, and
|
||||
other intellectual property rights in and to the SoftDevice.
|
||||
|
||||
3. No Modifications or Reverse Engineering
|
||||
Licensee shall not, modify, reverse engineer, disassemble, decompile or otherwise attempt to discover the source code of any non-source code
|
||||
parts of the SoftDevice including, but not limited to pre-compiled hex files, binaries and object code.
|
||||
|
||||
4. Distribution Restrictions
|
||||
Except as set forward in Section 1 above, the Licensee may not disclose or distribute any or all parts of the SoftDevice to any third party.
|
||||
Licensee agrees to provide reasonable security precautions to prevent unauthorized access to or use of the SoftDevice as proscribed herein.
|
||||
Licensee also agrees that use of and access to the SoftDevice will be strictly limited to the employees and subcontractors of the Licensee
|
||||
necessary for the performance of development, verification and production tasks under this Agreement. The Licensee is responsible for making
|
||||
such employees and subcontractors comply with the obligations concerning use and non-disclosure of the SoftDevice.
|
||||
|
||||
5. No Other Rights
|
||||
Licensee shall use the SoftDevice only in compliance with this Agreement and shall refrain from using the SoftDevice in any way that may be
|
||||
contrary to this Agreement.
|
||||
|
||||
6. Fees
|
||||
Nordic grants the License to the Licensee free of charge provided that the Licensee undertakes the obligations in the Agreement and warrants to
|
||||
comply with the Agreement.
|
||||
|
||||
7. DISCLAIMER OF WARRANTY
|
||||
THE SOFTDEVICE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED AND NEITHER NORDIC, ITS
|
||||
LICENSORS OR AFFILIATES NOR THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR
|
||||
THAT THE SOFTDEVICE WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. THERE
|
||||
IS NO WARRANTY BY NORDIC OR BY ANY OTHER PARTY THAT THE FUNCTIONS CONTAINED IN THE SOFTDEVICE WILL MEET THE
|
||||
REQUIREMENTS OF LICENSEE OR THAT THE OPERATION OF THE SOFTDEVICE WILL BE UNINTERRUPTED OR ERROR-FREE.
|
||||
LICENSEE ASSUMES ALL RESPONSIBILITY AND RISK FOR THE SELECTION OF THE SOFTDEVICE TO ACHIEVE LICENSEE’S
|
||||
INTENDED RESULTS AND FOR THE INSTALLATION, USE AND RESULTS OBTAINED FROM IT.
|
||||
|
||||
8. No Support
|
||||
Nordic is not obligated to furnish or make available to Licensee any further information, software, technical information, know-how, show-how,
|
||||
bug-fixes or support. Nordic reserves the right to make changes to the SoftDevice without further notice.
|
||||
|
||||
9. Limitation of Liability
|
||||
In no event shall Nordic, its employees or suppliers, licensors or affiliates be liable for any lost profits, revenue, sales, data or costs of
|
||||
procurement of substitute goods or services, property damage, personal injury, interruption of business, loss of business information or for any
|
||||
special, direct, indirect, incidental, economic, punitive, special or consequential damages, however caused and whether arising under contract,
|
||||
tort, negligence, or other theory of liability arising out of the use of or inability to use the SoftDevice, even if Nordic or its employees or suppliers,
|
||||
licensors or affiliates are advised of the possibility of such damages. Because some countries/states/jurisdictions do not allow the exclusion or
|
||||
limitation of liability, but may allow liability to be limited, in such cases, Nordic, its employees or licensors or affiliates’ liability shall be limited to
|
||||
USD 50.
|
||||
|
||||
10. Breach of Contract
|
||||
Upon a breach of contract by the Licensee, Nordic and its licensor are entitled to damages in respect of any direct loss which can be reasonably
|
||||
attributed to the breach by the Licensee. If the Licensee has acted with gross negligence or willful misconduct, the Licensee shall cover both
|
||||
direct and indirect costs for Nordic and its licensors.
|
||||
|
||||
11. Indemnity
|
||||
Licensee undertakes to indemnify, hold harmless and defend Nordic and its directors, officers, affiliates, shareholders, licensors, employees and
|
||||
agents from and against any claims or lawsuits, including attorney's fees, that arise or result of the Licensee’s execution of the License and which
|
||||
is not due to causes for which Nordic is responsible.
|
||||
|
||||
12. Governing Law
|
||||
This Agreement shall be construed according to the laws of Norway, and hereby submits to the exclusive jurisdiction of the Oslo tingrett.
|
||||
|
||||
13. Assignment
|
||||
Licensee shall not assign this Agreement or any rights or obligations hereunder without the prior written consent of Nordic.
|
||||
|
||||
14. Termination
|
||||
Without prejudice to any other rights, Nordic may cancel this Agreement if Licensee does not abide by the terms and conditions of this
|
||||
Agreement. Upon termination Licensee must promptly cease the use of the License and destroy all copies of the Licensed Technology and any
|
||||
other material provided by Nordic or its affiliate, or produced by the Licensee in connection with the Agreement or the Licensed Technology.
|
||||
|
||||
15. Third party beneficiaries
|
||||
Nordic’s licensors are intended third party beneficiaries under this Agreement.
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,90 @@
|
|||
S110/S120/S130 license agreement
|
||||
|
||||
NORDIC SEMICONDUCTOR ASA SOFTDEVICE LICENSE AGREEMENT
|
||||
|
||||
License Agreement for the Nordic Semiconductor ASA ("Nordic") S110, S120 and S130 Bluetooth SoftDevice software packages ("SoftDevice").
|
||||
You ("You" "Licensee") must carefully and thoroughly read this License Agreement ("Agreement"), and accept to adhere to this Agreement before
|
||||
downloading, installing and/or using any software or content in the SoftDevice provided herewith.
|
||||
|
||||
YOU ACCEPT THIS LICENSE AGREEMENT BY (A) CLICKING ACCEPT OR AGREE TO THIS LICENSE AGREEMENT, WHERE THIS
|
||||
OPTION IS MADE AVAILABLE TO YOU; OR (B) BY ACTUALLY USING THE SOFTDEVICE, IN THIS CASE YOU AGREE THAT THE USE OF
|
||||
THE SOFTDEVICE CONSTITUTES ACCEPTANCE OF THE LICENSING AGREEMENT FROM THAT POINT ONWARDS.
|
||||
|
||||
IF YOU DO NOT AGREE TO BE BOUND BY THE TERMS OF THIS AGREEMENT, THEN DO NOT DOWNLOAD, INSTALL/COMPLETE
|
||||
INSTALLATION OF, OR IN ANY OTHER WAY MAKE USE OF THE SOFTDEVICE.
|
||||
|
||||
1. Grant of License
|
||||
Subject to the terms in this Agreement Nordic grants Licensee a limited, non-exclusive, non-transferable, non-sub licensable, revocable license
|
||||
("License"): (a) to use the SoftDevice solely in connection with a Nordic integrated circuit, and (b) to distribute the SoftDevice solely as integrated
|
||||
in Licensee Product. Licensee shall not use the SoftDevice for any purpose other than specifically authorized herein. It is a material breach of this
|
||||
agreement to use or modify the SoftDevice for use on any wireless connectivity integrated circuit other than a Nordic integrated circuit.
|
||||
|
||||
2. Title
|
||||
Nordic retains full rights, title, and ownership to the SoftDevice and any and all patents, copyrights, trade secrets, trade names, trademarks, and
|
||||
other intellectual property rights in and to the SoftDevice.
|
||||
|
||||
3. No Modifications or Reverse Engineering
|
||||
Licensee shall not, modify, reverse engineer, disassemble, decompile or otherwise attempt to discover the source code of any non-source code
|
||||
parts of the SoftDevice including, but not limited to pre-compiled hex files, binaries and object code.
|
||||
|
||||
4. Distribution Restrictions
|
||||
Except as set forward in Section 1 above, the Licensee may not disclose or distribute any or all parts of the SoftDevice to any third party.
|
||||
Licensee agrees to provide reasonable security precautions to prevent unauthorized access to or use of the SoftDevice as proscribed herein.
|
||||
Licensee also agrees that use of and access to the SoftDevice will be strictly limited to the employees and subcontractors of the Licensee
|
||||
necessary for the performance of development, verification and production tasks under this Agreement. The Licensee is responsible for making
|
||||
such employees and subcontractors comply with the obligations concerning use and non-disclosure of the SoftDevice.
|
||||
|
||||
5. No Other Rights
|
||||
Licensee shall use the SoftDevice only in compliance with this Agreement and shall refrain from using the SoftDevice in any way that may be
|
||||
contrary to this Agreement.
|
||||
|
||||
6. Fees
|
||||
Nordic grants the License to the Licensee free of charge provided that the Licensee undertakes the obligations in the Agreement and warrants to
|
||||
comply with the Agreement.
|
||||
|
||||
7. DISCLAIMER OF WARRANTY
|
||||
THE SOFTDEVICE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EXPRESS OR IMPLIED AND NEITHER NORDIC, ITS
|
||||
LICENSORS OR AFFILIATES NOR THE COPYRIGHT HOLDERS MAKE ANY REPRESENTATIONS OR WARRANTIES, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE OR
|
||||
THAT THE SOFTDEVICE WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. THERE
|
||||
IS NO WARRANTY BY NORDIC OR BY ANY OTHER PARTY THAT THE FUNCTIONS CONTAINED IN THE SOFTDEVICE WILL MEET THE
|
||||
REQUIREMENTS OF LICENSEE OR THAT THE OPERATION OF THE SOFTDEVICE WILL BE UNINTERRUPTED OR ERROR-FREE.
|
||||
LICENSEE ASSUMES ALL RESPONSIBILITY AND RISK FOR THE SELECTION OF THE SOFTDEVICE TO ACHIEVE LICENSEE’S
|
||||
INTENDED RESULTS AND FOR THE INSTALLATION, USE AND RESULTS OBTAINED FROM IT.
|
||||
|
||||
8. No Support
|
||||
Nordic is not obligated to furnish or make available to Licensee any further information, software, technical information, know-how, show-how,
|
||||
bug-fixes or support. Nordic reserves the right to make changes to the SoftDevice without further notice.
|
||||
|
||||
9. Limitation of Liability
|
||||
In no event shall Nordic, its employees or suppliers, licensors or affiliates be liable for any lost profits, revenue, sales, data or costs of
|
||||
procurement of substitute goods or services, property damage, personal injury, interruption of business, loss of business information or for any
|
||||
special, direct, indirect, incidental, economic, punitive, special or consequential damages, however caused and whether arising under contract,
|
||||
tort, negligence, or other theory of liability arising out of the use of or inability to use the SoftDevice, even if Nordic or its employees or suppliers,
|
||||
licensors or affiliates are advised of the possibility of such damages. Because some countries/states/jurisdictions do not allow the exclusion or
|
||||
limitation of liability, but may allow liability to be limited, in such cases, Nordic, its employees or licensors or affiliates’ liability shall be limited to
|
||||
USD 50.
|
||||
|
||||
10. Breach of Contract
|
||||
Upon a breach of contract by the Licensee, Nordic and its licensor are entitled to damages in respect of any direct loss which can be reasonably
|
||||
attributed to the breach by the Licensee. If the Licensee has acted with gross negligence or willful misconduct, the Licensee shall cover both
|
||||
direct and indirect costs for Nordic and its licensors.
|
||||
|
||||
11. Indemnity
|
||||
Licensee undertakes to indemnify, hold harmless and defend Nordic and its directors, officers, affiliates, shareholders, licensors, employees and
|
||||
agents from and against any claims or lawsuits, including attorney's fees, that arise or result of the Licensee’s execution of the License and which
|
||||
is not due to causes for which Nordic is responsible.
|
||||
|
||||
12. Governing Law
|
||||
This Agreement shall be construed according to the laws of Norway, and hereby submits to the exclusive jurisdiction of the Oslo tingrett.
|
||||
|
||||
13. Assignment
|
||||
Licensee shall not assign this Agreement or any rights or obligations hereunder without the prior written consent of Nordic.
|
||||
|
||||
14. Termination
|
||||
Without prejudice to any other rights, Nordic may cancel this Agreement if Licensee does not abide by the terms and conditions of this
|
||||
Agreement. Upon termination Licensee must promptly cease the use of the License and destroy all copies of the Licensed Technology and any
|
||||
other material provided by Nordic or its affiliate, or produced by the Licensee in connection with the Agreement or the Licensed Technology.
|
||||
|
||||
15. Third party beneficiaries
|
||||
Nordic’s licensors are intended third party beneficiaries under this Agreement.
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue