Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
TFT_eSPI
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
TFT_eSPI
Commits
64a45f6e
Unverified
Commit
64a45f6e
authored
Dec 11, 2021
by
Bodmer
Committed by
GitHub
Dec 11, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1241 from matixan/master
Add option to use SPI3 in STM32F4 (and possibly also in F2)
parents
bcce0fc7
afd78101
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
Processors/TFT_eSPI_STM32.c
Processors/TFT_eSPI_STM32.c
+8
-1
Processors/TFT_eSPI_STM32.h
Processors/TFT_eSPI_STM32.h
+7
-0
No files found.
Processors/TFT_eSPI_STM32.c
View file @
64a45f6e
...
@@ -551,6 +551,9 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t
...
@@ -551,6 +551,9 @@ void TFT_eSPI::pushImageDMA(int32_t x, int32_t y, int32_t w, int32_t h, uint16_t
#elif (TFT_SPI_PORT == 2)
#elif (TFT_SPI_PORT == 2)
extern
"C"
void
DMA1_Stream4_IRQHandler
();
extern
"C"
void
DMA1_Stream4_IRQHandler
();
void
DMA1_Stream4_IRQHandler
(
void
)
void
DMA1_Stream4_IRQHandler
(
void
)
#elif (TFT_SPI_PORT == 3)
extern
"C"
void
DMA1_Stream5_IRQHandler
();
void
DMA1_Stream5_IRQHandler
(
void
)
#endif
#endif
{
{
// Call the default end of buffer handler
// Call the default end of buffer handler
...
@@ -572,8 +575,12 @@ bool TFT_eSPI::initDMA(bool ctrl_cs)
...
@@ -572,8 +575,12 @@ bool TFT_eSPI::initDMA(bool ctrl_cs)
__HAL_RCC_DMA2_CLK_ENABLE
();
// Enable DMA2 clock
__HAL_RCC_DMA2_CLK_ENABLE
();
// Enable DMA2 clock
dmaHal
.
Init
.
Channel
=
DMA_CHANNEL_3
;
// DMA channel 3 is for SPI1 TX
dmaHal
.
Init
.
Channel
=
DMA_CHANNEL_3
;
// DMA channel 3 is for SPI1 TX
#elif (TFT_SPI_PORT == 2)
#elif (TFT_SPI_PORT == 2)
__HAL_RCC_DMA1_CLK_ENABLE
();
// Enable DMA
2
clock
__HAL_RCC_DMA1_CLK_ENABLE
();
// Enable DMA
1
clock
dmaHal
.
Init
.
Channel
=
DMA_CHANNEL_0
;
// DMA channel 0 is for SPI2 TX
dmaHal
.
Init
.
Channel
=
DMA_CHANNEL_0
;
// DMA channel 0 is for SPI2 TX
#elif (TFT_SPI_PORT == 3)
__HAL_RCC_DMA1_CLK_ENABLE
();
// Enable DMA1 clock
dmaHal
.
Init
.
Channel
=
DMA_CHANNEL_0
;
// DMA channel 0 is for SPI3 TX
#endif
#endif
dmaHal
.
Init
.
Mode
=
DMA_NORMAL
;
//DMA_CIRCULAR; // // Normal = send buffer once
dmaHal
.
Init
.
Mode
=
DMA_NORMAL
;
//DMA_CIRCULAR; // // Normal = send buffer once
...
...
Processors/TFT_eSPI_STM32.h
View file @
64a45f6e
...
@@ -170,6 +170,13 @@
...
@@ -170,6 +170,13 @@
// The DMA hard-coding for SPI2 is in TFT_eSPI_STM32.c as follows:
// The DMA hard-coding for SPI2 is in TFT_eSPI_STM32.c as follows:
// DMA_CHANNEL_4
// DMA_CHANNEL_4
// DMA1_Stream4_IRQn and DMA1_Stream4_IRQHandler()
// DMA1_Stream4_IRQn and DMA1_Stream4_IRQHandler()
#elif (TFT_SPI_PORT == 3)
// Initialise processor specific SPI and DMA instances - used by init()
#define INIT_TFT_DATA_BUS spiHal.Instance = SPI3; \
dmaHal.Instance = DMA1_Stream5
// The DMA hard-coding for SPI3 is in TFT_eSPI_STM32.c as follows:
// DMA_CHANNEL_4
// DMA1_Stream5_IRQn and DMA1_Stream5_IRQHandler()
#endif
#endif
#elif defined (STM32F1xx)
#elif defined (STM32F1xx)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment