Skip to content

Refactor max32630fthr port example build #673

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
5798d8e
Add btstack_sbc_bluedroid.c, device_id_server.o to sources
head5man Apr 6, 2025
e081e73
Remove unecessary duplication of flags
head5man Apr 6, 2025
b29640c
Remove extra '/' from LIBS_DIR
head5man Apr 6, 2025
7c32a64
Unify path names
head5man Apr 6, 2025
2f257ad
Use I2C module number as _I2CM_INST
head5man Apr 6, 2025
8638fb5
Remove the cc256x init script fetching from create_examples.py
head5man Apr 6, 2025
6cc427c
Define cc256x_init_script for chipset/cc256x/Makefile.inc
head5man Apr 6, 2025
8087b3e
Fine tune the cc256B init script make
head5man Apr 6, 2025
ceb447b
Ignore generated files in the example folder
head5man Apr 6, 2025
90f57a1
Refactor make targets and dependencies
head5man Apr 7, 2025
c4a7c58
Rename makefiles to reflect purpose
head5man Apr 7, 2025
b664903
Silence some print commands and fix contents
head5man Apr 7, 2025
f58975b
Rename CC256X_INIT to ENABLE_HCI_INIT
head5man Apr 7, 2025
16f1e67
Cleanup indents and multiline trailing spaces
head5man Apr 7, 2025
64fdc2c
Remove example/bin directory when deleting examples
head5man Apr 7, 2025
c95ba9f
Prepare to reuse template functionality from arbitrary location
head5man Apr 8, 2025
f3556b6
Improve script output and fix empty basename when trailing '/'
head5man Apr 8, 2025
462fd8b
Copy board files from maxim sdk
head5man Apr 11, 2025
ec69dab
Implement board.mk for max32630-fthr by adapting EvKit_V1
head5man Apr 11, 2025
d384d76
Use board.mk in ProjectTemplate.mk
head5man Apr 11, 2025
26c694c
Add support for importing project make script
head5man Apr 11, 2025
a71bd47
Cleanup failing projects `examples/make (all)`
head5man Apr 12, 2025
49636d9
Verify building with Maxim SDK in Windows
head5man Apr 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ build-coverage
.vs
.vscode
ninja
**/__pycache__
2 changes: 2 additions & 0 deletions port/max32630-fthr/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ tags
*.txt
*.log
core
example/*/*
!example/template/*
5 changes: 2 additions & 3 deletions port/max32630-fthr/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ examples:

clean:
scripts/delete_examples.py
@rm -rf example/Makefile
@echo "Deleting CC2564B Init Script in src folder"
@rm -rf src/cc256x* bluetooth_init*
@rm -f example/Makefile
@rm -fR example/bin
121 changes: 121 additions & 0 deletions port/max32630-fthr/board/Include/led.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@

/**
* @file
* @brief LED driver API.
*/
/* ****************************************************************************
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
* $Date: 2017-02-28 17:26:15 -0600 (Tue, 28 Feb 2017) $
* $Revision: 26771 $
*
*************************************************************************** */

#ifndef _LED_H_
#define _LED_H_

#include "mxc_assert.h"
#include "board.h"
#include "gpio.h"

#ifdef __cplusplus
extern "C" {
#endif
/**
* @ingroup bsp
* @defgroup led_bsp LED Board Support API.
* @{
*/
/* **** Definitions **** */
#ifndef LED_OFF
#define LED_OFF 1 /**< Define to turn off the LED. */
#endif

#ifndef LED_ON
#define LED_ON 0 /**< Define to turn on the LED. */
#endif

/* **** Global Variables **** */
extern const gpio_cfg_t led_pin[];
extern const unsigned int num_leds;

/* **** Function Prototypes **** */

/**
* @brief Initialize all LED pins.
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int LED_Init(void);

/**
* @brief Turn the specified LED on.
* @param idx LED index
*/
__STATIC_INLINE void LED_On(unsigned int idx)
{
MXC_ASSERT(idx < num_leds);
#if (LED_ON == 0)
GPIO_OutClr(&led_pin[idx]);
#else
GPIO_OutSet(&led_pin[idx]);
#endif
}

/**
* @brief Turn the specified LED off.
* @param idx LED index
*/
__STATIC_INLINE void LED_Off(unsigned int idx)
{
MXC_ASSERT(idx < num_leds);
#if (LED_ON == 0)
GPIO_OutSet(&led_pin[idx]);
#else
GPIO_OutClr(&led_pin[idx]);
#endif
}

/**
* @brief Toggle the state of the specified LED.
* @param idx LED index
*/
__STATIC_INLINE void LED_Toggle(unsigned int idx)
{
MXC_ASSERT(idx < num_leds);
GPIO_OutToggle(&led_pin[idx]);
}

#ifdef __cplusplus
}
#endif
/**@}*/
#endif /* _LED_H_ */
230 changes: 230 additions & 0 deletions port/max32630-fthr/board/Include/max14690.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,230 @@
/**
* @file
* @brief MAX14690 PMIC driver API.
*/
/* ****************************************************************************
* Copyright (C) 2016 Maxim Integrated Products, Inc., All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of Maxim Integrated
* Products, Inc. shall not be used except as stated in the Maxim Integrated
* Products, Inc. Branding Policy.
*
* The mere transfer of this software does not imply any licenses
* of trade secrets, proprietary technology, copyrights, patents,
* trademarks, maskwork rights, or any other form of intellectual
* property whatsoever. Maxim Integrated Products, Inc. retains all
* ownership rights.
*
* $Date: 2016-10-07 15:24:25 -0500 (Fri, 07 Oct 2016) $
* $Revision: 24635 $
*
*************************************************************************** */

