Gleb Klochkov / Mbed OS Climatcontroll_Main

Dependencies:   esp8266-driver

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers itm_api.h Source File

itm_api.h

00001 /** \addtogroup hal */
00002 /** @{*/
00003 /* mbed Microcontroller Library
00004  * Copyright (c) 2017 ARM Limited
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  *     http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 
00019 #ifndef MBED_ITM_API_H
00020 #define MBED_ITM_API_H
00021 
00022 #if defined(DEVICE_ITM)
00023 
00024 #include <stdint.h>
00025 
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029 
00030 /**
00031  * \defgroup itm_hal Instrumented Trace Macrocell HAL API
00032  * @{
00033  */
00034 
00035 enum {
00036     ITM_PORT_SWO = 0
00037 };
00038 
00039 /**
00040  * @brief      Target specific initialization function.
00041  *             This function is responsible for initializing and configuring 
00042  *             the debug clock for the ITM and setting up the SWO pin for 
00043  *             debug output.
00044  *             
00045  *             The only Cortex-M register that should be modified is the clock
00046  *             prescaler in TPI->ACPR.
00047  *             
00048  *             The generic mbed_itm_init initialization function will setup: 
00049  *             
00050  *                  ITM->LAR
00051  *                  ITM->TPR
00052  *                  ITM->TCR
00053  *                  ITM->TER
00054  *                  TPI->SPPR
00055  *                  TPI->FFCR
00056  *                  DWT->CTRL
00057  *                  
00058  *             for SWO output on stimulus port 0.
00059  */
00060 void itm_init(void);
00061 
00062 /**
00063  * @brief      Initialization function for both generic registers and target specific clock and pin.
00064  */
00065 void mbed_itm_init(void);
00066 
00067 /**
00068  * @brief      Send data over ITM stimulus port.
00069  *
00070  * @param[in]  port  The stimulus port to send data over.
00071  * @param[in]  data  The data to send.
00072  *
00073  * @return     value of data sent.
00074  */
00075 uint32_t mbed_itm_send(uint32_t port, uint32_t data);
00076 
00077 /**@}*/
00078 
00079 #ifdef __cplusplus
00080 }
00081 #endif
00082 
00083 #endif
00084 
00085 #endif /* MBED_ITM_API_H */
00086 
00087 /**@}*/