Skip to content

Commit ac524b9

Browse files
committed
projects:max22007: Add example project for max22007
Add basic example project for MAX22007 Add make based CI build support Signed-off-by: Janani Sunil <janani.sunil@analog.com>
1 parent 360e7b4 commit ac524b9

File tree

11 files changed

+624
-0
lines changed

11 files changed

+624
-0
lines changed

projects/max22007/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
EXAMPLE ?= basic
2+
3+
HARDWARE ?= sdp-k1.ioc
4+
5+
include ../../tools/scripts/generic_variables.mk
6+
7+
include ../../tools/scripts/examples.mk
8+
9+
include src.mk
10+
11+
include ../../tools/scripts/generic.mk
12+

projects/max22007/builds.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"stm32": {
3+
"basic_example": {
4+
"flags" : "EXAMPLE=basic_example HARDWARE=sdp-k1.ioc"
5+
}
6+
}
7+
}

projects/max22007/sdp-k1.ioc

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#MicroXplorer Configuration settings - do not modify
2+
CAD.formats=
3+
CAD.pinconfig=
4+
CAD.provider=
5+
File.Version=6
6+
GPIO.groupedBy=Group By Peripherals
7+
KeepUserPlacement=false
8+
Mcu.CPN=STM32F469NIH6
9+
Mcu.Family=STM32F4
10+
Mcu.IP0=NVIC
11+
Mcu.IP1=RCC
12+
Mcu.IP2=SPI1
13+
Mcu.IP3=SYS
14+
Mcu.IP4=UART5
15+
Mcu.IPNb=5
16+
Mcu.Name=STM32F469NIHx
17+
Mcu.Package=TFBGA216
18+
Mcu.Pin0=PB4
19+
Mcu.Pin1=PB3
20+
Mcu.Pin2=PC12
21+
Mcu.Pin3=PA15
22+
Mcu.Pin4=PD2
23+
Mcu.Pin5=PH0/OSC_IN
24+
Mcu.Pin6=PH1/OSC_OUT
25+
Mcu.Pin7=PA7
26+
Mcu.Pin8=VP_SYS_VS_Systick
27+
Mcu.PinsNb=9
28+
Mcu.ThirdPartyNb=0
29+
Mcu.UserConstants=
30+
Mcu.UserName=STM32F469NIHx
31+
MxCube.Version=6.5.0
32+
MxDb.Version=DB.6.0.50
33+
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
34+
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
35+
NVIC.ForceEnableDMAVector=false
36+
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
37+
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
38+
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
39+
NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
40+
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
41+
NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
42+
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true\:false
43+
NVIC.UART5_IRQn=true\:0\:0\:false\:false\:true\:true\:true\:false
44+
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
45+
PA15.GPIOParameters=GPIO_PuPd
46+
PA15.GPIO_PuPd=GPIO_PULLDOWN
47+
PA15.Locked=true
48+
PA15.Signal=GPIO_Output
49+
PA7.GPIOParameters=GPIO_PuPd
50+
PA7.GPIO_PuPd=GPIO_PULLUP
51+
PA7.Locked=true
52+
PA7.Mode=Full_Duplex_Master
53+
PA7.Signal=SPI1_MOSI
54+
PB3.GPIOParameters=GPIO_PuPd
55+
PB3.GPIO_PuPd=GPIO_PULLUP
56+
PB3.Locked=true
57+
PB3.Mode=Full_Duplex_Master
58+
PB3.Signal=SPI1_SCK
59+
PB4.GPIOParameters=GPIO_PuPd
60+
PB4.GPIO_PuPd=GPIO_PULLUP
61+
PB4.Locked=true
62+
PB4.Mode=Full_Duplex_Master
63+
PB4.Signal=SPI1_MISO
64+
PC12.Mode=Asynchronous
65+
PC12.Signal=UART5_TX
66+
PD2.Mode=Asynchronous
67+
PD2.Signal=UART5_RX
68+
PH0/OSC_IN.Mode=HSE-External-Oscillator
69+
PH0/OSC_IN.Signal=RCC_OSC_IN
70+
PH1/OSC_OUT.Mode=HSE-External-Oscillator
71+
PH1/OSC_OUT.Signal=RCC_OSC_OUT
72+
PinOutPanel.CurrentBGAView=Top
73+
PinOutPanel.RotationAngle=0
74+
ProjectManager.AskForMigrate=true
75+
ProjectManager.BackupPrevious=false
76+
ProjectManager.CompilerLinker=GCC
77+
ProjectManager.CompilerOptimize=6
78+
ProjectManager.ComputerToolchain=false
79+
ProjectManager.CoupleFile=false
80+
ProjectManager.CustomerFirmwarePackage=
81+
ProjectManager.DefaultFWLocation=true
82+
ProjectManager.DeletePrevious=true
83+
ProjectManager.DeviceId=STM32F469NIHx
84+
ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.28.1
85+
ProjectManager.FreePins=false
86+
ProjectManager.HalAssertFull=false
87+
ProjectManager.HeapSize=0x200
88+
ProjectManager.KeepUserCode=false
89+
ProjectManager.LastFirmware=false
90+
ProjectManager.LibraryCopy=1
91+
ProjectManager.MainLocation=Core/Src
92+
ProjectManager.NoMain=false
93+
ProjectManager.PreviousToolchain=STM32CubeIDE
94+
ProjectManager.ProjectBuild=false
95+
ProjectManager.ProjectFileName=sdp-k1.ioc
96+
ProjectManager.ProjectName=sdp-k1
97+
ProjectManager.ProjectStructure=
98+
ProjectManager.RegisterCallBack=I2C,SDRAM,SPI,TIM,UART
99+
ProjectManager.StackSize=0x400
100+
ProjectManager.TargetToolchain=STM32CubeIDE
101+
ProjectManager.ToolChainLocation=
102+
ProjectManager.UAScriptAfterPath=
103+
ProjectManager.UAScriptBeforePath=
104+
ProjectManager.UnderRoot=true
105+
ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-false,2-SystemClock_Config-RCC-false-HAL-false,3-MX_UART5_Init-UART5-false-HAL-false,4-MX_SPI1_Init-SPI1-false-HAL-false
106+
RCC.AHBFreq_Value=180000000
107+
RCC.APB1CLKDivider=RCC_HCLK_DIV4
108+
RCC.APB1Freq_Value=45000000
109+
RCC.APB1TimFreq_Value=90000000
110+
RCC.APB2CLKDivider=RCC_HCLK_DIV2
111+
RCC.APB2Freq_Value=90000000
112+
RCC.APB2TimFreq_Value=180000000
113+
RCC.CortexFreq_Value=180000000
114+
RCC.DSIFreq_Value=20000000
115+
RCC.DSITXEscFreq_Value=5000000
116+
RCC.EthernetFreq_Value=180000000
117+
RCC.FCLKCortexFreq_Value=180000000
118+
RCC.FamilyName=M
119+
RCC.HCLKFreq_Value=180000000
120+
RCC.HSE_VALUE=8000000
121+
RCC.I2SFreq_Value=192000000
122+
RCC.IPParameters=AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CortexFreq_Value,DSIFreq_Value,DSITXEscFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,I2SFreq_Value,LCDTFTFreq_Value,MCO2PinFreq_Value,PLLCLKFreq_Value,PLLDSIFreq_Value,PLLDSIVCOFreq_Value,PLLI2SQCLKFreq_Value,PLLI2SRCLKFreq_Value,PLLM,PLLN,PLLQCLKFreq_Value,PLLRCLKFreq_Value,PLLRFreq_Value,PLLSAIPCLKFreq_Value,PLLSAIQCLKFreq_Value,PLLSAIRCLKFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAIAFreq_Value,SAIBFreq_Value,SDIOFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,USBFreq_Value,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value
123+
RCC.LCDTFTFreq_Value=96000000
124+
RCC.MCO2PinFreq_Value=180000000
125+
RCC.PLLCLKFreq_Value=180000000
126+
RCC.PLLDSIFreq_Value=160000000
127+
RCC.PLLDSIVCOFreq_Value=320000000
128+
RCC.PLLI2SQCLKFreq_Value=96000000
129+
RCC.PLLI2SRCLKFreq_Value=192000000
130+
RCC.PLLM=8
131+
RCC.PLLN=180
132+
RCC.PLLQCLKFreq_Value=90000000
133+
RCC.PLLRCLKFreq_Value=180000000
134+
RCC.PLLRFreq_Value=180000000
135+
RCC.PLLSAIPCLKFreq_Value=192000000
136+
RCC.PLLSAIQCLKFreq_Value=96000000
137+
RCC.PLLSAIRCLKFreq_Value=192000000
138+
RCC.RTCFreq_Value=32000
139+
RCC.RTCHSEDivFreq_Value=4000000
140+
RCC.SAIAFreq_Value=96000000
141+
RCC.SAIBFreq_Value=96000000
142+
RCC.SDIOFreq_Value=90000000
143+
RCC.SYSCLKFreq_VALUE=180000000
144+
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
145+
RCC.USBFreq_Value=90000000
146+
RCC.VCOI2SOutputFreq_Value=384000000
147+
RCC.VCOInputFreq_Value=2000000
148+
RCC.VCOOutputFreq_Value=360000000
149+
RCC.VCOSAIOutputFreq_Value=384000000
150+
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
151+
SPI1.CalculateBaudRate=45.0 MBits/s
152+
SPI1.DataSize=SPI_DATASIZE_8BIT
153+
SPI1.Direction=SPI_DIRECTION_2LINES
154+
SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,BaudRatePrescaler
155+
SPI1.Mode=SPI_MODE_MASTER
156+
SPI1.VirtualType=VM_MASTER
157+
UART5.BaudRate=230400
158+
UART5.IPParameters=VirtualMode,BaudRate
159+
UART5.VirtualMode=Asynchronous
160+
VP_SYS_VS_Systick.Mode=SysTick
161+
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
162+
board=custom

