Skip to content

Commit 35c17c9

Browse files
committed
Initial commit nRF5_SDK version 17.1.0
1 parent fd9322c commit 35c17c9

File tree

11,141 files changed

+12658718
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,141 files changed

+12658718
-0
lines changed
+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/**
2+
* Copyright (c) 2016 - 2021 Nordic Semiconductor ASA and Luxoft Global Operations Gmbh.
3+
*
4+
* All Rights Reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without modification,
7+
* are permitted provided that the following conditions are met:
8+
*
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binary form, except as embedded into a Nordic
14+
* Semiconductor ASA integrated circuit in a product or a software update for
15+
* such product, must reproduce the above copyright notice, this list of
16+
* conditions and the following disclaimer in the documentation and/or other
17+
* materials provided with the distribution.
18+
*
19+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
20+
* contributors may be used to endorse or promote products derived from this
21+
* software without specific prior written permission.
22+
*
23+
* 4. This software, with or without modification, must only be used with a
24+
* Nordic Semiconductor ASA integrated circuit.
25+
*
26+
* 5. Any software provided in binary form under this license must not be reverse
27+
* engineered, decompiled, modified and/or disassembled.
28+
*
29+
*
30+
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
31+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32+
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
33+
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
34+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
36+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
39+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40+
*
41+
*/
42+
#ifndef HAL_ATOMIC_H_INCLUDED
43+
#define HAL_ATOMIC_H_INCLUDED
44+
45+
#include <stdint.h>
46+
47+
/** @file
48+
* This file contains declarations of the Atomic section routines and necessary types.
49+
*
50+
* @defgroup hal_atomic HAL Atomic API
51+
* @ingroup hal_15_4
52+
* @{
53+
* @brief Module to declare HAL Atomic API
54+
* @details The Atomic module implements atomic section interface. This is made by disabling the global interrupts,
55+
* which is a hardware dependent feature. The user may call hal_atomic_start() to open an atomic section
56+
* (disable interrupts) and hal_atomic_end() to exit from the section (restore interrupts). The algorithm
57+
* supports nesting sections.
58+
*/
59+
60+
typedef volatile uint32_t atomic_t;
61+
62+
63+
/**@brief Enters atomic section.
64+
*
65+
* @details Disables global interrupts.
66+
*
67+
* @param[in] p_atomic pointer to buffer to store current value of the status register.
68+
*/
69+
void hal_atomic_start(atomic_t * p_atomic);
70+
71+
/**
72+
* @brief Exits atomic section
73+
*
74+
* @details Restores status register
75+
*
76+
* @param[in] p_atomic pointer to buffer to restore current value of the status register from.
77+
*/
78+
void hal_atomic_end(atomic_t * p_atomic);
79+
80+
/** @} */
81+
82+
#endif // HAL_ATOMIC_H_INCLUDED
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
/**
2+
* Copyright (c) 2016 - 2021 Nordic Semiconductor ASA and Luxoft Global Operations Gmbh.
3+
*
4+
* All Rights Reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without modification,
7+
* are permitted provided that the following conditions are met:
8+
*
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binary form, except as embedded into a Nordic
14+
* Semiconductor ASA integrated circuit in a product or a software update for
15+
* such product, must reproduce the above copyright notice, this list of
16+
* conditions and the following disclaimer in the documentation and/or other
17+
* materials provided with the distribution.
18+
*
19+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
20+
* contributors may be used to endorse or promote products derived from this
21+
* software without specific prior written permission.
22+
*
23+
* 4. This software, with or without modification, must only be used with a
24+
* Nordic Semiconductor ASA integrated circuit.
25+
*
26+
* 5. Any software provided in binary form under this license must not be reverse
27+
* engineered, decompiled, modified and/or disassembled.
28+
*
29+
*
30+
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
31+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32+
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
33+
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
34+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
36+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
39+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40+
*
41+
*/
42+
#ifndef HAL_CLOCK_H_INCLUDED
43+
#define HAL_CLOCK_H_INCLUDED
44+
45+
/**
46+
* @defgroup hal_clock HAL Clock API
47+
* @ingroup hal_15_4
48+
* @{
49+
* @brief Module to declare HAL Clock library
50+
*/
51+
52+
/** @brief This function performs initialization and configuration of processor's
53+
* clock module.
54+
*/
55+
void hal_clock_init(void);
56+
57+
/** @} */
58+
59+
#endif /* HAL_CLOCK_H_INCLUDED */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/**
2+
* Copyright (c) 2016 - 2021 Nordic Semiconductor ASA and Luxoft Global Operations Gmbh.
3+
*
4+
* All Rights Reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without modification,
7+
* are permitted provided that the following conditions are met:
8+
*
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binary form, except as embedded into a Nordic
14+
* Semiconductor ASA integrated circuit in a product or a software update for
15+
* such product, must reproduce the above copyright notice, this list of
16+
* conditions and the following disclaimer in the documentation and/or other
17+
* materials provided with the distribution.
18+
*
19+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
20+
* contributors may be used to endorse or promote products derived from this
21+
* software without specific prior written permission.
22+
*
23+
* 4. This software, with or without modification, must only be used with a
24+
* Nordic Semiconductor ASA integrated circuit.
25+
*
26+
* 5. Any software provided in binary form under this license must not be reverse
27+
* engineered, decompiled, modified and/or disassembled.
28+
*
29+
*
30+
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
31+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32+
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
33+
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
34+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
36+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
39+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40+
*
41+
*/
42+
#ifndef HAL_DEBUG_INTERFACE_H_INCLUDED
43+
#define HAL_DEBUG_INTERFACE_H_INCLUDED
44+
45+
46+
#if defined(NRF52) || defined(NRF52840_XXAA)
47+
48+
#include "nrf_assert.h"
49+
50+
#endif // NRF52
51+
52+
/**
53+
* @defgroup hal_debug_interface HAL Debug Interface
54+
* @ingroup hal_15_4
55+
* @{
56+
* @brief Module to declare HAL debug interface
57+
*/
58+
59+
#ifdef CONFIG_DEBUG
60+
61+
#include <stdint.h>
62+
63+
#define HAL_DEBUG_INTERFACE_INIT() hal_debug_init()
64+
#define HAL_DEBUG_INTERFACE_PUT(c, n) hal_debug_put(c, n)
65+
#define HAL_DEBUG_INTERFACE_PUTC(c) hal_debug_putc(c)
66+
#define HAL_DEBUG_INTERFACE_PUTS(s) hal_debug_puts(s)
67+
68+
/**
69+
* @brief Debug interface initialization
70+
*/
71+
void hal_debug_init(void);
72+
73+
/**
74+
* @brief Sends string to the debug interface
75+
*
76+
* @details send debug data using debug interface
77+
*
78+
* @param[in] p_data debug string.
79+
* @param[in] len string length.
80+
*/
81+
void hal_debug_put(const void * p_data, uint8_t len);
82+
83+
/**
84+
* @brief Sends char symbol to the debug interface
85+
*
86+
* @details send debug data using debug interface
87+
*
88+
* @param[in] data char symbol.
89+
*/
90+
void hal_debug_putc(const char data);
91+
92+
/**
93+
* @brief Sends a null-terminated string to the debug interface
94+
*
95+
* @details send debug data using debug interface
96+
*
97+
* @param[in] p_data null-terminated string.
98+
*/
99+
void hal_debug_puts(const char * p_data);
100+
101+
#else
102+
103+
/* If debug is disabled, these macros are just a stub.*/
104+
#define HAL_DEBUG_INTERFACE_INIT()
105+
#define HAL_DEBUG_INTERFACE_PUT(c, n)
106+
#define HAL_DEBUG_INTERFACE_PUTC(c)
107+
#define HAL_DEBUG_INTERFACE_PUTS(s)
108+
109+
#endif // CONFIG_DEBUG
110+
111+
/** @} */
112+
113+
#endif // HAL_DEBUG_INTERFACE_H_INCLUDED
+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
/**
2+
* Copyright (c) 2016 - 2021 Nordic Semiconductor ASA and Luxoft Global Operations Gmbh.
3+
*
4+
* All Rights Reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without modification,
7+
* are permitted provided that the following conditions are met:
8+
*
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binary form, except as embedded into a Nordic
14+
* Semiconductor ASA integrated circuit in a product or a software update for
15+
* such product, must reproduce the above copyright notice, this list of
16+
* conditions and the following disclaimer in the documentation and/or other
17+
* materials provided with the distribution.
18+
*
19+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
20+
* contributors may be used to endorse or promote products derived from this
21+
* software without specific prior written permission.
22+
*
23+
* 4. This software, with or without modification, must only be used with a
24+
* Nordic Semiconductor ASA integrated circuit.
25+
*
26+
* 5. Any software provided in binary form under this license must not be reverse
27+
* engineered, decompiled, modified and/or disassembled.
28+
*
29+
*
30+
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
31+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32+
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
33+
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
34+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
36+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
39+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40+
*
41+
*/
42+
#ifndef HAL_DELAY_H_INCLUDED
43+
#define HAL_DELAY_H_INCLUDED
44+
45+
#include <stdint.h>
46+
47+
/** @file
48+
* This file contains declaration of the Hardware Delay routine.
49+
*
50+
* @defgroup hal_delay HAL Delay API
51+
* @ingroup hal_15_4
52+
* @{
53+
* @brief Module to declare HAL Delay API
54+
* @details The Delay module implements the only hal_delay() routine to delay the execution for some microseconds.
55+
*/
56+
57+
/**@brief Function for delaying execution for number of microseconds.
58+
*
59+
* @param[in] number_of_us number of microseconds to delay.
60+
*/
61+
void hal_delay(uint32_t number_of_us);
62+
63+
/** @} */
64+
65+
#endif // HAL_DELAY_H_INCLUDED

