text: /*
   * MikroSDK - MikroE Software Development Kit
   * Copyright© 2020 MikroElektronika d.o.o.
   * 
   * Permission is hereby granted, free of charge, to any person 
   * obtaining a copy of this software and associated documentation 
   * files (the "Software"), to deal in the Software without restriction, 
   * including without limitation the rights to use, copy, modify, merge, 
   * publish, distribute, sublicense, and/or sell copies of the Software, 
   * and to permit persons to whom the Software is furnished to do so, 
   * subject to the following conditions:
   * 
   * The above copyright notice and this permission notice shall be 
   * included in all copies or substantial portions of the Software.
   * 
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
   * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
   * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
   * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 
   * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE 
   * OR OTHER DEALINGS IN THE SOFTWARE. 
   */
  
  /*!
   * \file
   *
   * \brief This file contains API for Tilt 2 Click driver.
   *
   * \addtogroup tilt2 Tilt 2 Click Driver
   * @{
   */
  // ----------------------------------------------------------------------------
  
  #ifndef TILT2_H
  #define TILT2_H
  
  #include "drv_digital_out.h"
  #include "drv_digital_in.h"
  
  // -------------------------------------------------------------- PUBLIC MACROS 
  /**
   * \defgroup macros Macros
   * \{
   */
  
  /**
   * \defgroup map_mikrobus MikroBUS
   * \{
   */
  #define TILT2_MAP_MIKROBUS( cfg, mikrobus ) \
    cfg.int_pin= MIKROBUS( mikrobus, MIKROBUS_INT );
  /** \} */
  
  /**
   * \defgroup error_code Error Code
   * \{
   */
  #define TILT2_RETVAL  uint8_t
  
  #define TILT2_OK           0x00
  #define TILT2_INIT_ERROR   0xFF
  /** \} */
  
  /**
   * \defgroup detection Detection
   * \{
   */
  #define TILT2_TILT_DETECTION     0x01
  #define TILT2_TILT_NO_DETECTION  0x00
  /** \} */
  
  /** \} */ // End group macro 
  // --------------------------------------------------------------- PUBLIC TYPES
  /**
   * \defgroup type Types
   * \{
   */
   
  /**
   * @brief Click ctx object definition.
   */
  typedef struct
  {
      // Input pins 
  
      digital_in_t int_pin;
  
  } tilt2_t;
  
  /**
   * @brief Click configuration structure definition.
   */
  typedef struct
  {
      // Additional gpio pins 
  
      pin_name_t int_pin;
  
  } tilt2_cfg_t;
  
  /** \} */ // End types group
  // ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
  
  /**
   * \defgroup public_function Public function
   * \{
   */
   
  #ifdef __cplusplus
  extern "C"{
  #endif
  
  /**
   * @brief Config Object Initialization function.
   *
   * @param cfg  Click configuration structure.
   *
   * @description This function initializes click configuration structure to init state.
   * @note All used pins will be set to unconnected state.
   */
  void tilt2_cfg_setup ( tilt2_cfg_t *cfg );
  
  /**
   * @brief Initialization function.
   * @param tilt2 Click object.
   * @param cfg Click configuration structure.
   * 
   * @description This function initializes all necessary pins and peripherals used for this click.
   */
  TILT2_RETVAL tilt2_init ( tilt2_t *ctx, tilt2_cfg_t *cfg );
  
  /**
   * @brief Tilt detection function.
   *
   * @param ctx  Click object.
   *
   * @description This function detection tilt.
   */
  uint8_t tilt2_tilt_detection ( tilt2_t *ctx );
  
  #ifdef __cplusplus
  }
  #endif
  #endif  // _TILT2_H_
  
  /** \} */ // End public_function group
  /// \}    // End click Driver group  
  /*! @} */
  // ------------------------------------------------------------------------- END
  