summaryrefslogtreecommitdiff
path: root/cesar/test_general/ecos/src/bentry.c
diff options
context:
space:
mode:
Diffstat (limited to 'cesar/test_general/ecos/src/bentry.c')
-rw-r--r--cesar/test_general/ecos/src/bentry.c81
1 files changed, 81 insertions, 0 deletions
diff --git a/cesar/test_general/ecos/src/bentry.c b/cesar/test_general/ecos/src/bentry.c
new file mode 100644
index 0000000000..31126e4e1f
--- /dev/null
+++ b/cesar/test_general/ecos/src/bentry.c
@@ -0,0 +1,81 @@
+/* Cesar project {{{
+ *
+ * Copyright (C) 2008 Spidcom
+ *
+ * <<<Licence>>>
+ *
+ * }}} */
+/**
+ * \file test_general/ecos-test/src/bentry.c
+ * \brief « brief description »
+ * \ingroup « module »
+ *
+ * Function test of the alignement on the targets
+ */
+#include "common/std.h"
+
+#include <cyg/kernel/kapi.h>
+#include <cyg/hal/hal_arch.h>
+
+struct cp_bentry_sai_stpf_t
+{
+ BITFIELDS_WORD
+ (
+ /** Start Time Present Flag. */
+ uint stpf:1;,
+ /** Global Link Id. */
+ uint glid:7;,
+ /** Start Time. */
+ uint st:12;,
+ /** End Time. */
+ uint et:12;
+ );
+};
+typedef struct cp_bentry_sai_stpf_t cp_bentry_sai_stpf_t;
+
+struct cp_bentry_persistent_schedule_struct_t
+{
+ BITFIELDS_WORD
+ (
+ uint behdr:8;,
+ uint belen:8;,
+ uint pscd:3;,
+ uint cscd:3;,
+ uint rsvd1:2;,
+ uint ns:6;,
+ uint rsvd2:2;,
+ );
+ u8 sai;
+};
+typedef struct cp_bentry_persistent_schedule_struct_t cp_bentry_persistent_schedule_struct_t;
+
+void
+cyg_user_start (void)
+{
+ u8 blk[512];
+
+ cp_bentry_persistent_schedule_struct_t *bentry;
+ cp_bentry_sai_stpf_t *sai;
+
+ // laranjeiro
+ // date : 2008/01/07
+ // TODO fill this correctly
+ // Actually only a schedule is generated for the CSMA mode only.
+
+ bentry = (cp_bentry_persistent_schedule_struct_t *) &blk[11];
+
+ bentry->behdr = 0x1;
+ bentry->belen = 0x6;
+ bentry->pscd = 0x2;
+ bentry->cscd = 0x3;
+
+ // First allocation of persistent schedule.
+ // Configuration on CSMA only mode, the glid = 0xff.
+ bentry->ns = 1;
+ sai = (cp_bentry_sai_stpf_t *) &bentry->sai;
+ sai->stpf = true;
+ sai->glid = 0xFF;
+ sai->st = 0x0;
+ sai->et = 3905;
+}
+