mtkernel_3/device/i2c/i2c.h | bare source | permlink (0.00 seconds) |
1: /* 2: *---------------------------------------------------------------------- 3: * Device Driver for micro T-Kernel for 亮T-Kernel 3.00.05 4: * 5: * Copyright (C) 2020-2021 by Ken Sakamura. 6: * This software is distributed under the T-License 2.2. 7: *---------------------------------------------------------------------- 8: * 9: * Released by TRON Forum(http://www.tron.org) at 2021/11. 10: * 11: *---------------------------------------------------------------------- 12: */ 13: 14: /* 15: * i2c.h 16: * I2C device driver 17: * Driver local definition 18: */ 19: 20: #ifndef __DEV_I2C_H__ 21: #define __DEV_I2C_H__ 22: 23: #include "../common/drvif/msdrvif.h" 24: #include "../include/dev_i2c.h" 25: #include "i2c_cnf.h" 26: 27: /*---------------------------------------------------------------------*/ 28: /* Hardware dependent definition 29: */ 30: #ifdef CPU_TMPM367FDFG 31: #include "sysdepend/tx03_m367/i2c_m367.h" 32: #endif /* CPU_TMPM367FDFG */ 33: 34: #ifdef CPU_STM32L4 35: #include "sysdepend/stm32l4/i2c_stm32l4.h" 36: #endif /* CPU_STM32L4 */ 37: 38: #ifdef CPU_RX231 39: #include "sysdepend/rx231/i2c_rx231.h" 40: #endif /* CPU_RX231 */ 41: 42: #ifdef CPU_RZA2M 43: #include "sysdepend/rza2m/i2c_rza2m.h" 44: #endif /* CPU_RZA2M */ 45: 46: /*---------------------------------------------------------------------*/ 47: /* Device driver Control block 48: */ 49: typedef struct { 50: UW unit; /* Unit No. */ 51: UINT omode; /* Open mode */ 52: 53: ID evtmbfid; /* MBF ID for event notification */ 54: } T_I2C_DCB; 55: 56: /*---------------------------------------------------------------------*/ 57: /* Device driver low-level interface 58: * These functions are defined in the system dependent part. 59: */ 60: IMPORT W dev_i2c_llctl( UW, INT, UW, UW, UW*); /* Low-Level device control */ 61: IMPORT ER dev_i2c_llinit( T_I2C_DCB *p_dcb); /* Low-level device initialization */ 62: 63: typedef enum { 64: LLD_I2C_OPEN, 65: LLD_I2C_CLOSE, 66: LLD_I2C_READ, 67: LLD_I2C_WRITE, 68: LLD_I2C_EXEC, 69: } T_LLD_I2C_CMD; 70: 71: 72: #endif /* __DEV_I2C_H__ */