diff options
author | flabbergast <s3+flabbergast@sdfeu.org> | 2016-05-08 09:09:43 +0100 |
---|---|---|
committer | flabbergast <s3+flabbergast@sdfeu.org> | 2016-05-08 09:09:43 +0100 |
commit | 7d99206f055a3527bf1aa92052f9923f6cb744a5 (patch) | |
tree | 80fc513f4a5f47e3bb1be9aae57c20bad30e7641 /testhal/KINETIS | |
parent | cf02c79b5aa7209542cbf1b0cefe703a2c0c60be (diff) | |
download | ChibiOS-Contrib-7d99206f055a3527bf1aa92052f9923f6cb744a5.tar.gz ChibiOS-Contrib-7d99206f055a3527bf1aa92052f9923f6cb744a5.tar.bz2 ChibiOS-Contrib-7d99206f055a3527bf1aa92052f9923f6cb744a5.zip |
[KINETIS] PAL driver: implement PAL_LINE.
Diffstat (limited to 'testhal/KINETIS')
-rw-r--r-- | testhal/KINETIS/FRDM-KL25Z/PWM/main.c | 10 | ||||
-rw-r--r-- | testhal/KINETIS/FRDM-KL26Z/PWM/main.c | 16 | ||||
-rw-r--r-- | testhal/KINETIS/MCHCK/PWM/main.c | 4 | ||||
-rw-r--r-- | testhal/KINETIS/TEENSY_LC/PWM/main.c | 4 |
4 files changed, 17 insertions, 17 deletions
diff --git a/testhal/KINETIS/FRDM-KL25Z/PWM/main.c b/testhal/KINETIS/FRDM-KL25Z/PWM/main.c index b7e873c..32d8020 100644 --- a/testhal/KINETIS/FRDM-KL25Z/PWM/main.c +++ b/testhal/KINETIS/FRDM-KL25Z/PWM/main.c @@ -99,17 +99,17 @@ int main(void) { /* * Turn off the RGB LED. */ - palSetPad(GPIO_LED_RED, PIN_LED_RED); /* red */ - palSetPad(GPIO_LED_GREEN, PIN_LED_GREEN); /* green */ - palSetPad(GPIO_LED_BLUE, PIN_LED_BLUE); /* blue */ + palSetLine(LINE_LED_RED); /* red */ + palSetLine(LINE_LED_GREEN); /* green */ + palSetLine(LINE_LED_BLUE); /* blue */ /* * Start the PWM driver, route TPM2 output to PTB18, PTB19. * Enable channels now to avoid a blink later. */ pwmStart(&PWM_DRIVER, &pwmcfg); - palSetPadMode(GPIO_LED_RED, PIN_LED_RED, PAL_MODE_ALTERNATIVE_3); - palSetPadMode(GPIO_LED_GREEN, PIN_LED_GREEN, PAL_MODE_ALTERNATIVE_3); + palSetLineMode(LINE_LED_RED, PAL_MODE_ALTERNATIVE_3); + palSetLineMode(LINE_LED_GREEN, PAL_MODE_ALTERNATIVE_3); pwmEnableChannel(&PWM_DRIVER, 0, 0); pwmEnableChannel(&PWM_DRIVER, 1, 0); diff --git a/testhal/KINETIS/FRDM-KL26Z/PWM/main.c b/testhal/KINETIS/FRDM-KL26Z/PWM/main.c index 9e41bf6..740471a 100644 --- a/testhal/KINETIS/FRDM-KL26Z/PWM/main.c +++ b/testhal/KINETIS/FRDM-KL26Z/PWM/main.c @@ -104,9 +104,9 @@ static THD_FUNCTION(ButtonThread, arg) { uint8_t newstate, state = PAL_HIGH; while(true) { - if(palReadPad(GPIO_BUTTON, PIN_BUTTON) != state) { + if(palReadLine(LINE_BUTTON) != state) { chThdSleepMilliseconds(20); /* debounce */ - newstate = palReadPad(GPIO_BUTTON, PIN_BUTTON); + newstate = palReadLine(LINE_BUTTON); if(newstate != state) { state = newstate; if(newstate == PAL_LOW) { @@ -135,9 +135,9 @@ int main(void) { /* * Turn off the RGB LED. */ - palSetPad(GPIO_LED_RED, PIN_LED_RED); /* red */ - palSetPad(GPIO_LED_GREEN, PIN_LED_GREEN); /* green */ - palSetPad(GPIO_LED_BLUE, PIN_LED_BLUE); /* blue */ + palSetLine(LINE_LED_RED); /* red */ + palSetLine(LINE_LED_GREEN); /* green */ + palSetLine(LINE_LED_BLUE); /* blue */ /* * Create the button check thread. @@ -149,9 +149,9 @@ int main(void) { * Enable channels now to avoid a blink later. */ pwmStart(&PWM_DRIVER, &pwmcfg); - palSetPadMode(GPIO_LED_RED, PIN_LED_RED, PAL_MODE_ALTERNATIVE_3); - palSetPadMode(GPIO_LED_GREEN, PIN_LED_GREEN, PAL_MODE_ALTERNATIVE_3); - palSetPadMode(GPIO_LED_BLUE, PIN_LED_BLUE, PAL_MODE_ALTERNATIVE_4); + palSetLineMode(LINE_LED_RED, PAL_MODE_ALTERNATIVE_3); + palSetLineMode(LINE_LED_GREEN, PAL_MODE_ALTERNATIVE_3); + palSetLineMode(LINE_LED_BLUE, PAL_MODE_ALTERNATIVE_4); pwmEnableChannel(&PWM_DRIVER, 2, 0); pwmEnableChannel(&PWM_DRIVER, 4, 0); pwmEnableChannel(&PWM_DRIVER, 5, 0); diff --git a/testhal/KINETIS/MCHCK/PWM/main.c b/testhal/KINETIS/MCHCK/PWM/main.c index 9ac569f..f92512e 100644 --- a/testhal/KINETIS/MCHCK/PWM/main.c +++ b/testhal/KINETIS/MCHCK/PWM/main.c @@ -19,12 +19,12 @@ static void pwmpcb(PWMDriver *pwmp) {
(void)pwmp;
- palSetPad(GPIOB, GPIOB_LED);
+ palSetLine(LINE_LED);
}
static void pwmc0cb(PWMDriver *pwmp) {
(void)pwmp;
- palClearPad(GPIOB, GPIOB_LED);
+ palClearLine(LINE_LED);
}
static PWMConfig pwmcfg = {
diff --git a/testhal/KINETIS/TEENSY_LC/PWM/main.c b/testhal/KINETIS/TEENSY_LC/PWM/main.c index b366e9e..f8e6ba2 100644 --- a/testhal/KINETIS/TEENSY_LC/PWM/main.c +++ b/testhal/KINETIS/TEENSY_LC/PWM/main.c @@ -19,12 +19,12 @@ static void pwmpcb(PWMDriver *pwmp) {
(void)pwmp;
- palSetPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13);
+ palSetLine(LINE_LED);
}
static void pwmc0cb(PWMDriver *pwmp) {
(void)pwmp;
- palClearPad(TEENSY_PIN13_IOPORT, TEENSY_PIN13);
+ palClearLine(LINE_LED);
}
static PWMConfig pwmcfg = {
|