#ifndef _MAX14690_H_
#define _MAX14690_H_

#ifdef __cplusplus
extern "C" {
#endif
/**
* @ingroup bsp
* @defgroup max14690_bsp MAX14690 Board Support API.
* @{
*/
/* **** Definitions **** */

/**
* Enumeration type that defines the location of the register addresses for the MAX14690.
*/
typedef enum {
MAX14690_REG_CHIP_ID, /**< CHIP_ID Register */
MAX14690_REG_CHIP_REV, /**< CHIP_REV Register */
MAX14690_REG_STATUS_A, /**< STATUS_A Register */
MAX14690_REG_STATUS_B, /**< STATUS_B Register */
MAX14690_REG_STATUS_C, /**< STATUS_C Register */
MAX14690_REG_INT_A, /**< INT_A Register */
MAX14690_REG_INT_B, /**< INT_B Register */
MAX14690_REG_INT_MASK_A, /**< INT_MASK_A Register */
MAX14690_REG_INT_MASK_B, /**< INT_MASK_B Register */
MAX14690_REG_ILIM_CNTL, /**< ILIM_CNTL Register */
MAX14690_REG_CHG_CNTL_A, /**< CHG_CNTL_A Register */
MAX14690_REG_CHG_CNTL_B, /**< CHG_CNTL_B Register */
MAX14690_REG_CHG_TMR, /**< CHG_TMR Register */
MAX14690_REG_BUCK1_CFG, /**< BUCK1_CFG Register */
MAX14690_REG_BUCK1_VSET, /**< BUCK1_VSET Register */
MAX14690_REG_BUCK2_CFG, /**< BUCK2_CFG Register */
MAX14690_REG_BUCK2_VSET, /**< BUCK2_VSET Register */
MAX14690_REG_RSVD_11, /**< RSVD_11 Register */
MAX14690_REG_LDO1_CFG, /**< LDO1_CFG Register */
MAX14690_REG_LDO1_VSET, /**< LDO1_VSET Register */
MAX14690_REG_LDO2_CFG, /**< LDO2_CFG Register */
MAX14690_REG_LDO2_VSET, /**< LDO2_VSET Register */
MAX14690_REG_LDO3_CFG, /**< LDO3_CFG Register */
MAX14690_REG_LDO3_VSET, /**< LDO3_VSET Register */
MAX14690_REG_THRM_CFG, /**< THRM_CFG Register */
MAX14690_REG_MON_CFG, /**< MON_CFG Register */
MAX14690_REG_BOOT_CFG, /**< BOOT_CFG Register */
MAX14690_REG_PIN_STAT, /**< PIN_STAT Register */
MAX14690_REG_BUCK_EXTRA, /**< BUCK_EXTRA Register */
MAX14690_REG_PWR_CFG, /**< PWR_CFG Register */
MAX14690_REG_RSVD_1E, /**< RSVD_1E Register */
MAX14690_REG_PWR_OFF, /**< PWR_OFF Register */
} max14690_reg_map_t;

/**
* Enumeration type for setting the LDO mode on the MAX14690.
*/
typedef enum {
MAX14690_LDO_DISABLED, /**< LDO mode, disabled, no active discharge. */
MAX14690_SW_DISABLED, /**< Switch mode, disabled, no active discharge. */
MAX14690_LDO_ENABLED, /**< LDO mode, enabled, no active discharge. */
MAX14690_SW_ENABLED, /**< Switch mode, enabled, no active discharge. */
MAX14690_LDO_MPC0, /**< LDO mode, MPC0 enabled, no active discharge. */
MAX14690_SW_MPC0, /**< Switch mode, MPC0 enabled, no active discharge. */
MAX14690_LDO_MPC1, /**< LDO mode, MPC1 enabled, no active discharge. */
MAX14690_SW_MPC1, /**< Switch mode, MPC1 enabled, no active discharge. */
MAX14690_LDO_DISABLED_ACT_DIS, /**< LDO mode, disabled, active discharge . */
MAX14690_SW_DISABLED_ACT_DIS, /**< Switch mode, disabled, active discharge. */
MAX14690_LDO_ENABLED_ACT_DIS, /**< LDO mode, enabled, active discharge. */
MAX14690_SW_ENABLED_ACT_DIS, /**< Switch mode, enabled, active discharge. */
MAX14690_LDO_MPC0_ACT_DIS, /**< LDO mode, MPC0 enabled, active discharge. */
MAX14690_SW_MPC0_ACT_DIS, /**< Switch mode, MPC0 enabled, active discharge. */
MAX14690_LDO_MPC1_ACT_DIS, /**< LDO mode, MPC1 enabled, active discharge. */
MAX14690_SW_MPC1_ACT_DIS, /**< Switch mode, MPC1 enabled, active discharge. */
} max14690_ldo_mode_t;

/**
* Enumeration type to select the multiplexer channel behavior.
*/

typedef enum {
MAX14690_MUX_SEL_PULLDOWN, /**< Mux disabled with pulldown. */
MAX14690_MUX_SEL_BAT, /**< Mux select BAT. */
MAX14690_MUX_SEL_SYS, /**< Mux select SYS. */
MAX14690_MUX_SEL_BUCK1, /**< Mux select BUCK1. */
MAX14690_MUX_SEL_BUCK2, /**< Mux select BUCK2. */
MAX14690_MUX_SEL_LDO1, /**< Mux select LDO1. */
MAX14690_MUX_SEL_LDO2, /**< Mux select LDO2. */
MAX14690_MUX_SEL_LDO3, /**< Mux select LDO3. */
MAX14690_MUX_SEL_HIZ, /**< Mux disabled, high impedance. */
} max14690_mux_ch_t;

/**
* Enumeration type to set the multiplexer voltage divider.
*/
typedef enum {
MAX14690_MUX_DIV_4, /**< Mux divides voltage by 4. */
MAX14690_MUX_DIV_3, /**< Mux divides voltage by 3. */
MAX14690_MUX_DIV_2, /**< Mux divides voltage by 2. */
MAX14690_MUX_DIV_1, /**< Mux divides voltage by 1. */
} max14690_mux_div_t;

/**
* Structure type to configure the LDOs on the MAX14690.
*/
typedef struct {
max14690_ldo_mode_t ldo2mode; /**< LDO2 configuration mode. */
uint32_t ldo2mv; /**< LDO2 voltage in mV. */
max14690_ldo_mode_t ldo3mode; /**< LDO3 configuration mode. */
uint32_t ldo3mv; /**< LDO3 voltage in mV. */
} max14690_cfg_t;

/* **** Function Prototypes **** */

/**
* @brief Initialize the MAX14690.
* @param max14690cfg Pointer to a structure containing LDO configuration
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_Init(const max14690_cfg_t *max14690cfg);

/**
* @brief Initialize the MAX14690 interrupt.
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_InterruptInit(void);

/**
* @brief Set LDO2 mode.
* @param mode sets the operating mode for LDO2.
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_LDO2SetMode(max14690_ldo_mode_t mode);

/**
* @brief Set LDO2 voltage.
* @param millivolts sets the operating voltage for LDO2 (in mV).
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_LDO2SetV(uint32_t millivolts);

/**
* @brief Set LDO3 mode.
* @param mode sets the operating mode for LDO3.
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_LDO3SetMode(max14690_ldo_mode_t mode);

/**
* @brief Set LDO3 voltage.
* @param millivolts sets the operating voltage for LDO3 (in mV).
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_LDO3SetV(uint32_t millivolts);

/**
* @brief Set Multiplexer.
* @param ch sets the channel for the muliplexer.
* @param div sets the divider value for the multiplexer.
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_MuxSet(max14690_mux_ch_t ch, max14690_mux_div_t div);

/**
* @brief Enables LDO2.
* @deprecated Use MAX14690_LDO2SetMode(max14690_ldo_mode_t mode)
* @param enable 1 to enable, 0 to disable LDO2.
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_EnableLDO2(uint8_t enable);

/*
* @brief Enables LDO3.
* @deprecated Use MAX14690_LDO3SetMode(max14690_ldo_mode_t mode)
* @param enable 1 to enable, 0 to disable LDO3.
* @retval #E_NO_ERROR Push buttons intialized successfully.
* @retval "Error Code" @ref MXC_Error_Codes "Error Code" if unsuccessful.
*/
int MAX14690_EnableLDO3(uint8_t enable);
/**@}*/
#ifdef __cplusplus
}
#endif

#endif /* _MAX14690_H_ */
Loading