Skip to content

Commit

Permalink
Merge branch 'feat/example-test' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
JC-282-AD authored Jun 27, 2024
2 parents dbd8bc5 + 7570b6c commit f5641c7
Show file tree
Hide file tree
Showing 16 changed files with 557 additions and 31 deletions.
490 changes: 490 additions & 0 deletions .github/workflows/scripts/example_tester.sh

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Examples/MAX32665/Bluetooth/BLE_datc/datc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,12 +568,14 @@ static void datcScanReport(dmEvt_t *pMsg)
/* find device name */
if (!connect && ((pData = DmFindAdType(DM_ADV_TYPE_LOCAL_NAME, pMsg->scanReport.len,
pMsg->scanReport.pData)) != NULL)) {

/* check length and device name */
char advName[] = ADV_NAME;
if (pData[DM_AD_LEN_IDX] == sizeof(advName) &&
!strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) {

connect = TRUE;
}
}
}

if (connect) {
Expand Down
1 change: 1 addition & 0 deletions Examples/MAX32665/Bluetooth/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ static void datsSetup(dmEvt_t *pMsg)
{
/* Initialize control information */
datsCb.restoringResList = FALSE;

memcpy(&datsScanDataDisc[2], deviceName, sizeof(deviceName));
datsScanDataDisc[0] = sizeof(deviceName);
datsScanDataDisc[1] = DM_ADV_TYPE_LOCAL_NAME;
Expand Down
4 changes: 2 additions & 2 deletions Examples/MAX32690/ADC/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
#include "fcr_regs.h"
#include "led.h"
#include "tmr.h"

#include "nvic_table.h"
/***** Definitions *****/

#define POLLING // Uncomment to perform ADC conversions using blocking/polling method
//#define POLLING // Uncomment to perform ADC conversions using blocking/polling method
// #define INTERRUPT // Uncomment to perform ADC conversions using interrupt driven method
// #define DMA // Uncomment to perform ADC conversions using DMA driven method.

Expand Down
3 changes: 3 additions & 0 deletions Examples/MAX32690/ADC/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
# For more information on how sing process works, see
# https://www.analog.com/en/education/education-library/videos/6313214207112.html
SBT=0

METHOD ?= POLLING
PROJ_CFLAGS += -D$(METHOD)
2 changes: 1 addition & 1 deletion Examples/MAX32690/Bluetooth/BLE_datc/datc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ static void datcScanReport(dmEvt_t *pMsg)
if (pData[DM_AD_LEN_IDX] == sizeof(advName) &&
!strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) {
connect = TRUE;
}
}
}

if (connect) {
Expand Down
7 changes: 6 additions & 1 deletion Examples/MAX32690/Bluetooth/BLE_dats/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
#include "tmr.h"
#include "svc_sds.h"



/**************************************************************************************************
Macros
**************************************************************************************************/
Expand Down Expand Up @@ -117,14 +119,17 @@ static const appSlaveCfg_t datsSlaveCfg = {
* -DM_KEY_DIST_CSRK : Distribute CSRK used for signed data
*/


static const appSecCfg_t datsSecCfg = {
DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG, /*! Authentication and bonding flags */
DM_AUTH_BOND_FLAG | DM_AUTH_SC_FLAG | DM_AUTH_MITM_FLAG, /*! Authentication and bonding flags */
DM_KEY_DIST_IRK, /*! Initiator key distribution flags */
DM_KEY_DIST_LTK | DM_KEY_DIST_IRK, /*! Responder key distribution flags */
FALSE, /*! TRUE if Out-of-band pairing data is present */
INIT_SECURITY /*! TRUE to initiate security upon connection */
};



/* OOB UART parameters */
#define OOB_BAUD 115200
#define OOB_FLOW FALSE
Expand Down
3 changes: 2 additions & 1 deletion Examples/MAX32690/Bluetooth/BLE_otac/datc_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include "pal_btn.h"
#include "tmr.h"


/**************************************************************************************************
Macros
**************************************************************************************************/
Expand Down Expand Up @@ -498,7 +499,7 @@ static void datcScanReport(dmEvt_t *pMsg)
if (pData[DM_AD_LEN_IDX] == sizeof(advName) &&
!strncmp(advName, (char *)&(pData[DM_AD_DATA_IDX]), sizeof(advName))) {
connect = TRUE;
}
}
}

