adswio2 2.0.0.0
main.c File Reference

AdSwio2 Click example. More...

#include "board.h"
#include "log.h"
#include "adswio2.h"

Functions

void application_default_handler (uint8_t *err_msg)
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Variables

const uint16_t ADSWIO2_RANGE_VOLT_MV = 10000
 
const uint32_t ADSWIO2_RANGE_RESOLUTION = 65536
 

Detailed Description

AdSwio2 Click example.

Description

This Click is a quad-channel software configurable input/output solution for building and process control application. The AD-SWIO 2 Click contains four 13-bit DACs, one per chanal, and 16-bit Σ-∆ ADC. These options give a lot of flexibility in choosing functionality for analog output, analog input, digital input, resistance temperature detector (RTD), and thermocouple measurements integrated into a single chip solution with a serial peripheral interface (SPI).

The demo application is composed of two sections :

Application Init

Performs a hardware reset of the click board and executes a default configuration that enables channel A and sets it to measure voltage input in the range from 0V to 10V, with 4800 SPS.

Application Task

Waits for the data ready and then reads the results of ADC conversion from channel A and if response is ok, then prints the results on the uart console.

Additional Functions

  • void application_default_handler ( uint8_t *err_msg ) - Sends an error report messages from click driver to initialized console module. It must be set using adswio2_set_handler function.
Author
MikroE Team

Function Documentation

◆ application_default_handler()

void application_default_handler ( uint8_t * err_msg)

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )

Variable Documentation

◆ ADSWIO2_RANGE_RESOLUTION

const uint32_t ADSWIO2_RANGE_RESOLUTION = 65536

◆ ADSWIO2_RANGE_VOLT_MV

const uint16_t ADSWIO2_RANGE_VOLT_MV = 10000