no-OS
Loading...
Searching...
No Matches
iot_example.c File Reference

Sensor-to-Cloud (MQTT / Azure IoT Hub) example for EVAL-ADE9430. More...

#include "no_os_error.h"
#include <stdlib.h>
#include <stdio.h>
#include "no_os_uart.h"
#include "no_os_gpio.h"
#include "no_os_delay.h"
#include "no_os_timer.h"
#include "no_os_i2c.h"
#include "mqtt_client.h"
#include "ade9430.h"
#include "pcf85263.h"
#include "nhd_c12832a1z.h"
#include "maxim_gpio.h"
#include "maxim_uart.h"
#include "maxim_irq.h"
#include "maxim_i2c.h"
#include "maxim_spi.h"
#include "maxim_timer.h"
#include "maxim_trng.h"
#include "no_os_irq.h"
#include "no_os_print_log.h"
#include "wifi.h"
#include "tcp_socket.h"
#include "az_iot_hub_client.h"
#include "az_iot_provisioning_client.h"
#include "parameters.h"
Include dependency graph for iot_example.c:

Functions

int create_and_configure_mqtt_client_for_provisioning (void)
 
int create_and_configure_mqtt_client_for_iot_hub (void)
 
int read_and_send (struct mqtt_desc *mqtt, struct ade9430_dev *ade9430_dev, struct nhd_c12832a1z_dev *nhd_c12832a1z_dev, struct pcf85263_dev *pcf85263_dev)
 
void mqtt_message_handler (struct mqtt_message_data *msg)
 
int example_main ()
 Main function execution for maxim platform.
 

Detailed Description

Sensor-to-Cloud (MQTT / Azure IoT Hub) example for EVAL-ADE9430.

Author
Antoniu Miclaus (anton.nosp@m.iu.m.nosp@m.iclau.nosp@m.s@an.nosp@m.alog..nosp@m.com)

Copyright 2023(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:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

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.

Function Documentation

◆ create_and_configure_mqtt_client_for_iot_hub()

int create_and_configure_mqtt_client_for_iot_hub ( void )
Here is the caller graph for this function:

◆ create_and_configure_mqtt_client_for_provisioning()

int create_and_configure_mqtt_client_for_provisioning ( void )
Here is the caller graph for this function:

◆ example_main()

int example_main ( void )

Main function execution for maxim platform.

Basic example main execution.

Basic example main executiont.

Returns
ret - Result of the enabled examples execution.

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

Initialize the ADC_RDY GPIO and associated IRQ event

Returns
0 if success, negative error code otherwise

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

◆ mqtt_message_handler()

void mqtt_message_handler ( struct mqtt_message_data * msg)

◆ read_and_send()

int read_and_send ( struct mqtt_desc * mqtt,
struct ade9430_dev * ade9430_dev,
struct nhd_c12832a1z_dev * nhd_c12832a1z_dev,
struct pcf85263_dev * pcf85263_dev )
Here is the caller graph for this function: