diff options
author | Harald Welte <laforge@gnumonks.org> | 2012-08-20 00:26:19 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2012-08-20 00:26:19 +0200 |
commit | 5566fde5a951461ec7c901b02e478ad50e71706e (patch) | |
tree | 14e4c57e2bd7806f3448f7cbbb46ce4315575c2a /src | |
parent | c23568f39b7c7fa43e5bdfc08deb6e33966033cf (diff) |
main: just print characters on the SPI UART (at least try to)
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -4,6 +4,8 @@ #include "cc32/cc32_flcon.h" #include "cc32/cc32_irq.h" +#include "cc32/cc32_gpio.h" +#include "cc32/cc32_spi.h" #include "cc32/iso7816_slave.h" #define BASE_ISO7816_SLAVE 0x0F8800 @@ -12,8 +14,31 @@ const uint8_t atr[] = "ThisIsNotAnATR\n"; int main(int argc, char **argv) { + uint8_t ch = '0'; + /* we generally don't want interrupts yet */ cc32_irq_disable(IRQ_FLCON | IRQ_UART); + + cc32_gpio_init(); +#if 0 + /* red led: works, but not bright enough */ + cc32_gpio_output(43 , 1); + cc32_gpio_set(43 , 0); +#endif + + /* initialize the SPI based UART */ + cc32_spi_init(0,0,8); + uart_sc16is740_init(); + + while (1) { + uart_sc16is740_putchar(ch); + if (ch >= '9') + ch = '0'; + else + ch++; + }; + +#if 0 char *atr2 = "12345"; iso7816_slave_init(); @@ -39,4 +64,5 @@ int main(int argc, char **argv) while (1) { //cc32_flash_erase(10*256, 256); } +#endif } |