/*!
 * @file        gpio_i2c_host.h
 *
 * @brief       This file contains the headers of the interrupt handlers
 *
 * @version     V1.0.0
 *
 * @date        2026-02-25
 *
 * @attention
 *
 *  Copyright (C) 2026 Geehy Semiconductor
 *
 *  You may not use this file except in compliance with the
 *  GEEHY COPYRIGHT NOTICE (Geehy Semiconductor Software License Agreement).
 *
 *  The program is only for reference, which is distributed in the hope
 *  that it will be useful and instructional for customers to develop
 *  their software. Unless required by applicable law or agreed to in
 *  writing, the program is distributed on an "AS IS" BASIS, WITHOUT
 *  ANY WARRANTY OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the Geehy Semiconductor Software License Agreement for the governing permissions
 *  and limitations under the License.
 */

/* Define to prevent recursive inclusion */
#ifndef GPIO_I2C_HOST_EXAM_H
#define GPIO_I2C_HOST_EXAM_H

#ifdef __cplusplus
extern "C" {
#endif

/* Includes */
#include "g32a10xx.h"
extern volatile uint32_t sysTick;
/** @addtogroup Examples
  @{
  */

/** @addtogroup I2C_Examples
  @{
  */

/** @addtogroup GPIO_I2C_HOST
  @{
  */

/** @defgroup GPIO_I2C_HOST_Enumerations Enumerations
  @{
  */

/**
 * @brief   I2C clock rate
 */
typedef enum
{
    I2C_CLK_150KHz = 1,     /*!< I2C clock rate is 150KHz */
    I2C_CLK_100KHz,         /*!< I2C clock rate is 100KHz */
    I2C_CLK_10KHz           /*!< I2C clock rate is  10KHz */
}I2c_ClkRateType;

/**@} end of group GPIO_I2C_HOST_Enumerations */

 
/** @defgroup GPIO_I2C_HOST_Functions Functions
  @{
  */
void I2c_InitGpio(void);
void I2c_InitSysClock(I2c_ClkRateType I2c_Clock);

uint8_t I2c_HostReadByteExam(uint16_t Addr);
void I2c_HostWriteByteExam(uint16_t Addr, uint8_t Data);
void I2c_HostWritePageExam(uint16_t Addr, const uint8_t *BufPtr, uint8_t Len);
void I2c_HostReadDataExam(uint16_t Addr, uint8_t *BufPtr, uint8_t Len);

#ifdef __cplusplus
}
#endif

#endif /*GPIO_I2C_HOST_EXAM_H */

/**@} end of group GPIO_I2C_HOST_Functions */
/**@} end of group GPIO_I2C_HOST */
/**@} end of group I2C_Examples */
/**@} end of group Examples */


