Skip to content

Commit 07b9326

Browse files
committed
projects: max17616: Add project for max17616
Add project files for both basic and IIO examples for max17616. Signed-off-by: Carlos Jones <[email protected]>
1 parent b73463a commit 07b9326

File tree

14 files changed

+935
-0
lines changed

14 files changed

+935
-0
lines changed

projects/max17616/Makefile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Select the example you want to enable by choosing y for enabling and n for disabling
2+
BASIC_EXAMPLE = n
3+
IIO_EXAMPLE = y
4+
5+
include ../../tools/scripts/generic_variables.mk
6+
7+
include src.mk
8+
9+
include ../../tools/scripts/generic.mk

projects/max17616/builds.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"maxim": {
3+
"basic_example_max32666": {
4+
"flags" : "BASIC_EXAMPLE=y IIO_EXAMPLE=n TARGET=max32665"
5+
},
6+
"iio_example_max32666": {
7+
"flags" : "BASIC_EXAMPLE=n IIO_EXAMPLE=y TARGET=max32665"
8+
}
9+
}
10+
}

projects/max17616/src.mk

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
include $(PROJECT)/src/platform/$(PLATFORM)/platform_src.mk
2+
include $(PROJECT)/src/examples/examples_src.mk
3+
4+
SRCS += $(PROJECT)/src/platform/$(PLATFORM)/main.c
5+
6+
INCS += $(PROJECT)/src/common/common_data.h
7+
SRCS += $(PROJECT)/src/common/common_data.c
8+
9+
INCS += $(PROJECT)/src/platform/$(PLATFORM)/parameters.h
10+
SRCS += $(PROJECT)/src/platform/$(PLATFORM)/parameters.c
11+
12+
INCS += $(INCLUDE)/no_os_delay.h \
13+
$(INCLUDE)/no_os_error.h \
14+
$(INCLUDE)/no_os_list.h \
15+
$(INCLUDE)/no_os_gpio.h \
16+
$(INCLUDE)/no_os_dma.h \
17+
$(INCLUDE)/no_os_print_log.h \
18+
$(INCLUDE)/no_os_i2c.h \
19+
$(INCLUDE)/no_os_irq.h \
20+
$(INCLUDE)/no_os_pwm.h \
21+
$(INCLUDE)/no_os_rtc.h \
22+
$(INCLUDE)/no_os_uart.h \
23+
$(INCLUDE)/no_os_lf256fifo.h \
24+
$(INCLUDE)/no_os_util.h \
25+
$(INCLUDE)/no_os_units.h \
26+
$(INCLUDE)/no_os_alloc.h \
27+
$(INCLUDE)/no_os_mutex.h \
28+
$(INCLUDE)/no_os_crc8.h
29+
30+
SRCS += $(NO-OS)/util/no_os_lf256fifo.c \
31+
$(DRIVERS)/api/no_os_i2c.c \
32+
$(DRIVERS)/api/no_os_dma.c \
33+
$(DRIVERS)/api/no_os_uart.c \
34+
$(DRIVERS)/api/no_os_irq.c \
35+
$(DRIVERS)/api/no_os_gpio.c \
36+
$(DRIVERS)/api/no_os_pwm.c \
37+
$(NO-OS)/util/no_os_util.c \
38+
$(NO-OS)/util/no_os_list.c \
39+
$(NO-OS)/util/no_os_alloc.c \
40+
$(NO-OS)/util/no_os_mutex.c \
41+
$(NO-OS)/util/no_os_crc8.c
42+
43+
INCS += $(DRIVERS)/power/max17616/max17616.h
44+
SRCS += $(DRIVERS)/power/max17616/max17616.c
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/***************************************************************************//**
2+
* @file common_data.c
3+
* @brief Defines common data to be used by max17616 examples.
4+
* @author Carlos Jones ([email protected])
5+
********************************************************************************
6+
* Copyright 2025(c) Analog Devices, Inc.
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions are met:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimer.
13+
*
14+
* 2. Redistributions in binary form must reproduce the above copyright notice,
15+
* this list of conditions and the following disclaimer in the documentation
16+
* and/or other materials provided with the distribution.
17+
*
18+
* 3. Neither the name of Analog Devices, Inc. nor the names of its
19+
* contributors may be used to endorse or promote products derived from this
20+
* software without specific prior written permission.
21+
*
22+
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR
23+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
25+
* EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
26+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28+
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
*******************************************************************************/
33+
#include "common_data.h"
34+
35+
struct no_os_uart_init_param uart_ip = {
36+
.device_id = UART_DEVICE_ID,
37+
.asynchronous_rx = UART_ASYNC_RX,
38+
.baud_rate = UART_BAUDRATE,
39+
.size = UART_SIZE,
40+
.parity = UART_PARITY,
41+
.stop = UART_STOP,
42+
.extra = UART_EXTRA,
43+
.platform_ops = UART_OPS,
44+
};
45+
46+
struct no_os_i2c_init_param i2c_ip = {
47+
.device_id = I2C_DEVICE_ID,
48+
.max_speed_hz = I2C_CLK_SPEED,
49+
.slave_address = I2C_ADDR,
50+
.platform_ops = I2C_OPS,
51+
.extra = I2C_EXTRA
52+
};
53+
54+
struct max17616_init_param max17616_ip = {
55+
.i2c_init = &i2c_ip,
56+
.chip_id = ID_MAX17616,
57+
};
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/***************************************************************************//**
2+
* @file common_data.h
3+
* @brief Defines common data to be used by max17616 examples.
4+
* @author Carlos Jones ([email protected])
5+
********************************************************************************
6+
* Copyright 2025(c) Analog Devices, Inc.
7+
*
8+
* Redistribution and use in source and binary forms, with or without
9+
* modification, are permitted provided that the following conditions are met:
10+
*
11+
* 1. Redistributions of source code must retain the above copyright notice,
12+
* this list of conditions and the following disclaimer.
13+
*
14+
* 2. Redistributions in binary form must reproduce the above copyright notice,
15+
* this list of conditions and the following disclaimer in the documentation
16+
* and/or other materials provided with the distribution.
17+
*
18+
* 3. Neither the name of Analog Devices, Inc. nor the names of its
19+
* contributors may be used to endorse or promote products derived from this
20+
* software without specific prior written permission.
21+
*
22+
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR
23+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
25+
* EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
26+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27+
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28+
* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29+
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30+
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31+
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
*******************************************************************************/
33+
#ifndef __COMMON_DATA_H__
34+
#define __COMMON_DATA_H__
35+
36+
#include "no_os_uart.h"
37+
#include "no_os_i2c.h"
38+
#include "max17616.h"
39+
#include "parameters.h"
40+
41+
extern struct no_os_uart_init_param uart_ip;
42+
extern struct no_os_i2c_init_param i2c_ip;
43+
extern struct max17616_init_param max17616_ip;
44+
45+
#endif /* __COMMON_DATA_H__ */

0 commit comments

Comments
 (0)