@@ -0,0 +1,1312 @@
+package com.uxxu.konashi.lib.util;%0A%0Aimport com.uxxu.konashi.lib.Konashi;%0Aimport com.uxxu.konashi.lib.KonashiUtils;%0A%0Aimport java.util.Arrays;%0A%0A/**%0A * Created by izumin on 9/18/15.%0A */%0Apublic final class PwmUtils %7B%0A    private PwmUtils() %7B%0A        throw new AssertionError(%22constructor of the utility class should not be called%22);%0A    %7D%0A%0A    public static boolean isValidPin(int pin) %7B%0A        return (pin %3E= Konashi.PIO0) && (pin %3C= Konashi.PIO2);%0A    %7D%0A%0A    public static boolean isValidMode(int mode) %7B%0A        return (mode == Konashi.PWM_ENABLE) %7C%7C (mode == Konashi.PWM_DISABLE)%0A                %7C%7C (mode == Konashi.PWM_ENABLE_LED_MODE);%0A    %7D%0A%0A    public static boolean isValidPeriod(int period, int duty) %7B%0A        return duty %3C= period;%0A    %7D%0A%0A    public static boolean isValidDuty(int duty, int period) %7B%0A        return duty %3C= period;%0A    %7D%0A%0A    public static boolean isValidDutyRatio(float dutyRatio) %7B%0A        return dutyRatio %3E= 0.0 && dutyRatio %3C= 100.0;%0A    %7D%0A%0A    public static int getPwmDuty(byte%5B%5D value) %7B%0A        byte%5B%5D bytes = Arrays.copyOfRange(value, 1, value.length);%0A        return KonashiUtils.bytes2int(bytes);%0A    %7D%0A%0A    public static int getPwmPeriod(byte%5B%5D value) %7B%0A        byte%5B%5D bytes = Arrays.copyOfRange(value, 1, value.length);%0A        return KonashiUtils.bytes2int(bytes);%0A    %7D%0A%7D

Add PwmUtils