Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imxrt-multi: Implement i2c driver #491

Merged
merged 3 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions multi/imxrt-multi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ NAME := imxrt-multi

LOCAL_PATH := $(call my-dir)

LOCAL_SRCS = imxrt-multi.c common.c uart.c gpio.c spi.c fs.c posixsrv.c
LOCAL_SRCS = imxrt-multi.c common.c uart.c gpio.c spi.c i2c.c fs.c posixsrv.c
ifneq ($(TARGET_SUBFAMILY), imxrt117x)
LOCAL_SRCS += i2c.c trng.c
LOCAL_SRCS += trng.c
else
LOCAL_SRCS += cm4.c
endif
DEP_LIBS := libtty libklog libpseudodev
DEP_LIBS := libtty libklog libpseudodev i2c-common
LIBS := libdummyfs libklog libpseudodev libposixsrv
LOCAL_HEADERS := imxrt-multi.h

Expand Down
77 changes: 75 additions & 2 deletions multi/imxrt-multi/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1122,28 +1122,101 @@
#endif /* #ifdef __CPU_IMXRT117X */


#ifndef __CPU_IMXRT117X

/* I2C */

#ifndef I2C1
#define I2C1 0
#elif !ISBOOLEAN(I2C1)
#error "I2C1 must have a value of 0, 1, or be undefined"
#endif

#ifndef I2C2
#define I2C2 0
#elif !ISBOOLEAN(I2C2)
#error "I2C2 must have a value of 0, 1, or be undefined"
#endif

#ifndef I2C3
#define I2C3 0
#elif !ISBOOLEAN(I2C3)
#error "I2C3 must have a value of 0, 1, or be undefined"
#endif

#ifndef I2C4
#define I2C4 0
#elif !ISBOOLEAN(I2C4)
#error "I2C4 must have a value of 0, 1, or be undefined"
#endif

#ifdef __CPU_IMXRT117X

#ifndef I2C5
#define I2C5 0
#elif !ISBOOLEAN(I2C5)
#error "I2C5 must have a value of 0, 1, or be undefined"
#endif

#ifndef I2C6
#define I2C6 0
#elif !ISBOOLEAN(I2C6)
#error "I2C6 must have a value of 0, 1, or be undefined"
#endif

#endif /* #ifdef __CPU_IMXRT117X */

#ifndef I2C1_PUSHPULL
#define I2C1_PUSHPULL 0
#endif

#ifndef I2C2_PUSHPULL
#define I2C2_PUSHPULL 0
#endif

#ifndef I2C3_PUSHPULL
#define I2C3_PUSHPULL 0
#endif

#ifndef I2C4_PUSHPULL
#define I2C4_PUSHPULL 0
#endif

#ifndef I2C5_PUSHPULL
#define I2C5_PUSHPULL 0
#endif

#ifndef I2C6_PUSHPULL
#define I2C6_PUSHPULL 0
#endif

#ifndef I2C1_SPEED
#define I2C1_SPEED i2c_speed_slow
#endif

#ifndef I2C2_SPEED
#define I2C2_SPEED i2c_speed_slow
#endif

#ifndef I2C3_SPEED
#define I2C3_SPEED i2c_speed_slow
#endif

#ifndef I2C4_SPEED
#define I2C4_SPEED i2c_speed_slow
#endif

#ifndef I2C5_SPEED
#define I2C5_SPEED i2c_speed_slow
#endif

#ifndef I2C6_SPEED
#define I2C6_SPEED i2c_speed_slow
#endif


/* TRNG */

#ifndef __CPU_IMXRT117X

#ifndef TRNG
#define TRNG 0
#endif
Expand Down
Loading
Loading