Update for MKL27Z

This commit is contained in:
NIIBE Yutaka
2016-06-30 16:16:39 +09:00
parent c71a24ddcb
commit e7bd234a0d
9 changed files with 82 additions and 63 deletions

View File

@@ -7,27 +7,7 @@
#include "tty.h"
#include "board.h"
#include "command.h"
struct GPIO {
volatile uint32_t PDOR; /* Port Data Output Register */
volatile uint32_t PSOR; /* Port Set Output Register */
volatile uint32_t PCOR; /* Port Clear Output Register */
volatile uint32_t PTOR; /* Port Toggle Output Register */
volatile uint32_t PDIR; /* Port Data Input Register */
volatile uint32_t PDDR; /* Port Data Direction Register */
};
static struct GPIO *const GPIOB = (struct GPIO *const)0x400FF040;
static struct GPIO *const GPIOD = (struct GPIO *const)0x400FF0C0;
static struct GPIO *const GPIOE = (struct GPIO *const)0x400FF100;
static void
set_led (int on)
{
if (on)
GPIOB->PCOR = (1 << 0); /* PTB0: Clear: Light on */
else
GPIOB->PSOR = (1 << 0); /* PTB0: Set : Light off */
}
#include <sys.h>
static chopstx_mutex_t mtx;
static chopstx_cond_t cnd0;