Backup 1

Committer:
borlanic
Date:
Tue Apr 24 11:45:18 2018 +0000
Revision:
0:02dd72d1d465
BaBoRo_test2 - backup 1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
borlanic 0:02dd72d1d465 1 /** \addtogroup hal */
borlanic 0:02dd72d1d465 2 /** @{*/
borlanic 0:02dd72d1d465 3 /* mbed Microcontroller Library
borlanic 0:02dd72d1d465 4 * Copyright (c) 2017 ARM Limited
borlanic 0:02dd72d1d465 5 *
borlanic 0:02dd72d1d465 6 * Licensed under the Apache License, Version 2.0 (the "License");
borlanic 0:02dd72d1d465 7 * you may not use this file except in compliance with the License.
borlanic 0:02dd72d1d465 8 * You may obtain a copy of the License at
borlanic 0:02dd72d1d465 9 *
borlanic 0:02dd72d1d465 10 * http://www.apache.org/licenses/LICENSE-2.0
borlanic 0:02dd72d1d465 11 *
borlanic 0:02dd72d1d465 12 * Unless required by applicable law or agreed to in writing, software
borlanic 0:02dd72d1d465 13 * distributed under the License is distributed on an "AS IS" BASIS,
borlanic 0:02dd72d1d465 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
borlanic 0:02dd72d1d465 15 * See the License for the specific language governing permissions and
borlanic 0:02dd72d1d465 16 * limitations under the License.
borlanic 0:02dd72d1d465 17 */
borlanic 0:02dd72d1d465 18
borlanic 0:02dd72d1d465 19 #ifndef MBED_ITM_API_H
borlanic 0:02dd72d1d465 20 #define MBED_ITM_API_H
borlanic 0:02dd72d1d465 21
borlanic 0:02dd72d1d465 22 #if defined(DEVICE_ITM)
borlanic 0:02dd72d1d465 23
borlanic 0:02dd72d1d465 24 #include <stdint.h>
borlanic 0:02dd72d1d465 25
borlanic 0:02dd72d1d465 26 #ifdef __cplusplus
borlanic 0:02dd72d1d465 27 extern "C" {
borlanic 0:02dd72d1d465 28 #endif
borlanic 0:02dd72d1d465 29
borlanic 0:02dd72d1d465 30 /**
borlanic 0:02dd72d1d465 31 * \defgroup itm_hal Instrumented Trace Macrocell HAL API
borlanic 0:02dd72d1d465 32 * @{
borlanic 0:02dd72d1d465 33 */
borlanic 0:02dd72d1d465 34
borlanic 0:02dd72d1d465 35 enum {
borlanic 0:02dd72d1d465 36 ITM_PORT_SWO = 0
borlanic 0:02dd72d1d465 37 };
borlanic 0:02dd72d1d465 38
borlanic 0:02dd72d1d465 39 /**
borlanic 0:02dd72d1d465 40 * @brief Target specific initialization function.
borlanic 0:02dd72d1d465 41 * This function is responsible for initializing and configuring
borlanic 0:02dd72d1d465 42 * the debug clock for the ITM and setting up the SWO pin for
borlanic 0:02dd72d1d465 43 * debug output.
borlanic 0:02dd72d1d465 44 *
borlanic 0:02dd72d1d465 45 * The only Cortex-M register that should be modified is the clock
borlanic 0:02dd72d1d465 46 * prescaler in TPI->ACPR.
borlanic 0:02dd72d1d465 47 *
borlanic 0:02dd72d1d465 48 * The generic mbed_itm_init initialization function will setup:
borlanic 0:02dd72d1d465 49 *
borlanic 0:02dd72d1d465 50 * ITM->LAR
borlanic 0:02dd72d1d465 51 * ITM->TPR
borlanic 0:02dd72d1d465 52 * ITM->TCR
borlanic 0:02dd72d1d465 53 * ITM->TER
borlanic 0:02dd72d1d465 54 * TPI->SPPR
borlanic 0:02dd72d1d465 55 * TPI->FFCR
borlanic 0:02dd72d1d465 56 * DWT->CTRL
borlanic 0:02dd72d1d465 57 *
borlanic 0:02dd72d1d465 58 * for SWO output on stimulus port 0.
borlanic 0:02dd72d1d465 59 */
borlanic 0:02dd72d1d465 60 void itm_init(void);
borlanic 0:02dd72d1d465 61
borlanic 0:02dd72d1d465 62 /**
borlanic 0:02dd72d1d465 63 * @brief Initialization function for both generic registers and target specific clock and pin.
borlanic 0:02dd72d1d465 64 */
borlanic 0:02dd72d1d465 65 void mbed_itm_init(void);
borlanic 0:02dd72d1d465 66
borlanic 0:02dd72d1d465 67 /**
borlanic 0:02dd72d1d465 68 * @brief Send data over ITM stimulus port.
borlanic 0:02dd72d1d465 69 *
borlanic 0:02dd72d1d465 70 * @param[in] port The stimulus port to send data over.
borlanic 0:02dd72d1d465 71 * @param[in] data The data to send.
borlanic 0:02dd72d1d465 72 *
borlanic 0:02dd72d1d465 73 * @return value of data sent.
borlanic 0:02dd72d1d465 74 */
borlanic 0:02dd72d1d465 75 uint32_t mbed_itm_send(uint32_t port, uint32_t data);
borlanic 0:02dd72d1d465 76
borlanic 0:02dd72d1d465 77 /**@}*/
borlanic 0:02dd72d1d465 78
borlanic 0:02dd72d1d465 79 #ifdef __cplusplus
borlanic 0:02dd72d1d465 80 }
borlanic 0:02dd72d1d465 81 #endif
borlanic 0:02dd72d1d465 82
borlanic 0:02dd72d1d465 83 #endif
borlanic 0:02dd72d1d465 84
borlanic 0:02dd72d1d465 85 #endif /* MBED_ITM_API_H */
borlanic 0:02dd72d1d465 86
borlanic 0:02dd72d1d465 87 /**@}*/