Mercurial > ecos
annotate packages/devs/spi/freescale/dspi/current/tests/spi_loopback.c @ 3292:7f8e529b4d82 default tip
Fix FREESCALE_EDMA_NBYTES_MLOFFYES_MLOFF() so it works with negative offsets.
| author | vae |
|---|---|
| date | Wed, 29 Apr 2015 23:31:48 +0000 |
| parents | b3af38677ed2 |
| children |
| rev | line source |
|---|---|
|
3196
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
1 //============================================================================= |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
2 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
3 // spi_loopback.c |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
4 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
5 // Standalone SPI loopback test. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
6 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
7 //============================================================================= |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
8 // ####ECOSGPLCOPYRIGHTBEGIN#### |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
9 // ------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
10 // This file is part of eCos, the Embedded Configurable Operating System. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
11 // Copyright (C) 2012 Free Software Foundation, Inc. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
12 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
13 // eCos is free software; you can redistribute it and/or modify it under |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
14 // the terms of the GNU General Public License as published by the Free |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
15 // Software Foundation; either version 2 or (at your option) any later |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
16 // version. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
17 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
18 // eCos is distributed in the hope that it will be useful, but WITHOUT |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
21 // for more details. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
22 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
23 // You should have received a copy of the GNU General Public License |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
24 // along with eCos; if not, write to the Free Software Foundation, Inc., |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
26 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
27 // As a special exception, if other files instantiate templates or use |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
28 // macros or inline functions from this file, or you compile this file |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
29 // and link it with other works to produce a work based on this file, |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
30 // this file does not by itself cause the resulting work to be covered by |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
31 // the GNU General Public License. However the source code for this file |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
32 // must still be made available in accordance with section (3) of the GNU |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
33 // General Public License v2. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
34 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
35 // This exception does not invalidate any other reasons why a work based |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
36 // on this file might be covered by the GNU General Public License. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
37 // ------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
38 // ####ECOSGPLCOPYRIGHTEND#### |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
39 //============================================================================= |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
40 //#####DESCRIPTIONBEGIN#### |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
41 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
42 // Author(s): Ilija Kocho |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
43 // Original: Chris Holgate |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
44 // Date: 2012-12-27 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
45 // Purpose: Freescale DSPI loopback test |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
46 // Description: Standalone SPI loopback test. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
47 // Usage: Compile as a standalone application. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
48 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
49 //####DESCRIPTIONEND#### |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
50 // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
51 //============================================================================= |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
52 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
53 //============================================================================= |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
54 // This is a quick loopback test for the Freescale DSPI SPI driver. It only checks |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
55 // the data transfer functionality - chip select handling will require |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
56 // testing with external devices. In order to run the test, the MOSI and |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
57 // MISO pins for the test port need to be shorted together to provide an |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
58 // external loopback. Don't do this on a bus which has external devices |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
59 // attached unless you first make sure that none of them are connected to |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
60 // the chip select used by the test harness. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
61 // The default port and chip select used for this test are SPI bus 1, |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
62 // chip select 0. These can be changed by editing the loopback_device |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
63 // data structure directly. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
64 // Note that this is intended to be run as a standalone test and not as part |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
65 // of the standard board tests since it requires a hardware modification. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
66 //============================================================================= |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
67 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
68 #include <cyg/infra/cyg_type.h> |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
69 #include <cyg/infra/testcase.h> // Test macros |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
70 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
71 #include <cyg/infra/cyg_ass.h> // Assertion macros |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
72 #include <cyg/infra/diag.h> // Diagnostic output |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
73 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
74 #include <cyg/hal/hal_arch.h> // CYGNUM_HAL_STACK_SIZE_TYPICAL |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
75 #include <cyg/kernel/kapi.h> |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
76 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
77 #include <cyg/io/spi.h> // Common SPI API |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
78 #include <cyg/io/spi_freescale_dspi.h> // Freescale DSPI data structures |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
79 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
80 #include <string.h> |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
81 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
82 //--------------------------------------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
83 // Thread data structures. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
84 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
85 cyg_uint8 stack [CYGNUM_HAL_STACK_SIZE_TYPICAL]; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
86 cyg_thread thread_data; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
87 cyg_handle_t thread_handle; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
88 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
89 externC cyg_spi_freescale_dspi_bus_t cyg_spi_dspi_bus1; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
90 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
91 //--------------------------------------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
92 // SPI loopback device driver data structures. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
93 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
94 CYG_DEVS_SPI_FREESCALE_DSPI_DEVICE( |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
95 loopback_device, // Device name |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
96 1, //SPI bus |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
97 0, // Dev num |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
98 8, // Frame size |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
99 0, // Clock pol |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
100 0, // Clock phase |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
101 6000000, // Clock speed |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
102 1, // CS assert delay |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
103 1, // CS negate delay |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
104 1, // Delay between transfers |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
105 1000, // Delay unit [ns] |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
106 0 // Double baud rate |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
107 ); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
108 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
109 //--------------------------------------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
110 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
111 static int errors = 0; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
112 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
113 const char tx_data0[] = "0123456789a123456789b123456789c123456789d123456789e"; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
114 const char tx_data1[] = "Performing extended API test first transaction..|"; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
115 const char tx_data2[] = "Testing extended API for a second transaction!"; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
116 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
117 char rx_data [256]; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
118 char rx_data1 [256]; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
119 char rx_data2 [256]; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
120 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
121 static void memclr(char *dest_p, cyg_uint32 byte_n) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
122 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
123 while(byte_n--) { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
124 *dest_p++ = 0; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
125 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
126 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
127 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
128 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
129 //--------------------------------------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
130 // Run single loopback transaction using simple transfer API call. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
131 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
132 void run_test_tick (cyg_bool polled, cyg_uint32 count) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
133 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
134 diag_printf ("Test 0 : Tick (polled = %d).\n", polled ? 1 : 0); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
135 cyg_spi_tick(&loopback_device, polled, count); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
136 diag_printf (" Tick end\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
137 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
138 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
139 void run_test_1 (cyg_bool polled, const char* tx_data_p, cyg_uint32 count) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
140 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
141 diag_printf ("Test 1 : Simple transfer test polled = %d, count=%d\n", |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
142 polled ? 1 : 0, count); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
143 memclr(rx_data1, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
144 memclr(rx_data2, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
145 cyg_spi_transfer (&loopback_device, polled, count, |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
146 (const cyg_uint8*) tx_data_p, (cyg_uint8*) &rx_data[0]); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
147 diag_printf (" Tx data : %s\n", tx_data_p); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
148 diag_printf (" Rx data : %s 0x%02x\n", rx_data, rx_data[0]); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
149 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
150 if (memcmp (tx_data_p, rx_data, count) != 0) { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
151 errors++; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
152 diag_printf("Simple transfer loopback failed - mismatched data.\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
153 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
154 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
155 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
156 //--------------------------------------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
157 // Run two loopback transactions using extended transfer API. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
158 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
159 void run_test_2 (cyg_bool polled) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
160 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
161 diag_printf ("Test 2 : Extended API test (polled = %d).\n", polled ? 1 : 0); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
162 memclr(rx_data1, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
163 memclr(rx_data2, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
164 cyg_spi_transaction_begin (&loopback_device); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
165 cyg_spi_transaction_transfer (&loopback_device, polled, sizeof (tx_data1), |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
166 (const cyg_uint8*) &tx_data1[0], (cyg_uint8*) &rx_data1[0], false); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
167 cyg_spi_transaction_transfer (&loopback_device, polled, sizeof (tx_data2), |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
168 (const cyg_uint8*) &tx_data2[0], (cyg_uint8*) &rx_data2[0], true); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
169 cyg_spi_transaction_end (&loopback_device); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
170 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
171 diag_printf (" Tx data 1 (%u Bytes): %s\n", sizeof(tx_data1), tx_data1); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
172 diag_printf (" Rx data 1 : %s\n", rx_data1); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
173 diag_printf (" Tx data 2 (%u Bytes): %s\n", sizeof(tx_data2), tx_data2); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
174 diag_printf (" Rx data 2 : %s\n", rx_data2); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
175 if (memcmp (tx_data1, rx_data1, sizeof (tx_data1)) != 0) { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
176 errors++; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
177 diag_printf("Simple transfer loopback failed - mismatched data (transfer 1).\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
178 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
179 if (memcmp (tx_data2, rx_data2, sizeof (tx_data2)) != 0) { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
180 errors++; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
181 diag_printf("Simple transfer loopback failed - mismatched data (transfer 2).\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
182 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
183 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
184 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
185 void run_test_3 (cyg_bool polled) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
186 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
187 diag_printf ("Test 3 : Extended API test (polled = %d).\n", polled ? 1 : 0); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
188 memclr(rx_data1, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
189 memclr(rx_data2, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
190 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
191 cyg_spi_transaction_begin (&loopback_device); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
192 cyg_spi_transaction_transfer (&loopback_device, polled, sizeof (tx_data1), |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
193 (const cyg_uint8*) &tx_data1[0], (cyg_uint8*) &rx_data1[0], false); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
194 cyg_spi_transaction_transfer (&loopback_device, polled, sizeof (tx_data2), |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
195 (const cyg_uint8*) &tx_data2[0], (cyg_uint8*) &rx_data2[0], true); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
196 cyg_spi_transaction_end (&loopback_device); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
197 diag_printf (" Tx data 1 (%u Bytes): %s\n", sizeof(tx_data1), tx_data1); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
198 diag_printf (" Rx data 31 : %s\n", rx_data1); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
199 diag_printf (" Tx data 2 (%u Bytes): %s\n", sizeof(tx_data2), tx_data2); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
200 diag_printf (" Rx data 32 : %s\n", rx_data2); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
201 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
202 if (memcmp (tx_data1, rx_data1, sizeof (tx_data1)) != 0) { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
203 errors++; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
204 diag_printf("Simple transfer loopback failed - mismatched data (transfer 1).\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
205 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
206 if (memcmp (tx_data2, rx_data2, sizeof (tx_data2)) != 0) { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
207 errors++; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
208 diag_printf("Simple transfer loopback failed - mismatched data (transfer 2).\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
209 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
210 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
211 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
212 void run_test_4 (cyg_bool polled) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
213 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
214 diag_printf ("Test 4 : Extended API test NULL transfer (polled = %d).\n", polled ? 1 : 0); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
215 memclr(rx_data1, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
216 memclr(rx_data2, sizeof(rx_data1)); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
217 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
218 cyg_spi_transaction_begin (&loopback_device); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
219 cyg_spi_transaction_transfer (&loopback_device, polled, sizeof (tx_data1), |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
220 (const cyg_uint8*) NULL, NULL, true); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
221 cyg_spi_transaction_end (&loopback_device); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
222 diag_printf (" Tx data 41 (%u Bytes): %s\n", sizeof(tx_data1), tx_data1); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
223 diag_printf (" Rx data 1 : %s\n", rx_data1); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
224 diag_printf (" Tx data 42 (%u Bytes): %s\n", sizeof(tx_data2), tx_data2); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
225 diag_printf (" Rx data 2 : %s\n", rx_data2); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
226 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
227 if (memcmp (rx_data1, rx_data2, sizeof (tx_data1)) != 0) { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
228 errors++; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
229 diag_printf("Simple transfer loopback failed - mismatched data.\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
230 errors++; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
231 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
232 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
233 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
234 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
235 //--------------------------------------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
236 // Run all SPI interface loopback tests. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
237 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
238 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
239 void run_tests (void) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
240 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
241 bool polled = true; |
|
3205
b3af38677ed2
Enhanced endianness support for devices with big and little endian, added support for MPC5xxx in addition to Kinetis, extended support for up to 8 DSPIs.
vae
parents:
3203
diff
changeset
|
242 diag_printf ("Running Freescale Kinetis/MPC5xxx DSPI driver loopback tests.\n"); |
|
3196
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
243 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
244 diag_printf ("\nPolled\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
245 run_test_tick (polled, 1024); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
246 run_test_1 (polled, &tx_data0[3], 4); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
247 run_test_2 (polled); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
248 run_test_3 (polled); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
249 run_test_4 (polled); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
250 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
251 polled = false; |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
252 diag_printf ("\nInterrupt driven.\n"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
253 run_test_tick (polled,2048); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
254 run_test_1 (polled, &tx_data0[7], 10); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
255 run_test_2 (polled); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
256 run_test_3 (polled); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
257 run_test_4 (polled); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
258 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
259 if(errors) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
260 CYG_TEST_FAIL("Errors detected"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
261 else |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
262 CYG_TEST_PASS_FINISH ("Loopback tests ran OK"); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
263 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
264 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
265 //--------------------------------------------------------------------------- |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
266 // User startup - tests are run in their own thread. |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
267 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
268 void cyg_user_start(void) |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
269 { |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
270 CYG_TEST_INIT(); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
271 cyg_thread_create( |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
272 10, // Arbitrary priority |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
273 (cyg_thread_entry_t*) run_tests, // Thread entry point |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
274 0, // |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
275 "test_thread", // Thread name |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
276 &stack[0], // Stack |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
277 CYGNUM_HAL_STACK_SIZE_TYPICAL, // Stack size |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
278 &thread_handle, // Thread handle |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
279 &thread_data // Thread data structure |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
280 ); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
281 cyg_thread_resume(thread_handle); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
282 cyg_scheduler_start(); |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
283 } |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
284 |
|
c766accdd9a1
Tick-only now has option to beehive like other drivers rather than RM (see Bugzilla 1001676). Fixed bug with dropping CS. Chip select options consolidated in a for loop. Add looback test.
vae
parents:
diff
changeset
|
285 //============================================================================= |
