2013-10-11から1日間の記事一覧

MRT.cpp

#include "MRT.h" MRT::MRT(int channel) { LPC_SYSCON->SYSAHBCLKCTRL |= (1<<10); // enable MRT LPC_SYSCON->PRESETCTRL |= (1<<7); // reset MRT _ch = &LPC_MRT->Channel[channel]; _ch->CTRL |= (1<<1); // one-shot } void MRT::write(uint32_t inter…

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…