no-OS
Loading...
Searching...
No Matches
basic_example.c File Reference
#include <stdio.h>
#include <string.h>
#include "common_data.h"
#include "max20362.h"
#include "no_os_delay.h"
#include "no_os_print_log.h"
#include "no_os_uart.h"
Include dependency graph for basic_example.c:

Macros

#define TEST_REG_MASK   0x0F
 
#define TEST_REG_VALUE   0x05
 
#define TEST_BB_VOLTAGE_UV   3300000
 
#define TEST_LDO_VOLTAGE_UV   1800000
 
#define TEST_CAP_VOLTAGE_UV   3100000
 
#define TEST_CAP_VOLTAGE_MIN_UV   1000000
 
#define TEST_DVS_VOLTAGE_1_UV   2500000
 
#define TEST_DVS_VOLTAGE_2_UV   3300000
 
#define TEST_CURRENT_LIMIT_MA   25
 
#define TEST_BASIC_COMMS   1 /* Test I2C and chip ID */
 
#define TEST_REGISTER_RW   1 /* Test register read/write */
 
#define TEST_BUCK_BOOST   1 /* Test buck-boost functions */
 
#define TEST_LDO   1 /* Test LDO functions */
 
#define TEST_DVS   1 /* Test DVS modes */
 
#define TEST_INTERRUPTS   1 /* Test interrupt handling */
 
#define TEST_PROTECTION   1 /* Test lock/unlock */
 
#define TEST_CAPACITOR   1 /* Test capacitor voltage */
 
#define TEST_CURRENT_LIMIT   1 /* Test current limiting */
 

Functions

void no_os_uart_stdio (struct no_os_uart_desc *desc)
 
int example_main (void)
 Main example function.
 

Variables

struct no_os_uart_desc * uart_desc
 

Macro Definition Documentation

◆ TEST_BASIC_COMMS

#define TEST_BASIC_COMMS   1 /* Test I2C and chip ID */

◆ TEST_BB_VOLTAGE_UV

#define TEST_BB_VOLTAGE_UV   3300000

Test voltage values (microvolts) Test buck-boost voltage: 3.3V

◆ TEST_BUCK_BOOST

#define TEST_BUCK_BOOST   1 /* Test buck-boost functions */

◆ TEST_CAP_VOLTAGE_MIN_UV

#define TEST_CAP_VOLTAGE_MIN_UV   1000000

Test capacitor min voltage: 1.0V

◆ TEST_CAP_VOLTAGE_UV

#define TEST_CAP_VOLTAGE_UV   3100000

Test capacitor voltage: 3.1V

◆ TEST_CAPACITOR

#define TEST_CAPACITOR   1 /* Test capacitor voltage */

◆ TEST_CURRENT_LIMIT

#define TEST_CURRENT_LIMIT   1 /* Test current limiting */

◆ TEST_CURRENT_LIMIT_MA

#define TEST_CURRENT_LIMIT_MA   25

Test current limits (milliamps) Test current limit: 25mA

◆ TEST_DVS

#define TEST_DVS   1 /* Test DVS modes */

◆ TEST_DVS_VOLTAGE_1_UV

#define TEST_DVS_VOLTAGE_1_UV   2500000

Test DVS voltage 1: 2.5V

◆ TEST_DVS_VOLTAGE_2_UV

#define TEST_DVS_VOLTAGE_2_UV   3300000

Test DVS voltage 2: 3.3V

◆ TEST_INTERRUPTS

#define TEST_INTERRUPTS   1 /* Test interrupt handling */

◆ TEST_LDO

#define TEST_LDO   1 /* Test LDO functions */

◆ TEST_LDO_VOLTAGE_UV

#define TEST_LDO_VOLTAGE_UV   1800000

Test LDO voltage: 1.8V

◆ TEST_PROTECTION

#define TEST_PROTECTION   1 /* Test lock/unlock */

◆ TEST_REG_MASK

#define TEST_REG_MASK   0x0F

Test-specific constants for register operations Test register bit mask

◆ TEST_REG_VALUE

#define TEST_REG_VALUE   0x05

Test register bit value

◆ TEST_REGISTER_RW

#define TEST_REGISTER_RW   1 /* Test register read/write */

Function Documentation

◆ example_main()

int example_main ( void )

Main example function.

Basic example main execution.

Basic example main executiont.

Returns
0 on success, negative error code otherwise

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

Parameter to be passed when the callback is called.

GPIO Pin Interrupt Controller

MAX14906 Initialization

Setting SLED set bit 1 in the config register.

Turning the Status LEDs on, then off.

Setting a current limit for channel 0.

Read current limit for all channels.

Setting the on state for channel 0, and then verifying it.

IIO descriptor and initialization parameter.

Channel configuration to be used in the example.

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).

◆ no_os_uart_stdio()

void no_os_uart_stdio ( struct no_os_uart_desc * desc)
extern

Variable Documentation

◆ uart_desc

struct no_os_uart_desc* uart_desc