mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-06 06:07:45 -04:00
RM48 simply blinky demo working.
This commit is contained in:
parent
57fab18305
commit
ecdca1311b
11 changed files with 1373 additions and 291 deletions
121
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.c
Normal file
121
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.c
Normal file
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
FreeRTOS V7.0.2 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
>>>NOTE<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel. FreeRTOS is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details. You should have received a copy of the GNU General Public
|
||||
License and the FreeRTOS license exception along with FreeRTOS; if not it
|
||||
can be viewed here: http://www.freertos.org/a00114.html and also obtained
|
||||
by writing to Richard Barry, contact details for whom are available on the
|
||||
FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, latest information, license and
|
||||
contact details.
|
||||
|
||||
http://www.SafeRTOS.com - A version that is certified for use in safety
|
||||
critical systems.
|
||||
|
||||
http://www.OpenRTOS.com - Commercial support, development, porting,
|
||||
licensing and training services.
|
||||
*/
|
||||
|
||||
#include "FreeRTOS.h"
|
||||
#include "Task.h"
|
||||
#include "gio.h"
|
||||
#include "het.h"
|
||||
|
||||
/*
|
||||
* Task that flashes the LEDS on the USB stick.
|
||||
*
|
||||
* This task is also run in Thumb mode to test the ARM/THUMB context switch
|
||||
*/
|
||||
|
||||
#pragma TASK(vLedTask)
|
||||
#pragma CODE_STATE(vLedTask, 16)
|
||||
|
||||
void vLedTask(void *pvParameters)
|
||||
{
|
||||
unsigned led = 0;
|
||||
unsigned count = 0;
|
||||
unsigned colour = 0;
|
||||
|
||||
/* Initalise the IO ports that drive the LEDs */
|
||||
gioSetDirection(hetPORT, 0xFFFFFFFF);
|
||||
/* switch all leds off */
|
||||
gioSetPort(hetPORT, 0x08110034);
|
||||
|
||||
for(;;)
|
||||
{
|
||||
/* toggle on/off */
|
||||
led ^= 1;
|
||||
/* switch TOP row */
|
||||
gioSetBit(hetPORT, 25, led);
|
||||
gioSetBit(hetPORT, 18, led);
|
||||
gioSetBit(hetPORT, 29, led);
|
||||
/* switch BOTTOM row */
|
||||
gioSetBit(hetPORT, 17, led ^ 1);
|
||||
gioSetBit(hetPORT, 31, led ^ 1);
|
||||
gioSetBit(hetPORT, 0, led ^ 1);
|
||||
vTaskDelay(500);
|
||||
|
||||
if (++count > 5)
|
||||
{
|
||||
count = 0;
|
||||
/* both leds to off */
|
||||
gioSetBit(hetPORT, 2, 1); gioSetBit(hetPORT, 5, 1); gioSetBit(hetPORT, 20, 1);
|
||||
gioSetBit(hetPORT, 4, 1); gioSetBit(hetPORT, 27, 1); gioSetBit(hetPORT, 16, 1);
|
||||
switch(colour)
|
||||
{
|
||||
case 0:
|
||||
gioSetBit(hetPORT, 2, 0); /* red */
|
||||
gioSetBit(hetPORT, 4, 0);
|
||||
colour++;
|
||||
continue;
|
||||
case 1:
|
||||
gioSetBit(hetPORT, 5, 0); /* blue */
|
||||
gioSetBit(hetPORT, 27, 0);
|
||||
colour++;
|
||||
continue;
|
||||
case 2:
|
||||
gioSetBit(hetPORT, 20, 0); /* green */
|
||||
gioSetBit(hetPORT, 16, 0);
|
||||
colour++;
|
||||
continue;
|
||||
}
|
||||
colour = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
128
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.h
Normal file
128
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/het.h
Normal file
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
FreeRTOS V7.0.2 - Copyright (C) 2011 Real Time Engineers Ltd.
|
||||
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
>>>NOTE<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel. FreeRTOS is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details. You should have received a copy of the GNU General Public
|
||||
License and the FreeRTOS license exception along with FreeRTOS; if not it
|
||||
can be viewed here: http://www.freertos.org/a00114.html and also obtained
|
||||
by writing to Richard Barry, contact details for whom are available on the
|
||||
FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, latest information, license and
|
||||
contact details.
|
||||
|
||||
http://www.SafeRTOS.com - A version that is certified for use in safety
|
||||
critical systems.
|
||||
|
||||
http://www.OpenRTOS.com - Commercial support, development, porting,
|
||||
licensing and training services.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __HET_H__
|
||||
#define __HET_H__
|
||||
|
||||
#include "gio.h"
|
||||
|
||||
/** @struct hetBase
|
||||
* @brief HET Register Definition
|
||||
*
|
||||
* This structure is used to access the HET module egisters.
|
||||
*/
|
||||
/** @typedef hetBASE_t
|
||||
* @brief HET Register Frame Type Definition
|
||||
*
|
||||
* This type is used to access the HET Registers.
|
||||
*/
|
||||
typedef volatile struct hetBase
|
||||
{
|
||||
unsigned GCR; /**< 0x0000: Global control register */
|
||||
unsigned PFR; /**< 0x0004: Prescale factor register */
|
||||
unsigned ADDR; /**< 0x0008: Current address register */
|
||||
unsigned OFF1; /**< 0x000C: Interrupt offset register 1 */
|
||||
unsigned OFF2; /**< 0x0010: Interrupt offset register 2 */
|
||||
unsigned INTENAS; /**< 0x0014: Interrupt enable set register */
|
||||
unsigned INTENAC; /**< 0x0018: Interrupt enable clear register */
|
||||
unsigned EXC1; /**< 0x001C: Exeption control register 1 */
|
||||
unsigned EXC2; /**< 0x0020: Exeption control register 2 */
|
||||
unsigned PRY; /**< 0x0024: Interrupt priority register */
|
||||
unsigned FLG; /**< 0x0028: Interrupt flag register */
|
||||
unsigned : 32U; /**< 0x002C: Reserved */
|
||||
unsigned : 32U; /**< 0x0030: Reserved */
|
||||
unsigned HRSH; /**< 0x0034: High resoltion share register */
|
||||
unsigned XOR; /**< 0x0038: XOR share register */
|
||||
unsigned REQENS; /**< 0x003C: Request enable set register */
|
||||
unsigned REQENC; /**< 0x0040: Request enable clear register */
|
||||
unsigned REQDS; /**< 0x0044: Request destination select register */
|
||||
unsigned : 32U; /**< 0x0048: Reserved */
|
||||
unsigned DIR; /**< 0x004C: Direction register */
|
||||
unsigned DIN; /**< 0x0050: Data input register */
|
||||
unsigned DOUT; /**< 0x0054: Data output register */
|
||||
unsigned DSET; /**< 0x0058: Data output set register */
|
||||
unsigned DCLR; /**< 0x005C: Data output clear register */
|
||||
unsigned PDR; /**< 0x0060: Open drain register */
|
||||
unsigned PULDIS; /**< 0x0064: Pull disable register */
|
||||
unsigned PSL; /**< 0x0068: Pull select register */
|
||||
unsigned : 32U; /**< 0x006C: Reserved */
|
||||
unsigned : 32U; /**< 0x0070: Reserved */
|
||||
unsigned PCREG; /**< 0x0074: Parity control register */
|
||||
unsigned PAR; /**< 0x0078: Parity address register */
|
||||
unsigned PPR; /**< 0x007C: Parity pin select register */
|
||||
unsigned SFPRLD; /**< 0x0080: Suppression filter preload register */
|
||||
unsigned SFENA; /**< 0x0084: Suppression filter enable register */
|
||||
unsigned : 32U; /**< 0x0088: Reserved */
|
||||
unsigned LBPSEL; /**< 0x008C: Loop back pair select register */
|
||||
unsigned LBPDIR; /**< 0x0090: Loop back pair direction register */
|
||||
} hetBASE_t;
|
||||
|
||||
|
||||
/** @def hetREG
|
||||
* @brief HET Register Frame Pointer
|
||||
*
|
||||
* This pointer is used by the HET driver to access the het module registers.
|
||||
*/
|
||||
#define hetREG ((hetBASE_t *)0xFFF7B800U)
|
||||
|
||||
|
||||
/** @def hetPORT
|
||||
* @brief HET GIO Port Register Pointer
|
||||
*
|
||||
* Pointer used by the GIO driver to access I/O PORT of HET
|
||||
* (use the GIO drivers to access the port pins).
|
||||
*/
|
||||
#define hetPORT ((gioPORT_t *)0xFFF7B84CU)
|
||||
|
||||
#endif
|
77
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/partest.h
Normal file
77
FreeRTOS/Demo/CORTEX_R4_RM48_CCS5/demo/partest.h
Normal file
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.
|
||||
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* FreeRTOS tutorial books are available in pdf and paperback. *
|
||||
* Complete, revised, and edited pdf reference manuals are also *
|
||||
* available. *
|
||||
* *
|
||||
* Purchasing FreeRTOS documentation will not only help you, by *
|
||||
* ensuring you get running as quickly as possible and with an *
|
||||
* in-depth knowledge of how to use FreeRTOS, it will also help *
|
||||
* the FreeRTOS project to continue with its mission of providing *
|
||||
* professional grade, cross platform, de facto standard solutions *
|
||||
* for microcontrollers - completely free of charge! *
|
||||
* *
|
||||
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
|
||||
* *
|
||||
* Thank you for using FreeRTOS, and thank you for your support! *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
This file is part of the FreeRTOS distribution.
|
||||
|
||||
FreeRTOS is free software; you can redistribute it and/or modify it under
|
||||
the terms of the GNU General Public License (version 2) as published by the
|
||||
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
|
||||
>>>NOTE<<< The modification to the GPL is included to allow you to
|
||||
distribute a combined work that includes FreeRTOS without being obliged to
|
||||
provide the source code for proprietary components outside of the FreeRTOS
|
||||
kernel. FreeRTOS is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
more details. You should have received a copy of the GNU General Public
|
||||
License and the FreeRTOS license exception along with FreeRTOS; if not it
|
||||
can be viewed here: http://www.freertos.org/a00114.html and also obtained
|
||||
by writing to Richard Barry, contact details for whom are available on the
|
||||
FreeRTOS WEB site.
|
||||
|
||||
1 tab == 4 spaces!
|
||||
|
||||
***************************************************************************
|
||||
* *
|
||||
* Having a problem? Start by reading the FAQ "My application does *
|
||||
* not run, what could be wrong? *
|
||||
* *
|
||||
* http://www.FreeRTOS.org/FAQHelp.html *
|
||||
* *
|
||||
***************************************************************************
|
||||
|
||||
|
||||
http://www.FreeRTOS.org - Documentation, training, latest information,
|
||||
license and contact details.
|
||||
|
||||
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
|
||||
including FreeRTOS+Trace - an indispensable productivity tool.
|
||||
|
||||
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
|
||||
the code with commercial support, indemnification, and middleware, under
|
||||
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
|
||||
provide a safety engineered and independently SIL3 certified version under
|
||||
the SafeRTOS brand: http://www.SafeRTOS.com.
|
||||
*/
|
||||
|
||||
#ifndef PARTEST_H
|
||||
#define PARTEST_H
|
||||
|
||||
#define partstDEFAULT_PORT_ADDRESS ( ( unsigned short ) 0x378 )
|
||||
|
||||
void vParTestInitialise( void );
|
||||
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue );
|
||||
void vParTestToggleLED( unsigned portBASE_TYPE uxLED );
|
||||
|
||||
#endif
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue