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