components/802_15_4/api/HAL/hal_led.h

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/**
2+
* Copyright (c) 2016 - 2021 Nordic Semiconductor ASA and Luxoft Global Operations Gmbh.
3+
*
4+
* All Rights Reserved.
5+
*
6+
* Redistribution and use in source and binary forms, with or without modification,
7+
* are permitted provided that the following conditions are met:
8+
*
9+
*
10+
* 1. Redistributions of source code must retain the above copyright notice, this
11+
* list of conditions and the following disclaimer.
12+
*
13+
* 2. Redistributions in binary form, except as embedded into a Nordic
14+
* Semiconductor ASA integrated circuit in a product or a software update for
15+
* such product, must reproduce the above copyright notice, this list of
16+
* conditions and the following disclaimer in the documentation and/or other
17+
* materials provided with the distribution.
18+
*
19+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its
20+
* contributors may be used to endorse or promote products derived from this
21+
* software without specific prior written permission.
22+
*
23+
* 4. This software, with or without modification, must only be used with a
24+
* Nordic Semiconductor ASA integrated circuit.
25+
*
26+
* 5. Any software provided in binary form under this license must not be reverse
27+
* engineered, decompiled, modified and/or disassembled.
28+
*
29+
*
30+
* THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
31+
* OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
32+
* OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
33+
* DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
34+
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35+
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
36+
* GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37+
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
38+
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
39+
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40+
*
41+
*/
42+
#ifndef HAL_LED_H_INCLUDED
43+
#define HAL_LED_H_INCLUDED
44+
45+
#include <stdint.h>
46+
47+
#define HAL_LED_AMOUNT 4
48+
49+
void hal_led_init(uint32_t led_mask);
50+
void hal_led_on(uint32_t led_mask);
51+
void hal_led_off(uint32_t led_mask);
52+
void hal_led_toggle(uint32_t led_mask);
53+
54+
#endif /* HAL_LED_H_INCLUDED */

0 commit comments

Comments
 (0)