diff --git a/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk b/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk index 95b19648373..09c3046c596 100644 --- a/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk +++ b/Libraries/CMSIS/Device/Maxim/GCC/gcc.mk @@ -24,7 +24,7 @@ ifeq "$(PYTHON_CMD)" "" # Try python -ifneq "$(wildcard $(MAXIM_PATH)/.git)" "" +ifneq "$(wildcard $(MAXIM_PATH)/.github)" "" PYTHON_VERSION := $(shell python --version) ifneq ($(.SHELLSTATUS),0) PYTHON_CMD := none @@ -46,15 +46,17 @@ endif export PYTHON_CMD endif -# Run script +# Make sure script exists before running. This won't run when working in the official MSDK release (non-GitHub) +ifneq ("$(wildcard $(MAXIM_PATH)/.github)", "") +# Run script if exists. ifneq "$(PYTHON_CMD)" "none" UPDATE_VERSION_OUTPUT := $(shell python $(MAXIM_PATH)/.github/workflows/scripts/update_version.py) else $(warning No Python installation detected on your system! Will not automatically update version info.) +endif endif endif - ifneq "$(wildcard $(MAXIM_PATH)/Libraries/CMSIS/Device/Maxim/GCC/mxc_version.mk)" "" include $(MAXIM_PATH)/Libraries/CMSIS/Device/Maxim/GCC/mxc_version.mk endif diff --git a/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk b/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk index c64ef43fe66..e8f3515986d 100644 --- a/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk +++ b/Libraries/CMSIS/Device/Maxim/GCC/gcc_riscv.mk @@ -47,11 +47,14 @@ endif export PYTHON_CMD endif -# Run script +# Make sure script exists before running. This won't run when working in the official MSDK release (non-GitHub) +ifneq ("$(wildcard $(MAXIM_PATH)/.github)", "") +# Run script if exists. ifneq "$(PYTHON_CMD)" "none" UPDATE_VERSION_OUTPUT := $(shell python $(MAXIM_PATH)/.github/workflows/scripts/update_version.py) else $(warning No Python installation detected on your system! Will not automatically update version info.) +endif endif endif diff --git a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c index 071bc02cbf0..bc6e6930afe 100644 --- a/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c +++ b/Libraries/Cordio/controller/sources/ble/lhci/lhci_cmd_vs.c @@ -7,6 +7,8 @@ * Copyright (c) 2013-2019 Arm Ltd. All Rights Reserved. * * Copyright (c) 2019-2020 Packetcraft, Inc. + * + * Portions Copyright (c) 2024 Analog Devices, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -93,6 +95,9 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) uint8_t status = HCI_SUCCESS; uint8_t evtParamLen = 1; /* default is status field only */ uint32_t regReadAddr = 0; + uint32_t channel = 0; + + (void)channel; /* Decode and consume command packet. */ @@ -276,8 +281,65 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) } case LHCI_OPCODE_VS_GET_RSSI: { - status = LL_SUCCESS; + #if 0 + channel = pBuf[0]; + + if(channel > LL_DTM_MAX_CHAN_IDX) + { + status = LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + else{ + status = LL_SUCCESS; + } evtParamLen += sizeof(int8_t); + #else + status = LL_ERROR_CODE_CMD_DISALLOWED; + #endif + + break; + } + case LHCI_OPCODE_VS_FGEN: + { + #if 0 + uint8_t enable = pBuf[0]; + + if(enable) + { + int8_t txPower = 0; + uint32_t frequency_khz = pBuf[3] << 16 | pBuf[2] << 8 | pBuf[1]; + PalBbPatternType_t patternType = pBuf[4]; + + status = LlGetAdvTxPower(&txPower); + + if(status != LL_SUCCESS) + { + break; + } + else if(PalBbFgenIsEnabled()) + { + status = LL_ERROR_CODE_CMD_DISALLOWED; + } + else if(!PalBbIsValidPrbsType(patternType)) + { + status = LL_ERROR_CODE_INVALID_HCI_CMD_PARAMS; + } + else{ + const bool freqOk = PalBbEnableFgen(frequency_khz, patternType, txPower); + status = freqOk ? LL_SUCCESS : LL_ERROR_CODE_PARAM_OUT_OF_MANDATORY_RANGE; + } + + + } + else + { + PalBbDisableFgen(); + status = LL_SUCCESS; + } + + #else + status = LL_ERROR_CODE_CMD_DISALLOWED; + #endif + break; } case LHCI_OPCODE_VS_RESET_ADV_STATS: @@ -319,22 +381,36 @@ bool_t lhciCommonVsStdDecodeCmdPkt(LhciHdr_t *pHdr, uint8_t *pBuf) case LHCI_OPCODE_VS_TX_TEST: case LHCI_OPCODE_VS_RESET_ADV_STATS: case LHCI_OPCODE_VS_RESET_SCAN_STATS: + case LHCI_OPCODE_VS_FGEN: /* no action */ break; + case LHCI_OPCODE_VS_GET_RSSI: + { + #if 0 + if(status != LL_SUCCESS) + { + break; + } + + int8_t rssi = 0; + PalBbGetRssi(&rssi, channel); + + + pBuf[0] = (uint8_t)rssi; + #else + pBuf[0] = INT8_MIN; + #endif + + + + break; + } case LHCI_OPCODE_VS_RESET_TEST_STATS: { BbBleResetTestStats(); break; } - case LHCI_OPCODE_VS_GET_RSSI:{ - /* - TODO: Needs feature in PHY - */ - // PalBbEnable(); - pBuf[0] = -10; - break; - } case LHCI_OPCODE_VS_SET_LOCAL_FEAT: case LHCI_OPCODE_VS_SET_DIAG_MODE: diff --git a/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h b/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h index ad00651f478..4662eb7e191 100644 --- a/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h +++ b/Libraries/Cordio/controller/sources/ble/lhci/lhci_int.h @@ -7,6 +7,8 @@ * Copyright (c) 2013-2019 Arm Ltd. All Rights Reserved. * * Copyright (c) 2019-2020 Packetcraft, Inc. + * + * Portions Copyright (c) 2024 Analog Devices, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -377,10 +379,14 @@ extern "C" { 0x306) /*! #ifdef __cplusplus extern "C" { @@ -78,6 +81,15 @@ enum PalBbPhy_op { BB_PHY_OPTIONS_BLE_S8 = 2 /*!< Always use S=8 coding when transmitting on LE Coded PHY. */ }; +typedef enum +{ + PAL_BB_CW, + PAL_BB_PRBS9, + PAL_BB_PRBS15, + PAL_BB_DF1, + PAL_BB_DF2 +}PalBbPatternType_t; + #ifndef BB_CLK_RATE_HZ /*! \brief BB clock rate in hertz. */ #define BB_CLK_RATE_HZ 1000000 @@ -160,6 +172,8 @@ typedef struct { uint8_t patch; char *buildDate; } PalBbPhyVersion_t; + + /************************************************************************************************** Function Declarations **************************************************************************************************/ @@ -281,6 +295,60 @@ void PalBbSetProtId(uint8_t protId); /*************************************************************************************************/ const PalBbPhyVersion_t *PalBbGetPhyVersion(void); +/*************************************************************************************************/ +/*! + * \brief Enable frequency generator + * + * \param freqKhz Frequency to transmit in KHz, Valid range 2402000 - 2500000 + * + * \param type PRBS TYPE + */ +/*************************************************************************************************/ +bool PalBbEnableFgen(uint32_t freqKhz, PalBbPatternType_t type, int8_t txPower); + +/*************************************************************************************************/ +/*! + * \brief Disable frequency generator + * + */ +/*************************************************************************************************/ +void PalBbDisableFgen(void); + +/*************************************************************************************************/ +/*! + * \brief Check if the fgen functionality is enabled + * \return true if enabled. false otherwise + */ +/*************************************************************************************************/ +bool PalBbFgenIsEnabled(void); + +/*************************************************************************************************/ +/*! + * \brief Sample an RSSI capture + * + * \param rssi Pointer to rssi output. + * \param channel RF channel to sample RSSI on. + * \return FALSE if RSSI capture times out + */ +/*************************************************************************************************/ +bool_t PalBbGetRssi(int8_t *rssi, uint8_t rfChannel); + +static inline bool PalBbIsValidPrbsType(uint8_t maybeType) +{ + switch (maybeType) + { + case PAL_BB_CW: + case PAL_BB_PRBS9: + case PAL_BB_PRBS15: + case PAL_BB_DF1: + case PAL_BB_DF2: + return true; + + default: + return false; + } +} + /*! \} */ /* PAL_BB */ #ifdef __cplusplus diff --git a/Libraries/Cordio/platform/include/pal_bb_ble.h b/Libraries/Cordio/platform/include/pal_bb_ble.h index 0f24e9ffa57..8decca8dee3 100644 --- a/Libraries/Cordio/platform/include/pal_bb_ble.h +++ b/Libraries/Cordio/platform/include/pal_bb_ble.h @@ -187,6 +187,15 @@ void PalBbBleDisable(void); /*************************************************************************************************/ void PalBbBleSetChannelParam(PalBbBleChan_t *pChan); +/*************************************************************************************************/ +/*! + * \brief Set channelization parameters. + * + * \return pChan + */ +/*************************************************************************************************/ +const PalBbBleChan_t* PalBbBleGetChannelParam(void); + /*! \} */ /* PAL_BB_BLE_CHAN */ /*! \addtogroup PAL_BB_BLE_DATA diff --git a/Libraries/zephyr/MAX/Include/wrap_max32_sdhc.h b/Libraries/zephyr/MAX/Include/wrap_max32_sdhc.h new file mode 100644 index 00000000000..55f06571c66 --- /dev/null +++ b/Libraries/zephyr/MAX/Include/wrap_max32_sdhc.h @@ -0,0 +1,34 @@ +/****************************************************************************** + * + * Copyright (C) 2024 Analog Devices, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + ******************************************************************************/ + +#ifndef LIBRARIES_ZEPHYR_MAX_INCLUDE_WRAP_MAX32_SDHC_H_ +#define LIBRARIES_ZEPHYR_MAX_INCLUDE_WRAP_MAX32_SDHC_H_ + +/***** Includes *****/ +#include +#include "sdhc_reva.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef __cplusplus +} +#endif + +#endif // LIBRARIES_ZEPHYR_MAX_INCLUDE_WRAP_MAX32_SDHC_H_