Skip to content

Commit

Permalink
ini push
Browse files Browse the repository at this point in the history
  • Loading branch information
priyankkalgaonkar committed Feb 7, 2023
1 parent 5cbad31 commit 7ecfef6
Show file tree
Hide file tree
Showing 360 changed files with 626,397 additions and 0 deletions.
4,286 changes: 4,286 additions & 0 deletions Workspace/.metadata/.log

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file added Workspace/.metadata/.mylyn/.tasks.xml.zip
Binary file not shown.
Binary file added Workspace/.metadata/.mylyn/repositories.xml.zip
Binary file not shown.
Binary file added Workspace/.metadata/.mylyn/tasks.xml.zip
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[STARTUP]
USE_CYCLONEPRO_RELAYS=0
FORCE_MASS_ERASE=0

[PEDEBUG]
CURRENT_ALGORITHM_INDEX=0

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<item value="true" key="FIRST_CLOSE_EMB_SYS_REG_VIEW"/>
</section>
1 change: 1 addition & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.core/.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*** SESSION Feb 05, 2023 15:27:11.49 -------------------------------------------
Binary file not shown.
2,182 changes: 2,182 additions & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.core/4part1.language.settings.xml

Large diffs are not rendered by default.

Binary file not shown.
2,182 changes: 2,182 additions & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.core/GPIO.language.settings.xml

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Binary file not shown.
2,182 changes: 2,182 additions & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.core/UART.language.settings.xml

Large diffs are not rendered by default.

Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><SharedRoot><SharedProperty id="" value=""/></SharedRoot>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

