75 lines
3.0 KiB
C
75 lines
3.0 KiB
C
/*******************************************************************************
|
|
* DISCLAIMER
|
|
* This software is supplied by Renesas Electronics Corporation and is only
|
|
* intended for use with Renesas products. No other uses are authorized. This
|
|
* software is owned by Renesas Electronics Corporation and is protected under
|
|
* all applicable laws, including copyright laws.
|
|
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
|
|
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
|
|
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
|
|
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
|
|
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
|
|
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
|
|
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
|
|
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
|
|
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
|
* Renesas reserves the right, without notice, to make changes to this software
|
|
* and to discontinue the availability of this software. By using this software,
|
|
* you agree to the additional terms and conditions found by accessing the
|
|
* following link:
|
|
* http://www.renesas.com/disclaimer
|
|
* Copyright 2024 Renesas Electronics Corporation All rights reserved.
|
|
*******************************************************************************/
|
|
|
|
/*******************************************************************************
|
|
* DESCRIPTION : I2C driver header
|
|
******************************************************************************/
|
|
|
|
#ifndef I2C_DRIVER_H__
|
|
#define I2C_DRIVER_H__
|
|
|
|
#define FLG_RW (0x00000001U)
|
|
|
|
#define I2C_OK (0x00000000U)
|
|
#define I2C_NG (0x00000001U)
|
|
|
|
#define SET_SCGD (0x00000018U)
|
|
#define SET_CDF (0x00000007U)
|
|
|
|
#define FLAG_SDBS (1U << 3)
|
|
|
|
#define FLAG_MDBS (0x00000080U)
|
|
#define FLAG_FSCL (0x00000040U)
|
|
#define FLAG_FSDA (0x00000020U)
|
|
#define FLAG_MIE (0x00000008U)
|
|
#define FLAG_FSB (0x00000002U)
|
|
#define FLAG_ESG (0x00000001U)
|
|
|
|
#define FLAG_MNR (0x00000040U)
|
|
#define FLAG_MAL (0x00000020U)
|
|
#define FLAG_MST (0x00000010U)
|
|
#define FLAG_MDE (0x00000008U)
|
|
#define FLAG_MDT (0x00000004U)
|
|
#define FLAG_MDR (0x00000002U)
|
|
#define FLAG_MAT (0x00000001U)
|
|
#define __INV(x) ((0x7F) & ~(x))
|
|
|
|
#define FLAG_NONE (0U)
|
|
|
|
#define ERR_MAX (1U)
|
|
|
|
void i2c3_init(void);
|
|
void i2c3_write(uint32_t slaveAdd, uint32_t regAdd, uint32_t setData);
|
|
void i2c3_read(uint32_t slaveAdd, uint32_t regAdd, uint32_t *revData);
|
|
uint32_t i2c3_err_check(uint32_t first, uint32_t second, uint32_t error);
|
|
void i2c3_release(void);
|
|
|
|
void i2c5_init(void);
|
|
void i2c5_write(uint32_t slaveAdd, uint32_t regAdd, uint32_t setData);
|
|
void i2c5_read(uint32_t slaveAdd, uint32_t regAdd, uint32_t *revData);
|
|
uint32_t i2c5_err_check(uint32_t first, uint32_t second, uint32_t error);
|
|
void i2c5_release(void);
|
|
|
|
#endif /* I2C_DRIVER_H__ */
|
|
|