2 FreeRTOS.org V4.0.5 - Copyright (C) 2003-2006 Richard Barry.
\r
4 This file is part of the FreeRTOS.org distribution.
\r
6 FreeRTOS.org is free software; you can redistribute it and/or modify
\r
7 it under the terms of the GNU General Public License as published by
\r
8 the Free Software Foundation; either version 2 of the License, or
\r
9 (at your option) any later version.
\r
11 FreeRTOS.org is distributed in the hope that it will be useful,
\r
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
14 GNU General Public License for more details.
\r
16 You should have received a copy of the GNU General Public License
\r
17 along with FreeRTOS.org; if not, write to the Free Software
\r
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
\r
20 A special exception to the GPL can be applied should you wish to distribute
\r
21 a combined work that includes FreeRTOS.org, without being obliged to provide
\r
22 the source code for any proprietary components. See the licensing section
\r
23 of http://www.FreeRTOS.org for full details of how and when the exception
\r
26 ***************************************************************************
\r
27 See http://www.FreeRTOS.org for documentation, latest information, license
\r
28 and contact details. Please ensure to read the configuration and relevant
\r
29 port sections of the online documentation.
\r
30 ***************************************************************************
\r
39 /* Scheduler include files. */
\r
40 #include "FreeRTOS.h"
\r
43 #include "partest.h"
\r
45 /*-----------------------------------------------------------
\r
46 * Simple parallel port IO routines for the FED 40pin demo board.
\r
47 * The four LED's are connected to D4 to D7.
\r
48 *-----------------------------------------------------------*/
\r
50 #define partstBIT_AS_OUTPUT ( ( unsigned portSHORT ) 0 )
\r
51 #define partstSET_OUTPUT ( ( unsigned portSHORT ) 1 )
\r
52 #define partstCLEAR_OUTPUT ( ( unsigned portSHORT ) 0 )
\r
54 #define partstENABLE_GENERAL_IO ( ( unsigned portCHAR ) 7 )
\r
56 /*-----------------------------------------------------------*/
\r
58 void vParTestInitialise( void )
\r
60 /* Set the top four bits of port D to output. */
\r
61 bTRD7 = partstBIT_AS_OUTPUT;
\r
62 bTRD6 = partstBIT_AS_OUTPUT;
\r
63 bTRD5 = partstBIT_AS_OUTPUT;
\r
64 bTRD4 = partstBIT_AS_OUTPUT;
\r
66 /* Start with all bits off. */
\r
67 bRD7 = partstCLEAR_OUTPUT;
\r
68 bRD6 = partstCLEAR_OUTPUT;
\r
69 bRD5 = partstCLEAR_OUTPUT;
\r
70 bRD4 = partstCLEAR_OUTPUT;
\r
72 /* Enable the driver. */
\r
73 ADCON1 = partstENABLE_GENERAL_IO;
\r
74 bTRE2 = partstBIT_AS_OUTPUT;
\r
75 bRE2 = partstSET_OUTPUT;
\r
77 /*-----------------------------------------------------------*/
\r
79 void vParTestSetLED( unsigned portCHAR ucLED, portCHAR cValue )
\r
81 /* We are only using the top nibble, so LED 0 corresponds to bit 4. */
\r
86 case 3 : bRD7 = ( portSHORT ) cValue;
\r
88 case 2 : bRD6 = ( portSHORT ) cValue;
\r
90 case 1 : bRD5 = ( portSHORT ) cValue;
\r
92 case 0 : bRD4 = ( portSHORT ) cValue;
\r
94 default : /* There are only 4 LED's. */
\r
100 /*-----------------------------------------------------------*/
\r
102 void vParTestToggleLED( unsigned portCHAR ucLED )
\r
104 /* We are only using the top nibble, so LED 0 corresponds to bit 4. */
\r
109 case 3 : bRD7 = !bRD7;
\r
111 case 2 : bRD6 = !bRD6;
\r
113 case 1 : bRD5 = !bRD5;
\r
115 case 0 : bRD4 = !bRD4 );
\r
117 default : /* There are only 4 LED's. */
\r