/*!
* \copyright
* COPYRIGHT(C) 2021 Honeywell Inc. All rights reserved.
* This software is a copyrighted work and/or information protected as a
* trade secret. Legal rights of Honeywell Inc in this software is distinct
* from ownership of any medium in which the software is embodied. Copyright
* or trade secret notices included must be reproduced in any copy autorized
* by Honeywell Inc. The information in this software is subject to change
* without notice and should not be considered as a commitment by Honeywell.
*
* \file hal_i2c.h
* \brief Header file for hal_i2c.c
* \ingroup hal_i2c
* \details This file contains references used by hal_i2c.c
*
* \author Mrikank Srivastava
*
* \date 08/Aug/2022
*
*/
#ifndef HAL_I2C_H
#define HAL_I2C_H
/*
-------------------------------------------------------------------------------
Includes
-------------------------------------------------------------------------------
*/
// Standard C Included Files
#include
// SDK Included Files
#include "board.h"
#include "fsl_os_abstraction.h"
#include "fsl_i2c_master_driver.h"
#include "fsl_debug_console.h"
/*
-------------------------------------------------------------------------------
Defines
-------------------------------------------------------------------------------
*/
/*
-------------------------------------------------------------------------------
Globals
-------------------------------------------------------------------------------
*/
extern bool gb_reset_cmd;
/*
-------------------------------------------------------------------------------
Data Types
-------------------------------------------------------------------------------
*/
/*! \enum i2c_rw_bit
* \ingroup hal_i2c
* \brief Enum defining read or write bit in I2C transfer
*/
enum i2c_rw_bit
{
I2C_WRITE = 0, /*!< I2C Write Bit */
I2C_READ /*!< I2C Read Bit */
};
/*
-------------------------------------------------------------------------------
Prototypes
-------------------------------------------------------------------------------
*/
void I2C1_Master_init(void);
bool master_transmit_receive(const uint8_t * cmdBuff,
uint32_t cmdSize,
uint32_t rxSize);
bool master_slave_write(const uint8_t * cmdBuff,
uint32_t cmdSize,
uint32_t txSize);
i2c_status_t master_transmit_receive_timeout(const uint8_t * cmdBuff,
uint32_t cmdSize,
uint32_t rxSize, uint32_t timeout_ms);
#endif /* HAL_I2C_H */