mirror of https://github.com/ARMmbed/mbed-os.git
Remove unused ITM implementation from NRF51 series
NRF51 doesn't support SWO out.pull/6959/head
parent
79640c6a88
commit
d27c4c920c
|
@ -1,44 +0,0 @@
|
|||
/* mbed Microcontroller Library
|
||||
* Copyright (c) 2017 ARM Limited
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined(DEVICE_ITM)
|
||||
|
||||
#include "hal/itm_api.h"
|
||||
|
||||
#include "nrf.h"
|
||||
#include "nrf5x_lf_clk_helper.h"
|
||||
|
||||
/* SWO frequency: 4000 kHz */
|
||||
void itm_init(void)
|
||||
{
|
||||
/* Enable SWO trace functionality */
|
||||
CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;
|
||||
NRF_CLOCK->TRACECONFIG |= CLOCK_TRACECONFIG_TRACEMUX_Serial << CLOCK_TRACECONFIG_TRACEMUX_Pos;
|
||||
|
||||
/* set SWO clock speed to 4 MHz */
|
||||
NRF_CLOCK->TRACECONFIG = (NRF_CLOCK->TRACECONFIG & ~CLOCK_TRACECONFIG_TRACEPORTSPEED_Msk) |
|
||||
(CLOCK_TRACECONFIG_TRACEPORTSPEED_4MHz << CLOCK_TRACECONFIG_TRACEPORTSPEED_Pos);
|
||||
|
||||
/* set SWO pin */
|
||||
NRF_P0->PIN_CNF[18] = (GPIO_PIN_CNF_DRIVE_H0H1 << GPIO_PIN_CNF_DRIVE_Pos) |
|
||||
(GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos) |
|
||||
(GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos);
|
||||
|
||||
/* set prescaler */
|
||||
TPI->ACPR = 0;
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue