URGENT PLEASE
PF4 Question 3 (30 Points): You will be writing a code, which will light the LEDs (connected to PF1-3) with a specific color, when a switch 1 (SW1) is pressed. Below is the register list you need: PF1 EQU Ox40025008 ; RED LED PIN PF2 EQU 0x40025010 ; BLUE LED PIN PF3 EQU 0x40025020 ; GREEN LED PIN EQU Ox40025040 ;SWI PIN GPIO_PORTF_DATA_R EQU 0x400253FC ; PORTE Data Register a) (12 Points) Assuming that Port F is properly initialized, write 4 separate subroutines: Redon, which would turn the Red LED on, when called. BlueOn, which would turn the Blue LED on, when called. Greenon, which would turn the Green LED on, when called. LEDsOff, turn all LEDs off. b) (8 Points) Write a subroutine BusyWaitswi, which would busy-wait for SW1 to be pressed. In other words, when this subroutine is called, it will not return until SW1 is pressed. c) (10 Points) Write a subroutine Yellowish which is simple an infinite loop that creates the color yellow on LEDs. However, the brightness of this yellow color is designated by the value inside RO. If RO is 1 (one), then it is at minimum brightness; and if it is 100, it is at maximum brightness. This subroutine is a no-return subroutine. In other words, when you call it, the infinite loop will not allow it to return. Hint: Yellow is Red + Green, no Blues. And you may have to use the subroutines you have written in a). PF4 Question 3 (30 Points): You will be writing a code, which will light the LEDs (connected to PF1-3) with a specific color, when a switch 1 (SW1) is pressed. Below is the register list you need: PF1 EQU Ox40025008 ; RED LED PIN PF2 EQU 0x40025010 ; BLUE LED PIN PF3 EQU 0x40025020 ; GREEN LED PIN EQU Ox40025040 ;SWI PIN GPIO_PORTF_DATA_R EQU 0x400253FC ; PORTE Data Register a) (12 Points) Assuming that Port F is properly initialized, write 4 separate subroutines: Redon, which would turn the Red LED on, when called. BlueOn, which would turn the Blue LED on, when called. Greenon, which would turn the Green LED on, when called. LEDsOff, turn all LEDs off. b) (8 Points) Write a subroutine BusyWaitswi, which would busy-wait for SW1 to be pressed. In other words, when this subroutine is called, it will not return until SW1 is pressed. c) (10 Points) Write a subroutine Yellowish which is simple an infinite loop that creates the color yellow on LEDs. However, the brightness of this yellow color is designated by the value inside RO. If RO is 1 (one), then it is at minimum brightness; and if it is 100, it is at maximum brightness. This subroutine is a no-return subroutine. In other words, when you call it, the infinite loop will not allow it to return. Hint: Yellow is Red + Green, no Blues. And you may have to use the subroutines you have written in a)