i2cisolator 2.0.0.0
main.c File Reference

I2Cisolator Click example. More...

#include "board.h"
#include "log.h"
#include "i2cisolator.h"

Macros

#define I2CISOLATOR_IRTHERMO2_CONFIGURATION   0x02
 
#define I2CISOLATOR_IRTHERMO2_OBJECT_TEMPERATURE   0x03
 
#define I2CISOLATOR_IRTHERMO2_STATUS_MASK_AND_ENABLE   0x05
 
#define I2CISOLATOR_IRTHERMO2_CFG_MODEON   0x1000
 
#define I2CISOLATOR_IRTHERMO2_CFG_ALERTEN   0x0100
 
#define I2CISOLATOR_IRTHERMO2_CFG_TRANSC   0x0040
 
#define I2CISOLATOR_IRTHERMO2_CFG_16SAMPLE   0x0800
 
#define I2CISOLATOR_IRTHERMO2_STAT_ALERTEN   0x8000
 
#define I2CISOLATOR_IRTHERMO2_STAT_CRTEN   0x4000
 

Functions

void i2cisolator_get_temperature (void)
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

I2Cisolator Click example.

Description

This is an example which demonstrates the use of I2C Isolator Click board.

The demo application is composed of two sections :

Application Init

Initialization driver enables - I2C, sets configuration of TMP007 sensor on IrThermo 2 click and start to write log.

Application Task

In this example we use IrThermo 2 click, measures the temperature with, and calculate the temperature in degrees Celsius [ C ]. Results are being sent to the USART Terminal where you can track their changes. All data logs on usb uart each second.

Author
MikroE Team

Macro Definition Documentation

◆ I2CISOLATOR_IRTHERMO2_CFG_16SAMPLE

#define I2CISOLATOR_IRTHERMO2_CFG_16SAMPLE   0x0800

◆ I2CISOLATOR_IRTHERMO2_CFG_ALERTEN

#define I2CISOLATOR_IRTHERMO2_CFG_ALERTEN   0x0100

◆ I2CISOLATOR_IRTHERMO2_CFG_MODEON

#define I2CISOLATOR_IRTHERMO2_CFG_MODEON   0x1000

◆ I2CISOLATOR_IRTHERMO2_CFG_TRANSC

#define I2CISOLATOR_IRTHERMO2_CFG_TRANSC   0x0040

◆ I2CISOLATOR_IRTHERMO2_CONFIGURATION

#define I2CISOLATOR_IRTHERMO2_CONFIGURATION   0x02

◆ I2CISOLATOR_IRTHERMO2_OBJECT_TEMPERATURE

#define I2CISOLATOR_IRTHERMO2_OBJECT_TEMPERATURE   0x03

◆ I2CISOLATOR_IRTHERMO2_STAT_ALERTEN

#define I2CISOLATOR_IRTHERMO2_STAT_ALERTEN   0x8000

◆ I2CISOLATOR_IRTHERMO2_STAT_CRTEN

#define I2CISOLATOR_IRTHERMO2_STAT_CRTEN   0x4000

◆ I2CISOLATOR_IRTHERMO2_STATUS_MASK_AND_ENABLE

#define I2CISOLATOR_IRTHERMO2_STATUS_MASK_AND_ENABLE   0x05

Function Documentation

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

◆ i2cisolator_get_temperature()

void i2cisolator_get_temperature ( void )

◆ main()

int main ( void )