Empty file.
124 changes: 124 additions & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.ui/4part1.build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
15:29:10 **** Build of configuration Debug for project 4part1 ****
make all
Building file: ../Sources/main.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D"CPU_MK64FN1M0VMD12" -I"../Sources" -I"C:\Freescale\KSDK_1.3.0/platform/hal/inc" -I"../Project_Settings/Startup_Code" -I"../SDK/platform/CMSIS/Include" -I"../SDK/platform/devices" -I"../SDK/platform/devices/MK64F12/include" -std=c99 -MMD -MP -MF"Sources/main.d" -MT"Sources/main.o" -c -o "Sources/main.o" "../Sources/main.c"
../Sources/main.c: In function 'main':
../Sources/main.c:26:3: warning: passing argument 1 of 'SIM_HAL_EnableClock' makes pointer from integer without a cast [enabled by default]
SIM_HAL_EnableClock(SIM_BASE, kSimClockGatePortE); // Enable Port E Clock Gate
^
In file included from C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_sim_hal.h:135:0,
from ../Sources/main.c:3:
c:\freescale\ksdk_1.3.0\platform\hal\src\sim\mk64f12\fsl_sim_hal_mk64f12.h:478:20: note: expected 'struct SIM_Type *' but argument is of type 'unsigned int'
static inline void SIM_HAL_EnableClock(SIM_Type * base, sim_clock_gate_name_t name)
^
../Sources/main.c:27:3: warning: passing argument 1 of 'SIM_HAL_EnableClock' makes pointer from integer without a cast [enabled by default]
SIM_HAL_EnableClock(SIM_BASE, kSimClockGatePit0); // Enable PIT Clock Gates
^
In file included from C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_sim_hal.h:135:0,
from ../Sources/main.c:3:
c:\freescale\ksdk_1.3.0\platform\hal\src\sim\mk64f12\fsl_sim_hal_mk64f12.h:478:20: note: expected 'struct SIM_Type *' but argument is of type 'unsigned int'
static inline void SIM_HAL_EnableClock(SIM_Type * base, sim_clock_gate_name_t name)
^
../Sources/main.c:29:3: warning: passing argument 1 of 'PORT_HAL_SetMuxMode' makes pointer from integer without a cast [enabled by default]
PORT_HAL_SetMuxMode(PORTE_BASE, PORT_PIN, kPortMuxAsGpio); // Configure PORTE, Pin 26, MUX as a GPIO
^
In file included from ../Sources/main.c:4:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_port_hal.h:251:20: note: expected 'struct PORT_Type *' but argument is of type 'unsigned int'
static inline void PORT_HAL_SetMuxMode(PORT_Type * base,
^
../Sources/main.c:31:3: warning: passing argument 1 of 'GPIO_HAL_SetPinDir' makes pointer from integer without a cast [enabled by default]
GPIO_HAL_SetPinDir(PTE_BASE, PORT_PIN, kGpioDigitalOutput); // Configure PORTE, Pin 26, as an Output
^
In file included from ../Sources/main.c:2:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_gpio_hal.h:83:6: note: expected 'struct GPIO_Type *' but argument is of type 'unsigned int'
void GPIO_HAL_SetPinDir(GPIO_Type * base, uint32_t pin,
^
../Sources/main.c:35:3: warning: passing argument 1 of 'PIT_HAL_SetTimerRunInDebugCmd' makes pointer from integer without a cast [enabled by default]
PIT_HAL_SetTimerRunInDebugCmd(PIT_BASE, true); // Allow PIT timer to run in Debug Mode
^
In file included from ../Sources/main.c:5:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_pit_hal.h:107:20: note: expected 'struct PIT_Type *' but argument is of type 'unsigned int'
static inline void PIT_HAL_SetTimerRunInDebugCmd(PIT_Type * base, bool timerRun)
^
../Sources/main.c:36:3: warning: passing argument 1 of 'PIT_HAL_Enable' makes pointer from integer without a cast [enabled by default]
PIT_HAL_Enable(PIT_BASE); // Enables PIT timers
^
In file included from ../Sources/main.c:5:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_pit_hal.h:76:20: note: expected 'struct PIT_Type *' but argument is of type 'unsigned int'
static inline void PIT_HAL_Enable(PIT_Type * base)
^
../Sources/main.c:37:3: warning: passing argument 1 of 'PIT_HAL_StopTimer' makes pointer from integer without a cast [enabled by default]
PIT_HAL_StopTimer(PIT_BASE, PIT_Module); // Disable PIT0 Timer
^
In file included from ../Sources/main.c:5:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_pit_hal.h:169:20: note: expected 'struct PIT_Type *' but argument is of type 'unsigned int'
static inline void PIT_HAL_StopTimer(PIT_Type * base, uint32_t channel)
^
../Sources/main.c:38:3: warning: passing argument 1 of 'PIT_HAL_SetTimerPeriodByCount' makes pointer from integer without a cast [enabled by default]
PIT_HAL_SetTimerPeriodByCount(PIT_BASE, PIT_Module, PIT_Period); // PIT0 Timer count value, PIT Period=1ms, busclk=60,000,000Hz, Period=1ms/(1/60000000Hz)=60000
^
In file included from ../Sources/main.c:5:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_pit_hal.h:210:20: note: expected 'struct PIT_Type *' but argument is of type 'unsigned int'
static inline void PIT_HAL_SetTimerPeriodByCount(PIT_Type * base, uint32_t channel, uint32_t count)
^
../Sources/main.c:39:3: warning: passing argument 1 of 'PIT_HAL_StartTimer' makes pointer from integer without a cast [enabled by default]
PIT_HAL_StartTimer(PIT_BASE, PIT_Module); // Start PIT0 Timer
^
In file included from ../Sources/main.c:5:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_pit_hal.h:154:20: note: expected 'struct PIT_Type *' but argument is of type 'unsigned int'
static inline void PIT_HAL_StartTimer(PIT_Type * base, uint32_t channel)
^
../Sources/main.c:46:5: warning: passing argument 1 of 'GPIO_HAL_TogglePinOutput' makes pointer from integer without a cast [enabled by default]
GPIO_HAL_TogglePinOutput(PTE_BASE, PORT_PIN); // Toggle GREEN LED
^
In file included from ../Sources/main.c:2:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_gpio_hal.h:201:20: note: expected 'struct GPIO_Type *' but argument is of type 'unsigned int'
static inline void GPIO_HAL_TogglePinOutput(GPIO_Type * base, uint32_t pin)
^
../Sources/main.c: In function 'PIT_Delay':
../Sources/main.c:54:1: warning: passing argument 1 of 'PIT_HAL_IsIntPending' makes pointer from integer without a cast [enabled by default]
{long pit_i; for (pit_i=0;pit_i<pit_delay;pit_i++) {while (!PIT_Overflow); PIT_HAL_ClearIntFlag(PIT_BASE, PIT_Module);}}
^
In file included from ../Sources/main.c:5:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_pit_hal.h:328:20: note: expected 'struct PIT_Type *' but argument is of type 'unsigned int'
static inline bool PIT_HAL_IsIntPending(PIT_Type * base, uint32_t channel)
^
../Sources/main.c:54:1: warning: passing argument 1 of 'PIT_HAL_ClearIntFlag' makes pointer from integer without a cast [enabled by default]
{long pit_i; for (pit_i=0;pit_i<pit_delay;pit_i++) {while (!PIT_Overflow); PIT_HAL_ClearIntFlag(PIT_BASE, PIT_Module);}}
^
In file included from ../Sources/main.c:5:0:
C:\Freescale\KSDK_1.3.0/platform/hal/inc/fsl_pit_hal.h:310:20: note: expected 'struct PIT_Type *' but argument is of type 'unsigned int'
static inline void PIT_HAL_ClearIntFlag(PIT_Type * base, uint32_t channel)
^
Finished building: ../Sources/main.c

Building file: ../Project_Settings/Startup_Code/startup.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D"CPU_MK64FN1M0VMD12" -I"../Sources" -I"C:\Freescale\KSDK_1.3.0/platform/hal/inc" -I"../Project_Settings/Startup_Code" -I"../SDK/platform/CMSIS/Include" -I"../SDK/platform/devices" -I"../SDK/platform/devices/MK64F12/include" -std=c99 -MMD -MP -MF"Project_Settings/Startup_Code/startup.d" -MT"Project_Settings/Startup_Code/startup.o" -c -o "Project_Settings/Startup_Code/startup.o" "../Project_Settings/Startup_Code/startup.c"
Finished building: ../Project_Settings/Startup_Code/startup.c

Building file: ../Project_Settings/Startup_Code/startup_MK64F12.S
Invoking: Cross ARM GNU Assembler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -x assembler-with-cpp -MMD -MP -MF"Project_Settings/Startup_Code/startup_MK64F12.d" -MT"Project_Settings/Startup_Code/startup_MK64F12.o" -c -o "Project_Settings/Startup_Code/startup_MK64F12.o" "../Project_Settings/Startup_Code/startup_MK64F12.S"
Finished building: ../Project_Settings/Startup_Code/startup_MK64F12.S

Building file: ../Project_Settings/Startup_Code/system_MK64F12.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D"CPU_MK64FN1M0VMD12" -I"../Sources" -I"C:\Freescale\KSDK_1.3.0/platform/hal/inc" -I"../Project_Settings/Startup_Code" -I"../SDK/platform/CMSIS/Include" -I"../SDK/platform/devices" -I"../SDK/platform/devices/MK64F12/include" -std=c99 -MMD -MP -MF"Project_Settings/Startup_Code/system_MK64F12.d" -MT"Project_Settings/Startup_Code/system_MK64F12.o" -c -o "Project_Settings/Startup_Code/system_MK64F12.o" "../Project_Settings/Startup_Code/system_MK64F12.c"
Finished building: ../Project_Settings/Startup_Code/system_MK64F12.c

Building target: 4part1.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T "MK64FN1M0xxx12_flash.ld" -Xlinker --gc-sections -L"C:/Users/pkalgaon/Desktop/Workspace/4part1/Project_Settings/Linker_Files" -Wl,-Map,"4part1.map" -specs=nosys.specs -specs=nano.specs -Xlinker -z -Xlinker muldefs -o "4part1.elf" ./Sources/main.o ./Project_Settings/Startup_Code/startup.o ./Project_Settings/Startup_Code/startup_MK64F12.o ./Project_Settings/Startup_Code/system_MK64F12.o C:/Freescale/KSDK_1.3.0/lib/ksdk_platform_lib/kds/K64F12/debug/libksdk_platform.a
Finished building target: 4part1.elf

Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "4part1.elf"
text data bss dec hex filename
7100 112 2092 9304 2458 4part1.elf
Finished building: 4part1.siz


15:29:12 Build Finished (took 2s.438ms)

21 changes: 21 additions & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.ui/GPIO.build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
15:56:16 **** Incremental Build of configuration Debug for project GPIO ****
make all
Building file: ../Sources/main.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D"CPU_MK64FN1M0VMD12" -I"../Sources" -I"../Project_Settings/Startup_Code" -I"../SDK/platform/CMSIS/Include" -I"../SDK/platform/devices" -I"../SDK/platform/devices/MK64F12/include" -std=c99 -MMD -MP -MF"Sources/main.d" -MT"Sources/main.o" -c -o "Sources/main.o" "../Sources/main.c"
Finished building: ../Sources/main.c

Building target: GPIO.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T "MK64FN1M0xxx12_flash.ld" -Xlinker --gc-sections -L"C:/Users/pkalgaon/Desktop/Workspace/GPIO/Project_Settings/Linker_Files" -Wl,-Map,"GPIO.map" -specs=nosys.specs -specs=nano.specs -Xlinker -z -Xlinker muldefs -o "GPIO.elf" ./Sources/main.o ./Project_Settings/Startup_Code/startup.o ./Project_Settings/Startup_Code/startup_MK64F12.o ./Project_Settings/Startup_Code/system_MK64F12.o
Finished building target: GPIO.elf

Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "GPIO.elf"
text data bss dec hex filename
2140 108 2076 4324 10e4 GPIO.elf
Finished building: GPIO.siz


15:56:17 Build Finished (took 863ms)

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
16:05:12 **** Incremental Build of configuration Debug for project Interrupt ****
make all
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "GPIO.elf"
text data bss dec hex filename
2084 108 2076 4268 10ac GPIO.elf
Finished building: GPIO.siz


16:05:12 Build Finished (took 306ms)

11 changes: 11 additions & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.ui/UART.build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
16:15:50 **** Incremental Build of configuration Debug for project UART ****
make all
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "GPIO.elf"
text data bss dec hex filename
2056 108 2076 4240 1090 GPIO.elf
Finished building: GPIO.siz


16:15:51 Build Finished (took 305ms)

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<section name="Workbench">
<section name="completion_proposal_size">
</section>
<section name="org.eclipse.cdt.ui.text.hover.CMacroExpansionExploration">
</section>
</section>
34 changes: 34 additions & 0 deletions Workspace/.metadata/.plugins/org.eclipse.cdt.ui/global-build.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
16:13:03 **** Build of configuration Debug for project UART ****
make all
Building file: ../Sources/main.c
Invoking: Cross ARM C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -D"CPU_MK64FN1M0VMD12" -I"../Sources" -I"../Project_Settings/Startup_Code" -I"../SDK/platform/CMSIS/Include" -I"../SDK/platform/devices" -I"../SDK/platform/devices/MK64F12/include" -std=c99 -MMD -MP -MF"Sources/main.d" -MT"Sources/main.o" -c -o "Sources/main.o" "../Sources/main.c"
Finished building: ../Sources/main.c

Building target: GPIO.elf
Invoking: Cross ARM C++ Linker
arm-none-eabi-g++ -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -O0 -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -Wall -g3 -T "MK64FN1M0xxx12_flash.ld" -Xlinker --gc-sections -L"C:/Users/pkalgaon/Desktop/Workspace/UART/Project_Settings/Linker_Files" -Wl,-Map,"GPIO.map" -specs=nosys.specs -specs=nano.specs -Xlinker -z -Xlinker muldefs -o "GPIO.elf" ./Sources/main.o ./Project_Settings/Startup_Code/startup.o ./Project_Settings/Startup_Code/startup_MK64F12.o ./Project_Settings/Startup_Code/system_MK64F12.o
Finished building target: GPIO.elf

Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "GPIO.elf"
text data bss dec hex filename
2056 108 2076 4240 1090 GPIO.elf
Finished building: GPIO.siz

16:13:29 **** Incremental Build of configuration Debug for project UART ****
make all
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "GPIO.elf"
text data bss dec hex filename
2056 108 2076 4240 1090 GPIO.elf
Finished building: GPIO.siz

16:15:50 **** Incremental Build of configuration Debug for project UART ****
make all
Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "GPIO.elf"
text data bss dec hex filename
2056 108 2076 4240 1090 GPIO.elf
Finished building: GPIO.siz

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
15:28:30 **** Incremental Build of configuration debug for project ksdk_platform_lib_K64F12 ****
make -k all
make: Nothing to be done for 'all'.

15:28:31 Build Finished (took 1s.183ms)

Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#include "MK64F12.h"

int main(void)
{

SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK; /*Enable Port B Clock Gate Control*/
SIM_SCGC5 |= SIM_SCGC5_PORTE_MASK;/*Enable Port E Clock Gate Control*/
SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;/*Enable Port C Clock Gate Control*/
SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK; /*Enable Port A Clock Gate Control*/
PORTB_PCR21 = 0x100; /*Blue Led, configured as Alternative 1 (GPIO)*/
PORTB_PCR22 = 0x100;/*Red Led, configured as Alternative 1 (GPIO)*/
PORTE_PCR26 = 0x100;/*Green Led, configured as Alternative 1 (GPIO)*/
PORTC_PCR6 = 0X100;/*Switch 2, configured as Alternative 1 (GPIO)*/
PORTA_PCR4 = 0x100;/*Changing the NMI to GPIO*/
GPIOB_PDDR |= (1 << 21);/*Setting the bit 21 of the port B as Output*/
GPIOB_PDDR |= (1 << 22);/*Setting the bit 22 of the port B as Output*/
GPIOE_PDDR |= (1 << 26);/*Setting the bit 26 of the port E as Output*/
GPIOC_PDDR |= (0 << 6);/*Setting the bit 6 of the port C as Input*/
/*Turn off RGB Leds*/
GPIOB_PDOR |= (1 << 22);/*Turn Off Red Led*/
GPIOB_PDOR |= (1 << 21);/*Turn Off Blue Led*/
GPIOE_PDOR |= (1 << 26);/*Turn Off Green Led*/

unsigned long Counter = 0x100000;/*Delay Value*/

for(;;)
{
if(GPIOC_PDIR == 0)/*If the Switch 2 was press*/
{
GPIOB_PDOR = (1 << 21);/*Turn On Red Led*/
while(Counter != 0)/*Wait Delay Value*/
{
Counter--;
}
Counter = 0x100000;/*Recharger the Delay*/
GPIOB_PDOR = (1 << 22) | ( 1 << 21); /*Turn Off Red Led*/
while(Counter != 0)/*Wait Delay Value*/
{
Counter--;
}
Counter = 0x100000;/*Recharger the Delay*/
GPIOE_PDOR = (0 << 26);/*Turn On Green Led*/
while(Counter != 0)/*Wait Delay Value*/
{
Counter--;
}
Counter = 0x100000;/*Recharger the Delay*/
GPIOE_PDOR = (1 << 26); /*Turn Off Green Led*/
while(Counter != 0)/*Wait Delay Value*/
{
Counter--;
}
Counter = 0x100000;/*Recharger the Delay*/
GPIOB_PDOR = (1 << 22);/*Turn On Blue Led*/
while(Counter != 0)/*Wait Delay Value*/
{
Counter--;
}
Counter = 0x100000;/*Recharger the Delay*/
GPIOB_PDOR = (1 << 21) | (1 << 22); /*Turn Off Blue Led*/
while(Counter != 0)/*Wait Delay Value*/
{
Counter--;
}
Counter = 0x100000;/*Recharger the Delay*/
}
}
return 0;
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include "MK64F12.h"
void DelayFunction(void);
intmain(void)
{
SIM_SCGC5 |= SIM_SCGC5_PORTB_MASK; /*Enable Port B Clock Gate Control*/
SIM_SCGC5 |= SIM_SCGC5_PORTC_MASK;/*Enable Port C Clock Gate Control*/
SIM_SCGC5 |= SIM_SCGC5_PORTA_MASK; /*Enable Port A Clock Gate Control*/
PORTB_PCR21 = 0x100; /*Blue Led, configured as Alternative 1 (GPIO)*/
PORTB_PCR22 = 0x100;/*Red Led, configured as Alternative 1 (GPIO)*/
PORTC_PCR6 = 0x90100; /*PORTC_PCR6: ISF=0,IRQC=9,MUX=1 */
PORTA_PCR4 = 0x100;/*Changing the NMI to GPIO*/
GPIOB_PDDR |= (1 << 21);/*Setting the bit 21 of the port B as Output*/
GPIOB_PDDR |= (1 << 22);/*Setting the bit 22 of the port B as Output*/
GPIOC_PDDR |= (0 << 6);/*Setting the bit 6 of the port C as Input*/
/*Turn off Red and Blue Leds*/
GPIOB_PDOR |= (1 << 22);
GPIOB_PDOR |= (1 << 21);
/*Turn Off Red Led*/ /*Turn Off Blue Led*/
PORTC_ISFR = PORT_ISFR_ISF(0x40); /* Clear interrupt status flag */
NVIC_EnableIRQ(PORTC_IRQn);/*Enable the PORTC interrupt*/
for (;;)
{
GPIOB_PTOR |= (1 << 22); /*Red LED blinking*/
DelayFunction();
}
return 0;
}
void PORTC_IRQHandler(void)
{
DelayFunction();
GPIOB_PSOR |= (1 << 22);/*Turn Off Red Led*/
GPIOB_PCOR |= (1 << 21);/*Turn On Blue Led*/
DelayFunction();
GPIOB_PSOR |= (1 << 21);/*Turn Off Blue Led*/
DelayFunction();
PORTC_ISFR = PORT_ISFR_ISF(0x40);
}
/* Clear interrupt status flag */
void DelayFunction(void)
{
int cnt;
for(cnt=0; cnt<1000000; cnt++)
{
}
}
Loading

0 comments on commit 7ecfef6

Please sign in to comment.