TOP Contributors

  1. MIKROE (2779 codes)
  2. Alcides Ramos (376 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139566 times)
  2. FAT32 Library (72041 times)
  3. Network Ethernet Library (57256 times)
  4. USB Device Library (47631 times)
  5. Network WiFi Library (43220 times)
  6. FT800 Library (42566 times)
  7. GSM click (29930 times)
  8. mikroSDK (28292 times)
  9. PID Library (26933 times)
  10. microSD click (26309 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

Barometer 3 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.15

mikroSDK Library: 2.0.0.0

Category: Pressure

Downloaded: 210 times

Not followed.

License: MIT license  

Barometer 3 Click is a compact add-on board for applications which require digital barometric air pressure measurement. This board features the DPS368, a digital barometric air pressure sensor from Infineon.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Barometer 3 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Barometer 3 Click" changes.

Do you want to report abuse regarding "Barometer 3 Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


Barometer 3 Click

Barometer 3 Click is a compact add-on board for applications which require digital barometric air pressure measurement. This board features the DPS368, a digital barometric air pressure sensor from Infineon.

barometer3_click.png

Click Product page


Click library

  • Author : MikroE Team
  • Date : Jul 2020.
  • Type : I2C/SPI type

Software Support

We provide a library for the Barometer3 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Barometer3 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void barometer3_cfg_setup ( barometer3_cfg_t *cfg );

  • Initialization function.

    BAROMETER3_RETVAL barometer3_init ( barometer3_t ctx, barometer3_cfg_t cfg );

  • Click Default Configuration function.

    void barometer3_def_cfg ( barometer3_t *ctx );

Example key functions :

  • Temperature Measurement Configuration function.

    void barometer3_cfg_temp ( barometer3_t *ctx, uint8_t temp_mr, uint8_t temp_osr );

  • Get Temperature Measurement Once function.

    uint8_t barometer3_meas_temp_once ( barometer3_t ctx, float result, uint8_t temp_osr );

  • Get Pressure Measurement Once function.

    uint8_t barometer3_meas_prs_once ( barometer3_t ctx, float result, uint8_t prs_osr );

Examples Description

This example demonstrates the use of Barometer 3 Click board.

The demo application is composed of two sections :

Application Init

Initializes the driver, sets the Click board default configuration and check the communication by reading the device ID.


void application_init ( void )
{
    log_cfg_t log_cfg;
    barometer3_cfg_t cfg;
    uint8_t status_val;

    /** 
     * 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 @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    barometer3_cfg_setup( &cfg );
    BAROMETER3_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    barometer3_init( &barometer3, &cfg );

    barometer3_def_cfg( &barometer3 );
    Delay_ms ( 100 );

    barometer3_generic_read( &barometer3, BAROMETER3_PROD_ID, &status_val, 1 );

    if ( status_val != BAROMETER3_PRODUCT_ID )
    {

        log_printf( &logger, " ERROR - wrong ID\r\n" );
        log_printf( &logger, " Please restart your system.\r\n" );
        for ( ; ; );
    }
    log_info( &logger, "---- Application Task ----" );
}

Application Task

Reads the temperature [ Celsius ] and pressure [ mBar ] and displays the results on the USB UART.


void application_task ( void )
{
    barometer3_cfg_temp( &barometer3, BAROMETER3_TMP_RATE_1, BAROMETER3_TMP_PRC_128 );
    barometer3_standby( &barometer3 );
    while ( BAROMETER3_SUCCESS != barometer3_meas_temp_once( &barometer3, &temperature, BAROMETER3_TMP_PRC_128 ) );
    log_printf( &logger, " Temperature: %.2f Celsius \r\n", temperature );

    barometer3_cfg_pres( &barometer3, BAROMETER3_PM_RATE_1, BAROMETER3_PM_PRC_128 );
    barometer3_standby( &barometer3 );
    while ( BAROMETER3_SUCCESS != barometer3_meas_prs_once( &barometer3, &pressure, BAROMETER3_PM_PRC_128 ) );
    log_printf( &logger, " Pressure: %.2f mBar \r\n", pressure );
    log_printf( &logger, "----------------------- \r\n" );
} 

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Barometer3

Additional notes and informations

Depending on the development board you are using, you may need USB UART Click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ALSO FROM THIS AUTHOR

Buck-Boost 3 Click

0

The Buck-Boost 3 Click is a voltage converter regulator, which is able to provide a regulated voltage of 3.3V or 5V on the output, even when the input voltage drops under 3V.

[Learn More]

Color 2 click

1

Color 2 click carries the ISL29125 RGB color light sensor. It detects red, green and blue in a variety of lighting conditions, outputting 16-bit resolution data in a 5.7m lux-10,000 lux measuring range. The board communicates with the target MCU through the mikroBUSâ„¢ I2C interface (SCL and SDA pins).

[Learn More]

ADC 20 Click

0

ADC 20 Click is a compact add-on board with a high-performance data converter. This board features the TLA2518, an SPI-configurable eight-channel 12-bit successive approximation register analog-to-digital converter (SAR ADC) from Texas Instruments. The TLA2518 has an internal oscillator for the ADC conversion and supports averaging multiple data samples with a single conversion start. Also, the built-in programmable averaging filters help reduce noise from the analog inputs and reduce the number of data samples required to be read by the host MCU. All eight channels can be used as analog inputs, with the addition that the four channels can be used as digital inputs or digital outputs.

[Learn More]