mpc_cv6_leds/leds.cpp

49 lines
914 B
C++
Raw Normal View History

2020-12-11 16:32:57 +01:00
/*
* leds.c
*
* This is driver for the LEDs on evaluation board for FRDM-KL25Z.
*/
#include <cstdio>
2020-12-11 16:32:57 +01:00
/* Include the main definitions for our MCU */
//#include "MKL25Z4.h"
/* Include the header file for this driver */
#include "leds.h"
/* Include GPIO driver which we will use internally */
//#include "drv_gpio.h"
#include "simul_kl25z.h"
void LEDS_Init(void) {
/* Enable port clock, set pin function to GPIO*/
GPIO_Initialize();
/* Configure pins as output*/
pinMode(LED_GREEN, OUTPUT);
/* Turn off the LEDs; they are turned off by HIGH value. */
pinWrite(LED_GREEN, HIGH);
}
/* Turn on green LED (RGB LED on FRDM-KL25Z board) */
void LEDS_GreenOn(void) {
pinWrite(LED_GREEN, LOW);
}
/* Turn off green LED (RGB LED on FRDM-KL25Z board) */
void LEDS_GreenOff(void) {
pinWrite(LED_GREEN, HIGH);
}
// TODO: add more functions...