c8pini2c 2.0.0.0
main.c File Reference

8pinI2c Click example More...

#include "board.h"
#include "log.h"
#include "c8pini2c.h"

Macros

#define SURFACE_TEMP_DEVICE_SLAVE_ADDRESS   0x48
 
#define SURFACE_TEMP_REG_SOFT_RESET   0x2F
 
#define SURFACE_TEMP_REG_ID   0x0B
 
#define SURFACE_TEMP_REG_CONFIG   0x03
 
#define SURFACE_TEMP_REG_TEMP_MSB   0x00
 

Functions

void surfacetemp_soft_reset ()
 
uint8_t surfacetemp_setup ()
 
float surfacetemp_get_temperature ()
 
void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

8pinI2c Click example

Description

This demo example reads temperature detected by Surface temp click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures a Surface temp click board.

Application Task

Reads the temperature detected by Surface temp click board and logs it on the USB UART each second.

Note
In order to run this example successfully, a Surface temp click board needs to be connected properly to an 8-pin I2C click board.
Author
MikroE Team

Macro Definition Documentation

◆ SURFACE_TEMP_DEVICE_SLAVE_ADDRESS

#define SURFACE_TEMP_DEVICE_SLAVE_ADDRESS   0x48

◆ SURFACE_TEMP_REG_CONFIG

#define SURFACE_TEMP_REG_CONFIG   0x03

◆ SURFACE_TEMP_REG_ID

#define SURFACE_TEMP_REG_ID   0x0B

◆ SURFACE_TEMP_REG_SOFT_RESET

#define SURFACE_TEMP_REG_SOFT_RESET   0x2F

◆ SURFACE_TEMP_REG_TEMP_MSB

#define SURFACE_TEMP_REG_TEMP_MSB   0x00

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 )

◆ main()

int main ( void )

◆ surfacetemp_get_temperature()

float surfacetemp_get_temperature ( )

◆ surfacetemp_setup()

uint8_t surfacetemp_setup ( )

◆ surfacetemp_soft_reset()

void surfacetemp_soft_reset ( )