LPC800

MRT.h

#pragma once #include "LPC8xx.h" #define IDLE 0 #define RUNNING 1 class MRT { public: MRT(int channel); /** write down counter * @param interval start count */ void write(uint32_t interval); /** read down counter */ uint32_t read(); int st…

Multi-Rate Timer (MRT)

#include "mbed.h" DigitalOut led1(LED1); extern "C" void MRT_IRQHandler() { if (LPC_MRT->Channel[3].STAT & 1) { led1 = !led1; LPC_MRT->Channel[3].STAT |= 1; // clear interrupt } } int main() { LPC_SYSCON->SYSAHBCLKCTRL |= 1<<10; // enable …