Skip to content

Commit

Permalink
s32k1xx:LPI2C Add DMA support
Browse files Browse the repository at this point in the history
s32k3xx:LPI2C fix RESET so it compiles
  • Loading branch information
davids5 authored and xiaoxiang781216 committed Dec 3, 2022
1 parent 34d2cde commit da7fe76
Show file tree
Hide file tree
Showing 3 changed files with 594 additions and 34 deletions.
1 change: 1 addition & 0 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ config ARCH_CHIP_S32K3XX
select ARCH_HAVE_MPU
select ARCH_HAVE_RAMFUNCS
select ARM_HAVE_MPU_UNIFIED
select ARCH_HAVE_I2CRESET
---help---
NPX S32K3XX architectures (ARM Cortex-M7).

Expand Down
64 changes: 63 additions & 1 deletion arch/arm/src/s32k3xx/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1210,13 +1210,70 @@ config S32K3XX_LPSPI5_PINCFG

endmenu # LPSPI Configuration

menu "LPI2C Configuration"
depends on S32K3XX_LPI2C

config S32K3XX_LPI2C_DMA
bool "I2C DMA Support"
default n
depends on S32K3XX_LPI2C && S32K3XX_EDMA && !I2C_POLLED
---help---
This option enables the DMA for I2C transfers.
Note: The user can define CONFIG_I2C_DMAPRIO: a custom priority value
for the I2C dma streams, else the default priority level is set to
medium.

config S32K3XX_LPI2C_DMA_MAXMSG
int "Maximum number messages that will be DMAed"
default 8
depends on S32K3XX_LPI2C_DMA
---help---
This option set the mumber of mesg that can be in a transfer.
It is used to allocate space for the 16 bit LPI2C commands
that will be DMA-ed to the LPI2C device.

config S32K3XX_LPI2C_DYNTIMEO
bool "Use dynamic timeouts"
default n
depends on S32K3XX_LPI2C

config S32K3XX_LPI2C_DYNTIMEO_USECPERBYTE
int "Timeout Microseconds per Byte"
default 500
depends on S32K3XX_LPI2C_DYNTIMEO

config S32K3XX_LPI2C_DYNTIMEO_STARTSTOP
int "Timeout for Start/Stop (Milliseconds)"
default 1000
depends on S32K3XX_LPI2C_DYNTIMEO

config S32K3XX_LPI2C_TIMEOSEC
int "Timeout seconds"
default 0
depends on S32K3XX_LPI2C

config S32K3XX_LPI2C_TIMEOMS
int "Timeout Milliseconds"
default 500
depends on S32K3XX_LPI2C && !S32K3XX_LPI2C_DYNTIMEO

config S32K3XX_LPI2C_TIMEOTICKS
int "Timeout for Done and Stop (ticks)"
default 500
depends on S32K3XX_LPI2C && !S32K3XX_LPI2C_DYNTIMEO

menu "LPI2C0 Configuration"
depends on S32K3XX_LPI2C0

config LPI2C0_BUSYIDLE
int "Bus idle timeout period in clock cycles"
default 0

config LPI2C0_DMA
bool "Enable DMA for I2C0"
default n
depends on S32K3XX_LPI2C_DMA

config LPI2C0_FILTSCL
int "I2C master digital glitch filters for SCL input in clock cycles"
default 0
Expand All @@ -1234,6 +1291,11 @@ config LPI2C1_BUSYIDLE
int "Bus idle timeout period in clock cycles"
default 0

config LPI2C1_DMA
bool "Enable DMA for I2C1"
default n
depends on S32K3XX_LPI2C_DMA

config LPI2C1_FILTSCL
int "I2C master digital glitch filters for SCL input in clock cycles"
default 0
Expand All @@ -1243,7 +1305,7 @@ config LPI2C1_FILTSDA
default 0

endmenu # LPI2C1 Configuration

endmenu # LPI2C Configuration

menu "LPUART Configuration"
depends on S32K3XX_LPUART
Expand Down
Loading

0 comments on commit da7fe76

Please sign in to comment.