Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers settings.h Source File

settings.h

Go to the documentation of this file.
00001 /**
00002  * @file    settings.h
00003  * @brief   Access to read user configuration settings
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
00007  * Copyright 2019, Cypress Semiconductor Corporation 
00008  * or a subsidiary of Cypress Semiconductor Corporation.
00009  * SPDX-License-Identifier: Apache-2.0
00010  *
00011  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00012  * not use this file except in compliance with the License.
00013  * You may obtain a copy of the License at
00014  *
00015  * http://www.apache.org/licenses/LICENSE-2.0
00016  *
00017  * Unless required by applicable law or agreed to in writing, software
00018  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00019  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00020  * See the License for the specific language governing permissions and
00021  * limitations under the License.
00022  */
00023 #ifndef SETTINGS_H
00024 #define SETTINGS_H
00025 
00026 #include <stdint.h>
00027 #include <stdbool.h>
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 typedef enum {
00034     ASSERT_SOURCE_NONE = 0,
00035     ASSERT_SOURCE_BL = 1,
00036     ASSERT_SOURCE_APP = 2
00037 } assert_source_t;
00038 
00039 void config_init(void);
00040 
00041 // Get/set settings residing in flash
00042 void config_set_auto_rst(bool on);
00043 void config_set_automation_allowed(bool on);
00044 void config_set_overflow_detect(bool on);
00045 bool config_get_auto_rst(void);
00046 bool config_get_automation_allowed(void);
00047 bool config_get_overflow_detect(void);
00048 
00049 // Get/set settings residing in shared ram
00050 void config_ram_set_hold_in_bl(bool hold);
00051 void config_ram_set_assert(const char *file, uint16_t line);
00052 void config_ram_clear_assert(void);
00053 bool config_ram_get_hold_in_bl(void);
00054 bool config_ram_get_initial_hold_in_bl(void);
00055 bool config_ram_get_assert(char *buf, uint16_t buf_size, uint16_t *line, assert_source_t *source);
00056 uint8_t config_ram_add_hexdump(uint32_t hexdump);
00057 uint8_t config_ram_get_hexdumps(uint32_t **hexdumps);
00058 void config_ram_set_disable_msd(bool disable_msd);
00059 uint8_t config_ram_get_disable_msd(void);
00060 void config_ram_set_page_erase(bool page_erase_enable);
00061 bool config_ram_get_page_erase(void);
00062 
00063 // Private - should only be called from settings.c
00064 void config_rom_init(void);
00065 
00066 #ifdef __cplusplus
00067 }
00068 #endif
00069 
00070 #endif