Merge pull request #209 from ObKo/master
Update NRF52832 device headers to latest version from NRF5 SDK
This commit is contained in:
Коммит
a396b22d9a
|
@ -65,7 +65,7 @@
|
|||
/* Including the device CMSIS header. Note, we are not using the definitions
|
||||
from this header because we need this file to be usable also from
|
||||
assembler source files. We verify that the info matches instead.*/
|
||||
#include "nrf52.h"
|
||||
#include "nrf.h"
|
||||
|
||||
#if CORTEX_MODEL != __CORTEX_M
|
||||
#error "CMSIS __CORTEX_M mismatch"
|
||||
|
|
|
@ -299,13 +299,8 @@ void i2c_lld_start(I2CDriver *i2cp) {
|
|||
(void)i2c->EVENTS_RXDREADY;
|
||||
(void)i2c->EVENTS_TXDSENT;
|
||||
#endif
|
||||
#if NRF_SERIES == 51
|
||||
i2c->PSELSCL = cfg->scl_pad;
|
||||
i2c->PSELSDA = cfg->sda_pad;
|
||||
#else
|
||||
i2c->PSEL.SCL = cfg->scl_pad;
|
||||
i2c->PSEL.SDA = cfg->sda_pad;
|
||||
#endif
|
||||
|
||||
switch (cfg->clock) {
|
||||
case 100000:
|
||||
|
|
|
@ -63,7 +63,7 @@ void hal_lld_init(void)
|
|||
#error "A 32Mhz crystal is mandatory on nRF52 boards."
|
||||
#endif
|
||||
|
||||
#if (NRF5_HFCLK_SOURCE == NRF5_HFCLK_HFXO)
|
||||
#if (NRF5_HFCLK_SOURCE == CLOCK_HFCLKSTAT_SRC_Xtal)
|
||||
NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
|
||||
NRF_CLOCK->TASKS_HFCLKSTART = 1;
|
||||
while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
|
||||
|
@ -73,14 +73,14 @@ void hal_lld_init(void)
|
|||
*/
|
||||
#if (OSAL_ST_MODE != OSAL_ST_MODE_NONE)
|
||||
#if (NRF5_ST_USE_RTC0 || NRF5_ST_USE_RTC1) && \
|
||||
(NRF5_LFCLK_SOURCE == NRF5_LFCLK_RC)
|
||||
(NRF5_LFCLK_SOURCE == CLOCK_LFCLKSTAT_SRC_RC)
|
||||
#error "A NRF5_SYSTEM_TICKS_AS_RTC requires LFCLK clock to be started."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
NRF_CLOCK->TASKS_LFCLKSTOP = 1;
|
||||
|
||||
#if (NRF5_LFCLK_SOURCE != NRF5_LFCLK_RC)
|
||||
#if (NRF5_LFCLK_SOURCE != CLOCK_LFCLKSTAT_SRC_RC)
|
||||
NRF_CLOCK->LFCLKSRC = NRF5_LFCLK_SOURCE;
|
||||
|
||||
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
* 1 : 32 MHz external crystal oscillator (HFXO)
|
||||
*/
|
||||
#if !defined(NRF5_HFCLK_SOURCE) || defined(__DOXYGEN__)
|
||||
#define NRF5_HFCLK_SOURCE NRF5_HFCLK_HFINT
|
||||
#define NRF5_HFCLK_SOURCE CLOCK_HFCLKSTAT_SRC_RC
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
@ -79,7 +79,7 @@
|
|||
* internal RC oscillator that synthesizing the clock.
|
||||
*/
|
||||
#if !defined(NRF5_LFCLK_SOURCE) || defined(__DOXYGEN__)
|
||||
#define NRF5_LFCLK_SOURCE NRF5_LFCLK_RC
|
||||
#define NRF5_LFCLK_SOURCE CLOCK_LFCLKSTAT_SRC_RC
|
||||
#endif
|
||||
|
||||
/*===========================================================================*/
|
||||
|
@ -105,14 +105,6 @@
|
|||
/*===========================================================================*/
|
||||
/* External declarations. */
|
||||
/*===========================================================================*/
|
||||
#if 0 // moved to board.h
|
||||
#define NRF5_HFCLK_HFINT 0
|
||||
#define NRF5_HFCLK_HFXO 1
|
||||
|
||||
#define NRF5_LFCLK_RC 0
|
||||
#define NRF5_LFCLK_XTAL 1
|
||||
#define NRF5_LFCLK_SYNTH 2
|
||||
#endif
|
||||
|
||||
#include "nvic.h"
|
||||
#include "nrf52_isr.h"
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
/*
|
||||
|
||||
Copyright (c) 2010 - 2018, Nordic Semiconductor ASA
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form, except as embedded into a Nordic
|
||||
Semiconductor ASA integrated circuit in a product or a software update for
|
||||
such product, must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
3. Neither the name of Nordic Semiconductor ASA nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
4. This software, with or without modification, must only be used with a
|
||||
Nordic Semiconductor ASA integrated circuit.
|
||||
|
||||
5. Any software provided in binary form under this license must not be reverse
|
||||
engineered, decompiled, modified and/or disassembled.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
/** @addtogroup Nordic Semiconductor
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup nrf52
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NRF_H
|
||||
#define NRF_H
|
||||
|
||||
#include "nrf52.h"
|
||||
#include "nrf52_bitfields.h"
|
||||
#include "nrf51_to_nrf52.h"
|
||||
#include "nrf52_name_change.h"
|
||||
|
||||
#endif /* NRF_H */
|
||||
|
||||
/** @} */ /* End of group nrf52 */
|
||||
/** @} */ /* End of group Nordic Semiconductor */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
|
||||
Copyright (c) 2010 - 2018, Nordic Semiconductor ASA
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form, except as embedded into a Nordic
|
||||
Semiconductor ASA integrated circuit in a product or a software update for
|
||||
such product, must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
3. Neither the name of Nordic Semiconductor ASA nor the names of its
|
||||
contributors may be used to endorse or promote products derived from this
|
||||
software without specific prior written permission.
|
||||
|
||||
4. This software, with or without modification, must only be used with a
|
||||
Nordic Semiconductor ASA integrated circuit.
|
||||
|
||||
5. Any software provided in binary form under this license must not be reverse
|
||||
engineered, decompiled, modified and/or disassembled.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY NORDIC SEMICONDUCTOR ASA "AS IS" AND ANY EXPRESS
|
||||
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL NORDIC SEMICONDUCTOR ASA OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
|
||||
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
||||
OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
|
||||
/** @addtogroup Nordic Semiconductor
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup nrf52
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef NRF52_NAME_CHANGE_H
|
||||
#define NRF52_NAME_CHANGE_H
|
||||
|
||||
/*lint ++flb "Enter library region */
|
||||
|
||||
/* This file is given to prevent your SW from not compiling with the updates made to nrf52.h and
|
||||
* nrf52_bitfields.h. The macros defined in this file were available previously. Do not use these
|
||||
* macros on purpose. Use the ones defined in nrf52.h and nrf52_bitfields.h instead.
|
||||
*/
|
||||
|
||||
/* I2S */
|
||||
/* Several enumerations changed case. Adding old macros to keep compilation compatibility. */
|
||||
#define I2S_ENABLE_ENABLE_DISABLE I2S_ENABLE_ENABLE_Disabled
|
||||
#define I2S_ENABLE_ENABLE_ENABLE I2S_ENABLE_ENABLE_Enabled
|
||||
#define I2S_CONFIG_MODE_MODE_MASTER I2S_CONFIG_MODE_MODE_Master
|
||||
#define I2S_CONFIG_MODE_MODE_SLAVE I2S_CONFIG_MODE_MODE_Slave
|
||||
#define I2S_CONFIG_RXEN_RXEN_DISABLE I2S_CONFIG_RXEN_RXEN_Disabled
|
||||
#define I2S_CONFIG_RXEN_RXEN_ENABLE I2S_CONFIG_RXEN_RXEN_Enabled
|
||||
#define I2S_CONFIG_TXEN_TXEN_DISABLE I2S_CONFIG_TXEN_TXEN_Disabled
|
||||
#define I2S_CONFIG_TXEN_TXEN_ENABLE I2S_CONFIG_TXEN_TXEN_Enabled
|
||||
#define I2S_CONFIG_MCKEN_MCKEN_DISABLE I2S_CONFIG_MCKEN_MCKEN_Disabled
|
||||
#define I2S_CONFIG_MCKEN_MCKEN_ENABLE I2S_CONFIG_MCKEN_MCKEN_Enabled
|
||||
#define I2S_CONFIG_SWIDTH_SWIDTH_8BIT I2S_CONFIG_SWIDTH_SWIDTH_8Bit
|
||||
#define I2S_CONFIG_SWIDTH_SWIDTH_16BIT I2S_CONFIG_SWIDTH_SWIDTH_16Bit
|
||||
#define I2S_CONFIG_SWIDTH_SWIDTH_24BIT I2S_CONFIG_SWIDTH_SWIDTH_24Bit
|
||||
#define I2S_CONFIG_ALIGN_ALIGN_LEFT I2S_CONFIG_ALIGN_ALIGN_Left
|
||||
#define I2S_CONFIG_ALIGN_ALIGN_RIGHT I2S_CONFIG_ALIGN_ALIGN_Right
|
||||
#define I2S_CONFIG_FORMAT_FORMAT_ALIGNED I2S_CONFIG_FORMAT_FORMAT_Aligned
|
||||
#define I2S_CONFIG_CHANNELS_CHANNELS_STEREO I2S_CONFIG_CHANNELS_CHANNELS_Stereo
|
||||
#define I2S_CONFIG_CHANNELS_CHANNELS_LEFT I2S_CONFIG_CHANNELS_CHANNELS_Left
|
||||
#define I2S_CONFIG_CHANNELS_CHANNELS_RIGHT I2S_CONFIG_CHANNELS_CHANNELS_Right
|
||||
|
||||
/* LPCOMP */
|
||||
/* Corrected typo in RESULT register. */
|
||||
#define LPCOMP_RESULT_RESULT_Bellow LPCOMP_RESULT_RESULT_Below
|
||||
|
||||
/*lint --flb "Leave library region" */
|
||||
|
||||
#endif /* NRF52_NAME_CHANGE_H */
|
||||
|
||||
/** @} */ /* End of group nrf52 */
|
||||
/** @} */ /* End of group Nordic Semiconductor */
|
Загрузка…
Ссылка в новой задаче