Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
fwatch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
8
Issues
8
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
fwatch
Commits
6e5bbba4
Commit
6e5bbba4
authored
Jul 23, 2014
by
Xavier Piroux
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing SPI specificities for freewatch
parent
be80626c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
spi.c
sw/os-comparison/freertos_blink_fat/src/media-drv/sd/spi.c
+11
-2
No files found.
sw/os-comparison/freertos_blink_fat/src/media-drv/sd/spi.c
View file @
6e5bbba4
...
...
@@ -47,12 +47,14 @@ int slaveRxBufferSize;
volatile
int
slaveRxBufferIndex
;
/**************************************************************************//**
* @brief Setup a USART as SPI
* @param spiNumber is the number of the USART to use (e.g. 1 USART1)
* @param location is the GPIO location to use for the device
* @param master set if the SPI is to be master
*
* For the freewatch, init of SD => SPI_setup(1, 1, 1);
* For the freewatch, init of LCD => SPI_setup(2, 0, 1);
*****************************************************************************/
void
SPI_setup
(
uint8_t
spiNumber
,
uint8_t
location
,
bool
master
)
{
...
...
@@ -161,7 +163,7 @@ void SPI_setup(uint8_t spiNumber, uint8_t location, bool master)
{
case
0
:
/* IO configuration (USART 2, Location #0) */
GPIO_PinModeSet
(
gpioPortC
,
2
,
gpioModeMosi
,
0
);
/* MOSI */
GPIO_PinModeSet
(
gpioPortC
,
3
,
gpioModeMiso
,
0
);
/* MISO */
//GPIO_PinModeSet(gpioPortC, 3, gpioModeMiso, 0); /* MISO */ //LCD doesn't have any output
GPIO_PinModeSet
(
gpioPortC
,
5
,
gpioModeCs
,
0
);
/* CS */
GPIO_PinModeSet
(
gpioPortC
,
4
,
gpioModeClk
,
0
);
/* Clock */
break
;
...
...
@@ -298,4 +300,11 @@ void USART0_TX_IRQHandler(void)
}
}
#if 0
void USART0_Wait_TX_finished(void) {
USART_TypeDef *spi = USART0;
while(!(spi->STATUS & USART_STATUS_TXC));
}
#endif
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