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
88879557
Commit
88879557
authored
Jul 31, 2014
by
Xavier Piroux
Committed by
Projects
Sep 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
preparing for testing the SD
parent
70da90fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
19 deletions
+10
-19
sd.c
sw/common/drivers/sd.c
+1
-1
simple_spi_sd.c
sw/os-comparison/simple_spi_sd/src/simple_spi_sd.c
+9
-18
No files found.
sw/common/drivers/sd.c
View file @
88879557
...
...
@@ -117,7 +117,7 @@ static void sd_spi_transfer(uint8_t* txData, uint8_t* rxData, int length) {
rxData
[
i
]
=
sd_spi_transfer_byte
(
txData
[
i
]);
}
}
//this function writes only
//this function writes only
, but can be more efficient if bytes are aligned at 16 bits
static
void
sd_spi_transmit
(
uint8_t
*
txBuffer
,
int
length
)
{
while
(
length
>
0
)
{
// Send only one byte if len==1 or data pointer is not aligned at a 16 bit
...
...
sw/os-comparison/simple_spi_sd/src/simple_spi_sd.c
View file @
88879557
...
...
@@ -89,10 +89,6 @@ int main(void)
CMU_ClockEnable
(
cmuClock_GPIO
,
true
);
//init SPI for microSD
//SPI_setup(1, 1, 1);
/* Enabling clock to USART 1*/
//CMU_ClockEnable(cmuClock_USART1, true);
//sd_vol0_set_electrical_power(1);
sd_spi_init_not_static
();
sd_power
(
1
);
...
...
@@ -102,23 +98,18 @@ int main(void)
/* Infinite blink loop */
while
(
1
)
{
//GPIO_PinOutToggle(gpioPortD, 2);
//GPIO_PinOutToggle(gpioPortD, 0);
//GPIO_PinOutToggle(gpioPortD, 0);
//GPIO_PinOutToggle(gpioPortD, 3);
//GPIO_PinOutToggle(gpioPortD, 3);
//char c[2] = { 0b00001111 , 0b01010101 };
//USART1_sendBuffer(&c[0], 1);
//USART1_sendBuffer(&c[1], 1);
//sd_send_data_00001111();
//sd_send_data_01010101();
//this code is ok but not what we want (it only test spi protocol, we want now to test the SD)
//res = sd_spi_transfer_byte(0b00001111);
//res = sd_spi_transfer_byte(0b01010101);
//res = sd_spi_transfer_byte(0b00110011);
//send dummy stuff
res
=
sd_spi_transfer_byte
(
0xFF
);
res
++
;
Delay
(
1
);
for
(
i
=
11
;
i
<
13
;
++
i
)
{
GPIO_PinOutToggle
(
gpioPortE
,
i
);
res
=
sd_spi_transfer_byte
(
0
b00001111
);
res
=
sd_spi_transfer_byte
(
0
b01010101
);
res
=
sd_spi_transfer_byte
(
0
b00110011
);
res
++
;
Delay
(
2
);
Delay
(
1
);
}
}
return
0
;
...
...
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