projects/max22007/src.mk

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
SRCS += $(DRIVERS)/api/no_os_gpio.c \
2+
$(DRIVERS)/api/no_os_spi.c \
3+
$(DRIVERS)/api/no_os_uart.c \
4+
$(DRIVERS)/api/no_os_dma.c \
5+
$(DRIVERS)/api/no_os_irq.c \
6+
$(NO-OS)/util/no_os_list.c \
7+
$(NO-OS)/util/no_os_util.c \
8+
$(NO-OS)/util/no_os_alloc.c \
9+
$(NO-OS)/util/no_os_lf256fifo.c \
10+
$(NO-OS)/util/no_os_mutex.c \
11+
$(NO-OS)/util/no_os_crc8.c \
12+
13+
INCS += $(INCLUDE)/no_os_delay.h \
14+
$(INCLUDE)/no_os_error.h \
15+
$(INCLUDE)/no_os_gpio.h \
16+
$(INCLUDE)/no_os_spi.h \
17+
$(INCLUDE)/no_os_print_log.h \
18+
$(INCLUDE)/no_os_list.h \
19+
$(INCLUDE)/no_os_uart.h \
20+
$(INCLUDE)/no_os_util.h \
21+
$(INCLUDE)/no_os_alloc.h \
22+
$(INCLUDE)/no_os_lf256fifo.h \
23+
$(INCLUDE)/no_os_mutex.h \
24+
$(INCLUDE)/no_os_dma.h \
25+
$(INCLUDE)/no_os_irq.h \
26+
$(INCLUDE)/no_os_crc8.h \
27+
28+
SRCS += $(DRIVERS)/dac/max22007/max22007.c
29+
INCS += $(DRIVERS)/dac/max22007/max22007.h
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/***************************************************************************//**
2+
* @file common_data.c
3+
* @brief Defines common data to be used by MAX22007 example.
4+
* @author Janani Sunil (janani.sunil@analog.com)
5+
********************************************************************************
6+
* Copyright 2025(c) Analog Devices, Inc.
7+
*
8+
* All rights reserved.
9+
*
10+
* Redistribution and use in source and binary forms, with or without
11+
* modification, are permitted provided that the following conditions are met:
12+
* - Redistributions of source code must retain the above copyright
13+
* notice, this list of conditions and the following disclaimer.
14+
* - Redistributions in binary form must reproduce the above copyright
15+
* notice, this list of conditions and the following disclaimer in
16+
* the documentation and/or other materials provided with the
17+
* distribution.
18+
* - Neither the name of Analog Devices, Inc. nor the names of its
19+
* contributors may be used to endorse or promote products derived
20+
* from this software without specific prior written permission.
21+
* - The use of this software may or may not infringe the patent rights
22+
* of one or more patent holders. This license does not release you
23+
* from the requirement that you obtain separate licenses from these
24+
* patent holders to use this software.
25+
* - Use of the software either in source or binary form, must be run
26+
* on or directly connected to an Analog Devices Inc. component.
27+
*
28+
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
29+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
30+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31+
* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
32+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33+
* LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
34+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38+
*******************************************************************************/
39+
40+
#include "common_data.h"
41+
#include "max22007.h"
42+
43+
struct no_os_uart_init_param max22007_uart_ip = {
44+
.device_id = UART_DEVICE_ID,
45+
.irq_id = UART_IRQ_ID,
46+
.asynchronous_rx = true,
47+
.baud_rate = UART_BAUDRATE,
48+
.size = NO_OS_UART_CS_8,
49+
.parity = NO_OS_UART_PAR_NO,
50+
.stop = NO_OS_UART_STOP_1_BIT,
51+
.extra = &max22007_uart_extra_ip,
52+
.platform_ops = &uart_platform_ops,
53+
};
54+
55+
struct no_os_spi_init_param max22007_spi_init = {
56+
.device_id = SPI_DEVICE_ID,
57+
.max_speed_hz = 5000000,
58+
.mode = NO_OS_SPI_MODE_0,
59+
.chip_select = GPIO_CS_PIN,
60+
.bit_order = NO_OS_SPI_BIT_ORDER_MSB_FIRST,
61+
.platform_ops = &spi_platform_ops,
62+
.extra = &max22007_spi_extra_ip
63+
};
64+
65+
struct max22007_init_param max22007_ip = {
66+
.comm_param = &max22007_spi_init,
67+
.crc_en = false,
68+
.ref_mode = INTERNAL_REF,
69+
.timeout_config = {
70+
.timeout_en = false,
71+
.timeout_sel = MAX22007_TIMEOUT_100MS,
72+
.timeout_cnfg = TIMEOUT_RESET,
73+
},
74+
.channel_config = {
75+
[0] = {
76+
.channel_mode = MAX22007_VOLTAGE_MODE,
77+
.latch_mode = TRANSPARENT_LATCH,
78+
.channel_power = MAX22007_CH_POWER_ON,
79+
},
80+
[1] = {
81+
.channel_mode = MAX22007_VOLTAGE_MODE,
82+
.latch_mode = LDAC_CONTROL,
83+
.channel_power = MAX22007_CH_POWER_OFF,
84+
},
85+
[2] = {
86+
.channel_mode = MAX22007_VOLTAGE_MODE,
87+
.latch_mode = LDAC_CONTROL,
88+
.channel_power = MAX22007_CH_POWER_OFF,
89+
},
90+
[3] = {
91+
.channel_mode = MAX22007_VOLTAGE_MODE,
92+
.latch_mode = LDAC_CONTROL,
93+
.channel_power = MAX22007_CH_POWER_ON,
94+
},
95+
}
96+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/***************************************************************************//**
2+
* @file max22007/src/common/common_data.h
3+
* @brief Defines common data to be used by max22007 examples.
4+
* @author Janani Sunil (janani.sunil@analog.com)
5+
********************************************************************************
6+
* Copyright 2025(c) Analog Devices, Inc.
7+
*
8+
* All rights reserved.
9+
*
10+
* Redistribution and use in source and binary forms, with or without
11+
* modification, are permitted provided that the following conditions are met:
12+
* - Redistributions of source code must retain the above copyright
13+
* notice, this list of conditions and the following disclaimer.
14+
* - Redistributions in binary form must reproduce the above copyright
15+
* notice, this list of conditions and the following disclaimer in
16+
* the documentation and/or other materials provided with the
17+
* distribution.
18+
* - Neither the name of Analog Devices, Inc. nor the names of its
19+
* contributors may be used to endorse or promote products derived
20+
* from this software without specific prior written permission.
21+
* - The use of this software may or may not infringe the patent rights
22+
* of one or more patent holders. This license does not release you
23+
* from the requirement that you obtain separate licenses from these
24+
* patent holders to use this software.
25+
* - Use of the software either in source or binary form, must be run
26+
* on or directly connected to an Analog Devices Inc. component.
27+
*
28+
* THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
29+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
30+
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31+
* IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
32+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33+
* LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
34+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38+
*******************************************************************************/
39+
#ifndef __COMMON_DATA_H__
40+
#define __COMMON_DATA_H__
41+
42+
#include "parameters.h"
43+
#include "max22007.h"
44+
45+
extern struct no_os_uart_init_param max22007_uart_ip;
46+
extern struct max22007_init_param max22007_ip;
47+
48+
#endif /* __COMMON_DATA_H__ */

0 commit comments

Comments
 (0)