![]() |
no-OS
|
Implementation of EVAL_POWRMS example for demo project. More...
#include "example.h"#include "powrms_gpios.h"#include "powrms_utils.h"#include "powrms_data_processing.h"#include "m24512.h"#include "subscreen_blank_screen.h"#include "no_os_alloc.h"#include "no_os_delay.h"#include "no_os_uart.h"#include "no_os_print_log.h"#include "maxim_uart_stdio.h"#include "max32662.h"Macros | |
| #define | SCREEN_UPDATE_PERIOD_MS 200 |
Functions | |
| void | my_flush_cb (lv_display_t *disp, const lv_area_t *area, uint8_t *color_p) |
| int | display_task () |
| Initialize the display task. | |
| int | configure_adc () |
| Configure the ADC. | |
| int | configure_display () |
| Configure the display. | |
| int | configure_debug_uart (void) |
| Initialize the debug UART and route stdio (printf / pr_*) to it. | |
| int | screen_while () |
| IIO post-step callback. | |
| int | example_main (void) |
| Main function. | |
Variables | |
| LV_ATTRIBUTE_MEM_ALIGN uint8_t | display_buffer [SSD1306_HOR_REZ *SSD1306_VER_REZ/8+8] |
| bool | show_menu = 1 |
| bool | enter_pressed = 0 |
| enum display_entry_t | display_entry = DISPLAY_ENTRY_SHOW |
| Display descriptor 0 -> Startup Frequency Screen 1 -> Main Screen (ADC values) 2 -> Show Screen 3 -> Settings Screen. | |
Implementation of EVAL_POWRMS example for demo project.
Copyright 2025(c) Analog Devices, Inc.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
| #define SCREEN_UPDATE_PERIOD_MS 200 |
| int configure_adc | ( | ) |
Configure the ADC.
| int configure_debug_uart | ( | void | ) |
Initialize the debug UART and route stdio (printf / pr_*) to it.
Uses the same UART that the IIO transport runs on (iio_demo_usb_ip) so that pr_info()/pr_debug()/pr_err() messages from the whole firmware appear on the host serial console.
| int configure_display | ( | ) |
Configure the display.
| int display_task | ( | ) |
Initialize the display task.
| int example_main | ( | void | ) |
Main function.
Basic example main execution.
Basic example main executiont.
IIO descriptor and initialization parameter.
IIO app.
Declaring iio_devices structure
Initializing IIO app init param.
Initializing IIO app.
Running the IIO app (use iio_info or osc in terminal).
Set the threshold voltage to 5V
The comparator output will be available on the GPO_A pin
Set the DAC output on channel C to 5V
Measure input current on channel D
GPIO Pin Interrupt Controller
UART init params
IIO application descriptor
IIO application initialization parameters
iio axi adc configurations.
iio axi dac configurations.
iio instance descriptor.
iio instance descriptor.
iio device instance descriptor.
UART init params
IIO application descriptor
IIO application initialization parameters
iio axi adc configurations.
iio axi dac configurations.
iio instance descriptor.
iio instance descriptor.
iio device instance descriptor.
Negative temperature
Positive temperature
Negative temperature
Positive temperature
Switch to APG mode
Switch to AWG mode
| void my_flush_cb | ( | lv_display_t * | disp, |
| const lv_area_t * | area, | ||
| uint8_t * | color_p ) |
| int screen_while | ( | ) |
IIO post-step callback.
Runs after every iio_step(). The heavy screen/ADC work is rate-limited to SCREEN_UPDATE_PERIOD_MS so it does not block the IIO transport on every poll. LVGL's tick is advanced with the real elapsed time rather than a fixed value.
| LV_ATTRIBUTE_MEM_ALIGN uint8_t display_buffer[SSD1306_HOR_REZ * SSD1306_VER_REZ/8+8] |
| enum display_entry_t display_entry = DISPLAY_ENTRY_SHOW |
Display descriptor 0 -> Startup Frequency Screen 1 -> Main Screen (ADC values) 2 -> Show Screen 3 -> Settings Screen.
| bool enter_pressed = 0 |
| bool show_menu = 1 |