Add at91sam7x bertos example.
authorasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 27 Apr 2009 09:43:02 +0000 (09:43 +0000)
committerasterix <asterix@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 27 Apr 2009 09:43:02 +0000 (09:43 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2670 38d2e660-2303-0410-9eaa-f027e97ec537

examples/at91sam7x/at91sam7s.mk [new file with mode: 0644]
examples/at91sam7x/at91sam7x.c [new file with mode: 0644]
examples/at91sam7x/at91sam7x.mk [new file with mode: 0644]
examples/at91sam7x/cfg/cfg_monitor.h [new file with mode: 0644]
examples/at91sam7x/cfg/cfg_proc.h [new file with mode: 0644]
examples/at91sam7x/cfg/cfg_sem.h [new file with mode: 0644]
examples/at91sam7x/cfg/cfg_ser.h [new file with mode: 0644]
examples/at91sam7x/cfg/cfg_signal.h [new file with mode: 0644]
examples/at91sam7x/cfg/cfg_timer.h [new file with mode: 0644]
examples/at91sam7x/hw/hw_ser.h [new file with mode: 0644]
examples/at91sam7x/verstag.h [new file with mode: 0644]

diff --git a/examples/at91sam7x/at91sam7s.mk b/examples/at91sam7x/at91sam7s.mk
new file mode 100644 (file)
index 0000000..2a3bcfc
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# $Id: at91sam7x.mk 18234 2007-10-08 13:39:48Z rasky $
+# Copyright 2006 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# Makefile fragment for DevLib at91sam7x application.
+#
+# Author: Bernie Innocenti <bernie@codewiz.org>
+#
+#
+
+# Set to 1 for debug builds
+at91sam7x_DEBUG = 1
+
+# Our target application
+TRG += at91sam7x
+
+at91sam7x_CSRC = \
+       examples/at91sam7x/at91sam7x.c \
+       bertos/drv/timer.c \
+       bertos/drv/ser.c \
+       bertos/cpu/arm/drv/sysirq_at91.c \
+       bertos/cpu/arm/drv/ser_at91.c \
+       bertos/cpu/arm/drv/timer_at91.c \
+       bertos/mware/event.c \
+       bertos/mware/formatwr.c \
+       bertos/mware/hex.c \
+       bertos/kern/kfile.c \
+       bertos/kern/proc.c \
+       bertos/kern/coop.c \
+       bertos/kern/proc_test.c \
+       bertos/kern/monitor.c \
+       bertos/kern/signal.c \
+       #
+
+at91sam7x_CPPASRC = \
+       bertos/cpu/arm/hw/crtat91sam7_rom.S \
+       bertos/cpu/arm/hw/switch_ctx_arm.S \
+       #
+
+at91sam7x_PREFIX = arm-none-eabi-
+
+at91sam7x_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug
+at91sam7x_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7X256__ -D'CPU_FREQ=(48023000UL)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -Iexamples/at91sam7x -Ibertos/cpu/arm
+at91sam7x_LDFLAGS = -nostartfiles -T bertos/cpu/arm/scripts/at91sam7_256_rom.ld -Wl,--no-warn-mismatch
+
+at91sam7x_CPU = arm7tdmi
+
diff --git a/examples/at91sam7x/at91sam7x.c b/examples/at91sam7x/at91sam7x.c
new file mode 100644 (file)
index 0000000..aaec740
--- /dev/null
@@ -0,0 +1,157 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2009 Develer S.r.l. (http://www.develer.com/)\r
+ *\r
+ * -->\r
+ *\r
+ * \version $Id: at91sam7s.c 2663 2009-04-24 16:30:11Z asterix $\r
+ *\r
+ * \author Francesco Sacchi <batt@develer.com>\r
+ * \author Daniele Basile <asterix@develer.com>\r
+ *\r
+ * \brief Simple BeRTOS test on AT91SAM7X-EK evaluation board.\r
+ * \r
+ * This short program shows you a simple demo of some BeRTOS feature:\r
+ * \r
+ * - Debug system\r
+ * - Timer interrupt\r
+ * - Serial\r
+ * - Cooperative BeRTOS Kernel\r
+ * \r
+ */\r
+\r
+#include "cfg/cfg_ser.h"\r
+#include <cfg/macros.h>\r
+\r
+#include <kern/proc.h>\r
+\r
+#include <drv/timer.h>\r
+#include <drv/sysirq_at91.h>\r
+#include <drv/ser.h>\r
+\r
+#include <io/arm.h>\r
+\r
+Timer leds_timer;\r
+Serial ser_fd;\r
+int roll = 0;\r
+\r
+/*\r
+ * Supercar leds effect..\r
+ */\r
+static void leds_toggle(void)\r
+{\r
+       uint32_t a = (~PIOB_ODSR & 0x780000);\r
+\r
+       // Turn on led in forward direction\r
+       if (roll == 1)\r
+       {\r
+               if(a == 0x200000)\r
+                       roll = 2;\r
+\r
+               PIOB_SODR = a;\r
+               PIOB_CODR = a << 1;\r
+       }\r
+       // Turn on led in backward direction\r
+       else if (roll == 2)\r
+       {\r
+               if(a == 0x100000)\r
+                       roll = 1;\r
+\r
+               PIOB_SODR = a;\r
+               PIOB_CODR = a >> 1;\r
+       }\r
+       // Start to turn on first led\r
+       else\r
+       {\r
+               PIOB_SODR  = 0x780000;\r
+               /* turn first led on */\r
+               PIOB_CODR  = 0x80000;\r
+               roll = 1;\r
+       }\r
+\r
+       /* Wait for interval time */\r
+       timer_setDelay(&leds_timer, ms_to_ticks(100));\r
+       timer_add(&leds_timer);\r
+}\r
+\r
+int main(void)\r
+{      char msg[]="BeRTOS, be fast be beatiful be realtime";\r
+\r
+\r
+       kdbg_init();\r
+       timer_init();\r
+       proc_init();\r
+\r
+       ASSERT(!IRQ_ENABLED());\r
+\r
+       /* Open the main communication port */\r
+       ser_init(&ser_fd, 0);\r
+       ser_setbaudrate(&ser_fd, 115200);\r
+       ser_setparity(&ser_fd, SER_PARITY_NONE);\r
+\r
+       IRQ_ENABLE;\r
+       ASSERT(IRQ_ENABLED());\r
+\r
+       /* Disable all pullups */\r
+       PIOB_PUDR = 0xffffffff;\r
+       /* Set PB0..3 connected to PIOA */\r
+       PIOB_PER  = 0x780000;\r
+       /* Set PB0..3 as output */\r
+       PIOB_OER  = 0x780000;\r
+       /* Disable multidrive on all pins */\r
+       PIOB_MDDR = 0xffffffff;\r
+\r
+       /* Set PA0..3 to 1 to turn off leds */\r
+       PIOB_SODR  = 0x780000;\r
+       \r
+       /* turn first led on */\r
+       PIOB_CODR  = 0x80000;\r
+\r
+       /*\r
+        * Register timer and arm timer interupt.\r
+        */\r
+       timer_setSoftint(&leds_timer, (Hook)leds_toggle, 0);\r
+       timer_setDelay(&leds_timer, ms_to_ticks(100));\r
+       timer_add(&leds_timer);\r
+\r
+       /*\r
+        * Run process test.\r
+        */\r
+       if(!proc_testRun())\r
+               kfile_printf(&ser_fd.fd, "ProcTest..ok!\n");\r
+       else\r
+               kfile_printf(&ser_fd.fd, "ProcTest..FAIL!\n");\r
+\r
+       // Main loop\r
+       for(;;)\r
+       {\r
+               kfile_printf(&ser_fd.fd, "From serial 0: %s\r\n", msg);\r
+       }\r
+       return 0;\r
+}\r
diff --git a/examples/at91sam7x/at91sam7x.mk b/examples/at91sam7x/at91sam7x.mk
new file mode 100644 (file)
index 0000000..2a3bcfc
--- /dev/null
@@ -0,0 +1,48 @@
+#
+# $Id: at91sam7x.mk 18234 2007-10-08 13:39:48Z rasky $
+# Copyright 2006 Develer S.r.l. (http://www.develer.com/)
+# All rights reserved.
+#
+# Makefile fragment for DevLib at91sam7x application.
+#
+# Author: Bernie Innocenti <bernie@codewiz.org>
+#
+#
+
+# Set to 1 for debug builds
+at91sam7x_DEBUG = 1
+
+# Our target application
+TRG += at91sam7x
+
+at91sam7x_CSRC = \
+       examples/at91sam7x/at91sam7x.c \
+       bertos/drv/timer.c \
+       bertos/drv/ser.c \
+       bertos/cpu/arm/drv/sysirq_at91.c \
+       bertos/cpu/arm/drv/ser_at91.c \
+       bertos/cpu/arm/drv/timer_at91.c \
+       bertos/mware/event.c \
+       bertos/mware/formatwr.c \
+       bertos/mware/hex.c \
+       bertos/kern/kfile.c \
+       bertos/kern/proc.c \
+       bertos/kern/coop.c \
+       bertos/kern/proc_test.c \
+       bertos/kern/monitor.c \
+       bertos/kern/signal.c \
+       #
+
+at91sam7x_CPPASRC = \
+       bertos/cpu/arm/hw/crtat91sam7_rom.S \
+       bertos/cpu/arm/hw/switch_ctx_arm.S \
+       #
+
+at91sam7x_PREFIX = arm-none-eabi-
+
+at91sam7x_CPPAFLAGS = -O0 -g -gdwarf-2 -g -gen-debug
+at91sam7x_CPPFLAGS = -O0 -D'ARCH=0' -D__ARM_AT91SAM7X256__ -D'CPU_FREQ=(48023000UL)' -D'WIZ_AUTOGEN' -g3 -gdwarf-2 -fverbose-asm -Iexamples/at91sam7x -Ibertos/cpu/arm
+at91sam7x_LDFLAGS = -nostartfiles -T bertos/cpu/arm/scripts/at91sam7_256_rom.ld -Wl,--no-warn-mismatch
+
+at91sam7x_CPU = arm7tdmi
+
diff --git a/examples/at91sam7x/cfg/cfg_monitor.h b/examples/at91sam7x/cfg/cfg_monitor.h
new file mode 100644 (file)
index 0000000..5e97031
--- /dev/null
@@ -0,0 +1,48 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)\r
+ * Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>\r
+ * -->\r
+ *\r
+ * \brief Kernel monitor configuration parameters\r
+ *\r
+ * \version $Id: cfg_monitor.h 2429 2009-03-25 16:30:24Z batt $\r
+ * \author Bernie Innocenti <bernie@codewiz.org>\r
+ */\r
+\r
+#ifndef CFG_MONITOR_H\r
+#define CFG_MONITOR_H\r
+\r
+/**\r
+ * Process monitor.\r
+ * $WIZ$ type = "autoenabled"\r
+ */\r
+#define CONFIG_KERN_MONITOR 1\r
+\r
+#endif /*  CFG_MONITOR_H */\r
diff --git a/examples/at91sam7x/cfg/cfg_proc.h b/examples/at91sam7x/cfg/cfg_proc.h
new file mode 100644 (file)
index 0000000..7f818f4
--- /dev/null
@@ -0,0 +1,100 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)\r
+ * Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>\r
+ * -->\r
+ *\r
+ * \brief Kernel configuration parameters\r
+ *\r
+ * \version $Id: cfg_proc.h 2659 2009-04-24 09:28:30Z batt $\r
+ * \author Bernie Innocenti <bernie@codewiz.org>\r
+ */\r
+\r
+#ifndef CFG_PROC_H\r
+#define CFG_PROC_H\r
+\r
+/**\r
+ * Enable the multithreading kernel.\r
+ *\r
+ * $WIZ$ type = "autoenabled"\r
+ */\r
+#define CONFIG_KERN 1\r
+\r
+/**\r
+ * Kernel interrupt supervisor.\r
+ * $WIZ$ type = "boolean"\r
+ */\r
+#define CONFIG_KERN_IRQ 0\r
+\r
+/**\r
+ * Dynamic memory allocation for processes.\r
+ *\r
+ * $WIZ$ type = "boolean"\r
+ * $WIZ$ supports = "False"\r
+ */\r
+#define CONFIG_KERN_HEAP 0\r
+\r
+/**\r
+ * Preemptive process scheduling. WARNING: Experimental, still incomplete!\r
+ *\r
+ * $WIZ$ type = "boolean"\r
+ */\r
+#define CONFIG_KERN_PREEMPT 0\r
+\r
+/**\r
+ * Priority-based scheduling policy.\r
+ * $WIZ$ type = "boolean"\r
+ */\r
+#define CONFIG_KERN_PRI 0\r
+\r
+/**\r
+ * Time sharing quantum (a prime number prevents interference effects) [ms].\r
+ *\r
+ * $WIZ$ type = "int"\r
+ * $WIZ$ min = "0"\r
+ */\r
+#define CONFIG_KERN_QUANTUM 47\r
+\r
+/**\r
+ * Module logging level.\r
+ *\r
+ * $WIZ$ type = "enum"\r
+ * $WIZ$ value_list = "log_level"\r
+ */\r
+#define KERN_LOG_LEVEL LOG_LVL_ERR\r
+\r
+/**\r
+ * Module logging format.\r
+ *\r
+ * $WIZ$ type = "enum"\r
+ * $WIZ$ value_list = "log_format"\r
+ */\r
+#define KERN_LOG_FORMAT LOG_FMT_VERBOSE\r
+\r
+#endif /*  CFG_PROC_H */\r
diff --git a/examples/at91sam7x/cfg/cfg_sem.h b/examples/at91sam7x/cfg/cfg_sem.h
new file mode 100644 (file)
index 0000000..6e3cfab
--- /dev/null
@@ -0,0 +1,48 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)\r
+ * Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>\r
+ * -->\r
+ *\r
+ * \brief Kernel semaphores configuration parameters.\r
+ *\r
+ * \version $Id: cfg_sem.h 2429 2009-03-25 16:30:24Z batt $\r
+ * \author Bernie Innocenti <bernie@codewiz.org>\r
+ */\r
+\r
+#ifndef CFG_SEM_H\r
+#define CFG_SEM_H\r
+\r
+/**\r
+ * Re-entrant mutual exclusion primitives.\r
+ * $WIZ$ type = "autoenabled"\r
+ */\r
+#define CONFIG_KERN_SEMAPHORES  1\r
+\r
+#endif /*  CFG_SEM_H */\r
diff --git a/examples/at91sam7x/cfg/cfg_ser.h b/examples/at91sam7x/cfg/cfg_ser.h
new file mode 100644 (file)
index 0000000..a00ab85
--- /dev/null
@@ -0,0 +1,107 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)\r
+ * All Rights Reserved.\r
+ * -->\r
+ *\r
+ * \brief Configuration file for serial module.\r
+ *\r
+ * \version $Id: cfg_ser.h 2571 2009-04-20 10:37:07Z batt $\r
+ *\r
+ * \author Daniele Basile <asterix@develer.com>\r
+ */\r
+\r
+#ifndef CFG_SER_H\r
+#define CFG_SER_H\r
+\r
+/**\r
+ * Example of setting for serial port and\r
+ * spi port.\r
+ * Edit these define for your project.\r
+ */\r
+\r
+/// [bytes] Size of the outbound FIFO buffer for port 0.\r
+#define CONFIG_UART0_TXBUFSIZE  32\r
+\r
+/// [bytes] Size of the inbound FIFO buffer for port 0.\r
+#define CONFIG_UART0_RXBUFSIZE  32\r
+\r
+/// [bytes] Size of the outbound FIFO buffer for port 1.\r
+#define CONFIG_UART1_TXBUFSIZE  32\r
+\r
+/// [bytes] Size of the inbound FIFO buffer for port 1.\r
+#define CONFIG_UART1_RXBUFSIZE  32\r
+\r
+\r
+/// [bytes] Size of the outbound FIFO buffer for SPI port (AVR only)\r
+#define CONFIG_SPI_TXBUFSIZE    32\r
+\r
+/// [bytes] Size of the inbound FIFO buffer for SPI port (AVR only)\r
+#define CONFIG_SPI_RXBUFSIZE    32\r
+\r
+/// [bytes] Size of the outbound FIFO buffer for SPI port 0.\r
+#define CONFIG_SPI0_TXBUFSIZE  32\r
+\r
+/// [bytes] Size of the inbound FIFO buffer for SPI port 0.\r
+#define CONFIG_SPI0_RXBUFSIZE  32\r
+\r
+/// [bytes] Size of the outbound FIFO buffer for SPI port 1.\r
+#define CONFIG_SPI1_TXBUFSIZE  32\r
+\r
+/// [bytes] Size of the inbound FIFO buffer for SPI port 1.\r
+#define CONFIG_SPI1_RXBUFSIZE  32\r
+\r
+/// SPI data order (AVR only).\r
+#define CONFIG_SPI_DATA_ORDER  SER_MSB_FIRST\r
+\r
+/// SPI clock division factor (AVR only).\r
+#define CONFIG_SPI_CLOCK_DIV   16\r
+\r
+/// SPI clock polarity: 0 = normal low, 1 = normal high (AVR only).\r
+#define CONFIG_SPI_CLOCK_POL   0\r
+\r
+/// SPI clock phase: 0 = sample on first edge, 1 = sample on second clock edge (AVR only).\r
+#define CONFIG_SPI_CLOCK_PHASE 0\r
+\r
+/// Default transmit timeout (ms). Set to -1 to disable timeout support.\r
+#define CONFIG_SER_TXTIMEOUT    -1\r
+\r
+/// Default receive timeout (ms). Set to -1 to disable timeout support.\r
+#define CONFIG_SER_RXTIMEOUT    -1\r
+\r
+/// Use RTS/CTS handshake\r
+#define CONFIG_SER_HWHANDSHAKE   0\r
+\r
+/// Default baud rate (set to 0 to disable).\r
+#define CONFIG_SER_DEFBAUDRATE   0\r
+\r
+/// For serial debug.\r
+#define CONFIG_SER_STROBE        0\r
+\r
+#endif /* CFG_SER_H */\r
diff --git a/examples/at91sam7x/cfg/cfg_signal.h b/examples/at91sam7x/cfg/cfg_signal.h
new file mode 100644 (file)
index 0000000..86feb72
--- /dev/null
@@ -0,0 +1,48 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2001, 2004 Develer S.r.l. (http://www.develer.com/)\r
+ * Copyright 1999, 2000, 2001, 2008 Bernie Innocenti <bernie@codewiz.org>\r
+ * -->\r
+ *\r
+ * \brief Kernel signals configuration parameters\r
+ *\r
+ * \version $Id: cfg_signal.h 2429 2009-03-25 16:30:24Z batt $\r
+ * \author Bernie Innocenti <bernie@codewiz.org>\r
+ */\r
+\r
+#ifndef CFG_SIGNAL_H\r
+#define CFG_SIGNAL_H\r
+\r
+/**\r
+ * Inter-process signals.\r
+ * $WIZ$ type = "autoenabled"\r
+ */\r
+#define CONFIG_KERN_SIGNALS 1\r
+\r
+#endif /*  CFG_SIGNAL_H */\r
diff --git a/examples/at91sam7x/cfg/cfg_timer.h b/examples/at91sam7x/cfg/cfg_timer.h
new file mode 100644 (file)
index 0000000..ac66bef
--- /dev/null
@@ -0,0 +1,55 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2008 Develer S.r.l. (http://www.develer.com/)\r
+ * All Rights Reserved.\r
+ * -->\r
+ *\r
+ * \brief Configuration file for timer module.\r
+ *\r
+ * \version $Id: cfg_timer.h 1969 2008-12-03 16:23:56Z asterix $\r
+ *\r
+ * \author Daniele Basile <asterix@develer.com>\r
+ */\r
+\r
+#ifndef CFG_TIMER_H\r
+#define CFG_TIMER_H\r
+\r
+/// Hardware timer selection for drv/timer.c\r
+#define CONFIG_TIMER TIMER_DEFAULT\r
+\r
+/// Debug timer interrupt using a strobe pin.\r
+#define CONFIG_TIMER_STROBE  0\r
+\r
+/// Enable asynchronous timers\r
+#define CONFIG_TIMER_EVENTS  1\r
+\r
+/// Support hi-res timer_usleep()\r
+#define CONFIG_TIMER_UDELAY  1\r
+\r
+#endif /* CFG_TIMER_H */\r
diff --git a/examples/at91sam7x/hw/hw_ser.h b/examples/at91sam7x/hw/hw_ser.h
new file mode 100644 (file)
index 0000000..0a87ec1
--- /dev/null
@@ -0,0 +1,40 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2006 Develer S.r.l. (http://www.develer.com/)\r
+ * All Rights Reserved.\r
+ * -->\r
+ *\r
+ * \brief Serial hardware-specific definitions\r
+ *\r
+ * \version $Id: hw_ser.h 982 2007-11-07 16:32:20Z batt $\r
+ *\r
+ * \author Daniele Basile <asterix@develer.com>\r
+ */\r
+\r
+\r
diff --git a/examples/at91sam7x/verstag.h b/examples/at91sam7x/verstag.h
new file mode 100644 (file)
index 0000000..bf43c46
--- /dev/null
@@ -0,0 +1,94 @@
+/**\r
+ * \file\r
+ * <!--\r
+ * This file is part of BeRTOS.\r
+ *\r
+ * Bertos is free software; you can redistribute it and/or modify\r
+ * it under the terms of the GNU General Public License as published by\r
+ * the Free Software Foundation; either version 2 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU General Public License\r
+ * along with this program; if not, write to the Free Software\r
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\r
+ *\r
+ * As a special exception, you may use this file as part of a free software\r
+ * library without restriction.  Specifically, if other files instantiate\r
+ * templates or use macros or inline functions from this file, or you compile\r
+ * this file and link it with other files to produce an executable, this\r
+ * file does not by itself cause the resulting executable to be covered by\r
+ * the GNU General Public License.  This exception does not however\r
+ * invalidate any other reasons why the executable file might be covered by\r
+ * the GNU General Public License.\r
+ *\r
+ * Copyright 2003, 2004, 2005, 2006 Develer S.r.l. (http://www.develer.com/)\r
+ * Copyright 2001, 2002, 2003 by Bernie Innocenti <bernie@codewiz.org>\r
+ *\r
+ * -->\r
+ *\r
+ * \version $Id: verstag.h 1532 2008-08-04 07:21:26Z bernie $\r
+ *\r
+ * \author Bernie Innocenti <bernie@codewiz.org>\r
+ *\r
+ * \brief Declare application version strings\r
+ */\r
+#ifndef DEVLIB_VERSTAG_H\r
+#define DEVLIB_VERSTAG_H\r
+\r
+#ifndef ARCH_CONFIG_H\r
+       #include "cfg/arch_config.h"\r
+#endif\r
+\r
+#define APP_NAME "AT91SAM7X-EK porting test"\r
+#define APP_DESCRIPTION "AT91SAM7X-EK porting test"\r
+#define APP_AUTHOR "Develer"\r
+#define APP_COPYRIGHT "Copyright 2009 Develer (http://www.develer.com/)"\r
+\r
+#define VERS_MAJOR 0\r
+#define VERS_MINOR 1\r
+#define VERS_REV   0\r
+#define VERS_LETTER ""\r
+\r
+/**\r
+ * If _SNAPSHOT is defined, \c VERS_TAG contains the build date\r
+ * date instead of a numeric version string.\r
+ */\r
+//#define _SNAPSHOT\r
+\r
+#ifdef _DEBUG\r
+       #define VERS_DBG "D"\r
+#else\r
+       #define VERS_DBG ""\r
+#endif\r
+\r
+#define __STRINGIZE(x) #x\r
+#define _STRINGIZE(x) __STRINGIZE(x)\r
+\r
+/** Build application version string (i.e.: "1.7.0") */\r
+#define MAKE_VERS(maj,min,rev) _STRINGIZE(maj) "." _STRINGIZE(min) "." _STRINGIZE(rev) VERS_LETTER VERS_DBG\r
+#ifdef _SNAPSHOT\r
+       #define VERS_TAG "snapshot" " " __DATE__ " " __TIME__ " " VERS_LETTER " " VERS_DBG\r
+#else\r
+       #define VERS_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)\r
+#endif\r
+\r
+/** Build application version string suitable for MS windows resource files (i.e.: "1, 7, 0, 1") */\r
+#define MAKE_RCVERS(maj,min,rev,bld) _STRINGIZE(maj) ", " _STRINGIZE(min) ", " _STRINGIZE(rev) ", " _STRINGIZE(bld)\r
+#define RCVERSION_TAG MAKE_VERS(VERS_MAJOR,VERS_MINOR,VERS_REV)\r
+\r
+/** The revision string (contains VERS_TAG) */\r
+extern const char vers_tag[];\r
+\r
+/** Sequential build number (contains VERS_BUILD) */\r
+extern const int vers_build_nr;\r
+//extern const char vers_build_str[];\r
+\r
+/** Hostname of the machine used to build this binary (contains VERS_HOST) */\r
+extern const char vers_host[];\r
+\r
+#endif /* DEVLIB_VERSTAG_H */\r