work on spi. added init for SPI1

interrupts
polymurph 3 years ago
parent 61e24b8647
commit 7bb9df0f2f

@ -53,6 +53,8 @@ int main(int argc, char *argv[])
pinConfig(pinA0, input, def_stage, pullDown, def_speed);
setupInit(); // This is the sescond call of System init the assebly start code is calling it before the main.
usartInit( usart2,
pinA2,
pinA15,
@ -67,14 +69,21 @@ int main(int argc, char *argv[])
//blinks 10 times to indicate the sicsessfull init if the device
for(i = 0 ; i < 10 ; i++)
{
for(i = 0 ; i < 10 ; i++) {
delayMs(100);
pinToggle(pinB3);
delayMs(100);
}
pinWrite(pinB3,0);
pinInit(pinA5);
pinInit(pinA6);
pinInit(pinA7);
pinSetAlternate(pinA5, 0); // SPI1_SCK
pinSetAlternate(pinA6, 0); // SPI1_MISO
pinSetAlternate(pinA7, 0); // SPI1_MOSI
spi_init(SPI_CH_1);
for(i = 10; i > 0; i--) {

Loading…
Cancel
Save