MAX32660
380kHz ring oscillator with the default drivers
while (1) {
if (GPIO_InGet(&gpio_in)) {
GPIO_OutClr(&gpio_out);
} else {
GPIO_OutSet(&gpio_out);
}
}
3.21MHz ring oscillator with port manipulation
/***** Includes *****/
#include
#include
#include "gpio.h"
#include "max32660.h"
/***** Definitions *****/
#define GPIO_PORT_IN PORT_0
#define GPIO_PIN_IN PIN_12
#define GPIO_PORT_OUT PORT_0
#define GPIO_PIN_OUT PIN_10
int main(void)
{
while(1) {
if (MXC_GPIO0->in & GPIO_PIN_IN) {
MXC_GPIO0->out_clr = GPIO_PIN_OUT;
} else {
MXC_GPIO0->out_set = GPIO_PIN_OUT;
}
}
}
Back