trax_init.c
1 // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #include <stdio.h> 16 #include "esp_attr.h" 17 #include "esp_err.h" 18 #include "esp_log.h" 19 #include "trax.h" 20 #include "soc/sensitive_reg.h" 21 #include "sdkconfig.h" 22 23 #define TRACEMEM_MUX_BLK0_NUM 19 24 #define TRACEMEM_MUX_BLK1_NUM 20 25 26 static const char *__attribute__((unused)) TAG = "trax"; 27 28 // IDF-1785 29 int trax_enable(trax_ena_select_t which) 30 { 31 #ifndef CONFIG_ESP32S3_TRAX 32 ESP_LOGE(TAG, "Trax_enable called, but trax is disabled in menuconfig!"); 33 return ESP_ERR_NO_MEM; 34 #endif 35 if (which != TRAX_ENA_PRO) { 36 return ESP_ERR_INVALID_ARG; 37 } 38 // REG_WRITE(DPORT_PMS_OCCUPY_3_REG, BIT(TRACEMEM_MUX_BLK1_NUM-4)); 39 return ESP_OK; 40 }