Skip to content

Commit 5eb66f6

Browse files
committed
EVAL_POWRMS: IIO and screen for rev-B:
- drivers: maxim_delay.c: include lvgl comulsory callback function - add button implementation for BACk, NEXT and ENTER - added blank screen upon en_latch off - buttons implemented - print out real-time VIN0 and VIN1 from adc - custom initializaiton process - added tinyIIOD for vin0 vin1, vrmsf, vrmsr channels, with global attrbutes for impedance and frequency - modified general screen llgic to work in parallel with iiod - added m24512 memory init and test - TODO: add lookup table and use that to calc P0 and P1 Signed-off-by: rbudai98 <robert.budai@analog.com>
1 parent 3b1bdbd commit 5eb66f6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+5953
-2
lines changed

drivers/adc/ad7091r5/ad7091r5.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int32_t ad7091r5_i2c_reg_read(struct ad7091r5_dev *dev,
5757
if (!dev || !reg_data)
5858
return -EINVAL;
5959

60-
ret = no_os_i2c_write(dev->i2c_desc, &reg_addr, 1, 1);
60+
ret = no_os_i2c_write(dev->i2c_desc, &reg_addr, 1, 0);
6161
if (ret < 0)
6262
return ret;
6363

@@ -144,6 +144,9 @@ int32_t ad7091r5_i2c_write_mask(struct ad7091r5_dev *dev,
144144
reg_data &= ~mask;
145145
reg_data |= data;
146146

147+
// printf("I2C read succesfully\n\r");
148+
no_os_udelay(100);
149+
147150
return ad7091r5_i2c_reg_write(dev, reg_addr, reg_data);
148151
}
149152

@@ -444,7 +447,7 @@ int32_t ad7091r5_reset(struct ad7091r5_dev *dev, bool is_software)
444447
return ret;
445448

446449
/* reset pulse width, at least 10 ns*/
447-
no_os_udelay(1);
450+
no_os_udelay(100);
448451
return no_os_gpio_set_value(dev->gpio_resetn, NO_OS_GPIO_HIGH);
449452
}
450453
}
@@ -499,10 +502,16 @@ int32_t ad7091r5_read_one(struct ad7091r5_dev *dev,
499502
if (ret)
500503
return ret;
501504

505+
printf("Channel set successfully\n\r");
506+
no_os_udelay(100);
507+
502508
ret = ad7091r5_i2c_reg_read(dev, AD7091R5_REG_RESULT, &val);
503509
if (ret)
504510
return ret;
505511

512+
printf("val: %d, REG_RESULT_CH_ID(val): %d, channel: %d\n\r", val,
513+
REG_RESULT_CH_ID(val), channel);
514+
506515
if (REG_RESULT_CH_ID(val) != channel)
507516
return -1;
508517

drivers/platform/maxim/max32662/maxim_delay.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "no_os_util.h"
3535
#include "mxc_delay.h"
3636
#include "mxc_sys.h"
37+
#include "lvgl.h"
3738

3839
static volatile unsigned long long _system_ticks = 0;
3940

@@ -43,6 +44,7 @@ extern void SysTick_Handler(void);
4344
void SysTick_Handler(void)
4445
{
4546
MXC_DelayHandler();
47+
lv_tick_inc(1);
4648
_system_ticks++;
4749
}
4850

projects/eval-powrms/Makefile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
LIBRARIES += lvgl
2+
IIOD=y
3+
4+
# CFLAGS += -DNO_OS_USB_UART
5+
6+
SRCS += $(PROJECT)/src/common/syscalls.c
7+
8+
9+
include ../../tools/scripts/generic_variables.mk
10+
11+
HEAP_SIZE=0x90000
12+
STACK_SIZE=0x10000
13+
14+
include src.mk
15+
16+
CFLAGS += -Os -ffunction-sections -fdata-sections -fno-strict-aliasing
17+
LDFLAGS += -Wl,--gc-sections
18+
19+
include ../../tools/scripts/generic.mk

projects/eval-powrms/README.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Eval-PowRMS Project
2+
3+
## Overview
4+
The Eval-PowRMS project is designed to evaluate and demonstrate the functionality of power RMS (Root Mean Square) measurement systems. It includes source code, examples, and platform-specific implementations for the Maxim MAX32662 microcontroller.
5+
6+
## Folder Structure
7+
The project is organized as follows:
8+
9+
```
10+
├── build/ # Build artifacts
11+
├── src/ # Source code
12+
│ ├── common/ # Common utilities and data
13+
│ ├── examples/ # Example applications
14+
│ └── platform/ # Platform-specific code
15+
├── noos/ # No-OS drivers and libraries
16+
│ ├── drivers/ # Hardware drivers
17+
│ ├── include/ # Header files
18+
│ ├── libraries/ # External libraries (e.g., LVGL)
19+
│ └── util/ # Utility functions
20+
├── objs/ # Object files
21+
├── lv_conf.h # LVGL configuration
22+
├── Makefile # Build system entry point
23+
├── README.md # Project documentation
24+
├── src.mk # Source file list for the build system
25+
└── test.sh # Test script
26+
```
27+
28+
## Changes needed:
29+
30+
```diff
31+
index 2ebcec56c2..70c83abdd6 100644
32+
--- a/iio/iio_app/iio_app.c
33+
+++ b/iio/iio_app/iio_app.c
34+
@@ -241,7 +241,7 @@ static int32_t uart_setup(struct no_os_uart_desc **uart_desc,
35+
/* TODO: remove this ifdef when asynchrounous rx is implemented on every platform. */
36+
#if defined(STM32_PLATFORM) || defined(MAXIM_PLATFORM) || defined(ADUCM_PLATFORM) || defined(PICO_PLATFORM)
37+
.irq_id = uart_init_par->irq_id,
38+
- .asynchronous_rx = true,
39+
+ .asynchronous_rx = false,
40+
#endif
41+
.baud_rate = UART_BAUDRATE_DEFAULT,
42+
.size = NO_OS_UART_CS_8,
43+
diff --git a/libraries/esh/esh b/libraries/esh/esh
44+
```
45+
46+
47+
## Build and Run Instructions
48+
49+
### Prerequisites
50+
- A Linux-based operating system
51+
- `make` build system
52+
- Maxim MAX32662 development environment
53+
54+
### Build the Project
55+
To build the project for the Maxim MAX32662 platform, run the following task:
56+
57+
```bash
58+
make -C /home/rbudai/Workspace_no_os/no-os/projects/eval-powrms PLATFORM=maxim TARGET=max32662
59+
```
60+
61+
Alternatively, you can use the VS Code task labeled **maxim Build**.
62+
63+
### Run the Project
64+
To run the project, execute:
65+
66+
```bash
67+
make run -C /home/rbudai/Workspace_no_os/no-os/projects/eval-powrms PLATFORM=maxim TARGET=max32662
68+
```
69+
70+
Alternatively, you can use the VS Code task labeled **maxim Run**.
71+
72+
## Dependencies
73+
- [LVGL](https://lvgl.io/) for graphical user interface components
74+
- Maxim SDK for platform-specific drivers and libraries
75+
76+
## Contributing
77+
Contributions are welcome! Please follow these steps:
78+
1. Fork the repository.
79+
2. Create a new branch for your feature or bug fix.
80+
3. Commit your changes with clear and concise messages.
81+
4. Submit a pull request.
82+
83+
## License
84+
This project is licensed under the [MIT License](LICENSE).

0 commit comments

Comments
 (0)