1 /* 2 * Copyright (c) 2020 Henrik Brix Andersen <henrik@brixandersen.dk> 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #ifndef __INC_BOARD_H 8 #define __INC_BOARD_H 9 10 enum board_daplink_qspi_mux_mode { 11 /* eXecute-In-Place mode */ 12 BOARD_DAPLINK_QSPI_MUX_MODE_XIP, 13 /* Normal mode */ 14 BOARD_DAPLINK_QSPI_MUX_MODE_NORMAL, 15 }; 16 17 /** 18 * @brief Select the mode of the DAPlink QSPI multiplexer. 19 * 20 * Note: The multiplexer mode must not be changed while executing code from the 21 * off-board QSPI flash in XIP mode. 22 * 23 * @param mode The multiplexer mode to be selected. 24 * 25 * @retval 0 If successful, negative errno otherwise. 26 */ 27 int board_daplink_qspi_mux_select(enum board_daplink_qspi_mux_mode mode); 28 29 /** 30 * @brief Determine if the DAPlink shield is fitted. 31 * 32 * Determine if the DAPlink shield is fitted based on the state of the 33 * DAPLINK_fitted_n signal. 34 * 35 * @retval true If the DAPlink shield is fitted. 36 * @retval false If the DAPlink shield is not fitted. 37 */ 38 bool board_daplink_is_fitted(void); 39 40 #endif /* __INC_BOARD_H */ 41