if (connect) {
Expand Down
1 change: 1 addition & 0 deletions Examples/MAX32690/Bluetooth/BLE_otas/dats_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,7 @@ static void datsSetup(dmEvt_t *pMsg)
{
/* Initialize control information */
datsCb.restoringResList = FALSE;

memcpy(&datsScanDataDisc[2], deviceName, sizeof(deviceName));
datsScanDataDisc[0] = sizeof(deviceName);
datsScanDataDisc[1] = DM_ADV_TYPE_LOCAL_NAME;
Expand Down
20 changes: 8 additions & 12 deletions Examples/MAX32690/SPI/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,12 @@
#include "led.h"

/***** Preprocessors *****/
#define MASTERSYNC 1
#define MASTERASYNC 0
#define MASTERDMA 0
//#define MASTERSYNC 1
//#define MASTERASYNC 0
//#define MASTERDMA 0
// define three METHOD above in project.mk
// MASTERSYNC is default

#if (!(MASTERSYNC || MASTERASYNC || MASTERDMA))
#error "You must set either MASTERSYNC or MASTERASYNC or MASTERDMA to 1."
#endif
#if ((MASTERSYNC && MASTERASYNC) || (MASTERASYNC && MASTERDMA) || (MASTERDMA && MASTERSYNC))
#error "You must select either MASTERSYNC or MASTERASYNC or MASTERDMA, not all 3."
#endif
/***** Definitions *****/
#define DATA_LEN 100 // Words
#define DATA_VALUE 0xA5A5 // This is for master mode only...
Expand Down Expand Up @@ -153,11 +149,11 @@ int main(void)
return retVal;
}

#if MASTERSYNC
#ifdef MASTERSYNC
MXC_SPI_MasterTransaction(&req);
#endif

#if MASTERASYNC
#ifdef MASTERASYNC
MXC_NVIC_SetVector(SPI_IRQ, SPI_IRQHandler);
NVIC_EnableIRQ(SPI_IRQ);
MXC_SPI_MasterTransactionAsync(&req);
Expand All @@ -166,7 +162,7 @@ int main(void)

#endif

#if MASTERDMA
#ifdef MASTERDMA
MXC_DMA_ReleaseChannel(0);
MXC_DMA_ReleaseChannel(1);

Expand Down
4 changes: 4 additions & 0 deletions Examples/MAX32690/SPI/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@
# For more information on how sing process works, see
# https://www.analog.com/en/education/education-library/videos/6313214207112.html
SBT=0


METHOD ?= MASTERSYNC
PROJ_CFLAGS += -D$(METHOD)
17 changes: 5 additions & 12 deletions Examples/MAX32690/SPI_v2/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,11 @@
#include "led.h"

/***** Preprocessors *****/
#define CONTROLLER_SYNC 1
#define CONTROLLER_ASYNC 0
#define CONTROLLER_DMA 0

// Preprocessor Error Checking
#if (!(CONTROLLER_SYNC || CONTROLLER_ASYNC || CONTROLLER_DMA))
#error "You must set either CONTROLLER_SYNC or CONTROLLER_ASYNC or CONTROLLER_DMA to 1."
#endif
#if ((CONTROLLER_SYNC && CONTROLLER_ASYNC) || (CONTROLLER_ASYNC && CONTROLLER_DMA) || \
(CONTROLLER_DMA && CONTROLLER_SYNC))
#error "You must select either CONTROLLER_SYNC or CONTROLLER_ASYNC or CONTROLLER_DMA, not all 3."
#endif
//#define CONTROLLER_SYNC
//#define CONTROLLER_ASYNC
//#define CONTROLLER_DMA
// define three METHOD above in project.mk
// CONTROLLER_SYNC is default

/***** Definitions *****/
#define DATA_LEN 100 // Words
Expand Down
4 changes: 4 additions & 0 deletions Examples/MAX32690/SPI_v2/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@

# Build SPI v2 library for example.
MXC_SPI_VERSION = v2


METHOD ?= CONTROLLER_SYNC
PROJ_CFLAGS += -D$(METHOD)
3 changes: 2 additions & 1 deletion Examples/MAX32690/UART/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
#include "nvic_table.h"

/***** Definitions *****/
// #define DMA
// to enable DMA, define in project.mk
// INTERRUPT is default in project.mk

#define UART_BAUD 115200
#define BUFF_SIZE 1024
Expand Down
4 changes: 4 additions & 0 deletions Examples/MAX32690/UART/project.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ SBT=0
ifeq ($(BOARD),FTHR)
$(error ERR_NOTSUPPORTED: This project is not supported for the FTHR board)
endif


METHOD ?= INTERRUPT
PROJ_CFLAGS += -D$(METHOD)
21 changes: 21 additions & 0 deletions Libraries/libs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ else
LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_a1_riscv.a
endif

#*********************************************************************

# for CHIP_REVISION b ***************************************************
else ifeq ($(CHIP_REVISION),b)


ifeq ($(RISCV_CORE),)

ifeq ($(MFLOAT_ABI),hard)
LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_hard.a
else
LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy.a
endif

else
LIBS += $(LIBS_DIR)/BlePhy/$(CHIP_UC)/libphy_riscv.a
endif
#**************************************************************************
endif


#*********************************************************************

# for CHIP_REVISION b ***************************************************
Expand Down

0 comments on commit f5641c7

Please sign in to comment.