Hello World
Kleines Projekt auf dem SP601 Board
// // Minimales SpartanMC System "hello world" // #include <system/peripherals.h> #include <uart.h> #include <stdio.h> /* * Testprogramm "hello world" */ int main() { // Initialisierung der UART oder der UART_light #ifndef SB_UART_LIGHT_0_INTERRUPT_SUPPORTED uart_wait_idle(UART_0); UART_0->ctrl_stat = (UART_BPS_115200|UART_DATA_LEN_8|UART_TWO_STOP|UART_RX_EN|UART_TX_EN); stdio_uart_open(UART_0); #else stdio_uart_open(UART_LIGHT_0); #endif // Initialisierung beendet printf("hello world\r\n"); while (1); }
printf("Hello World\r\n");
ein Beispiel aus demQuick Guide für den SpartanMC SoC