CS计算机代考程序代写 #include

#include
#include “LEDs.h”

void Init_RGB_LEDs(void) {
// Enable clock to ports A and D

// Make 3 pins for LEDs GPIO

// Set 3 pins for LEDs as outputs

}

void Control_RGB_LEDs(unsigned int red_on, unsigned int green_on, unsigned int blue_on) {
if (red_on) {
PTA->PCOR = MASK(RED_LED_POS);
} else {
PTA->PSOR = MASK(RED_LED_POS);
}
if (green_on) {
PTD->PCOR = MASK(GREEN_LED_POS);
} else {
PTD->PSOR = MASK(GREEN_LED_POS);
}
if (blue_on) {
PTA->PCOR = MASK(BLUE_LED_POS);
} else {
PTA->PSOR = MASK(BLUE_LED_POS);
}
}