aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/STM32/STM32F7xx
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2015-11-02 10:07:40 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2015-11-02 10:07:40 +0000
commitb8c517e46d35e5c9691545eda8fe9b6c40d6943a (patch)
tree1979780cb2222b6ee45d49fe054343e5cc99fbd8 /testhal/STM32/STM32F7xx
parentca59ce3238108443bf04729f717f9c37d3472937 (diff)
downloadChibiOS-b8c517e46d35e5c9691545eda8fe9b6c40d6943a.tar.gz
ChibiOS-b8c517e46d35e5c9691545eda8fe9b6c40d6943a.tar.bz2
ChibiOS-b8c517e46d35e5c9691545eda8fe9b6c40d6943a.zip
Lines support in PAL driver.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@8417 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'testhal/STM32/STM32F7xx')
-rw-r--r--testhal/STM32/STM32F7xx/GPT-ADC/main.c6
-rw-r--r--testhal/STM32/STM32F7xx/PWM-ICU/main.c12
-rw-r--r--testhal/STM32/STM32F7xx/SPI/main.c35
-rw-r--r--testhal/STM32/STM32F7xx/USB_CDC/main.c8
4 files changed, 28 insertions, 33 deletions
diff --git a/testhal/STM32/STM32F7xx/GPT-ADC/main.c b/testhal/STM32/STM32F7xx/GPT-ADC/main.c
index e3790371a..06fc68a26 100644
--- a/testhal/STM32/STM32F7xx/GPT-ADC/main.c
+++ b/testhal/STM32/STM32F7xx/GPT-ADC/main.c
@@ -120,11 +120,11 @@ static THD_FUNCTION(Thread1, arg) {
(void)arg;
chRegSetThreadName("blinker");
- palSetPadMode(GPIOI, GPIOI_ARD_D13, PAL_MODE_OUTPUT_PUSHPULL);
+ palSetLineMode(LINE_ARD_D13, PAL_MODE_OUTPUT_PUSHPULL);
while (true) {
- palSetPad(GPIOI, GPIOI_ARD_D13);
+ palSetLine(LINE_ARD_D13);
chThdSleepMilliseconds(500);
- palClearPad(GPIOI, GPIOI_ARD_D13);
+ palClearLine(LINE_ARD_D13);
chThdSleepMilliseconds(500);
}
}
diff --git a/testhal/STM32/STM32F7xx/PWM-ICU/main.c b/testhal/STM32/STM32F7xx/PWM-ICU/main.c
index 78d51d7da..27bb7edac 100644
--- a/testhal/STM32/STM32F7xx/PWM-ICU/main.c
+++ b/testhal/STM32/STM32F7xx/PWM-ICU/main.c
@@ -53,13 +53,13 @@ icucnt_t last_width, last_period;
static void icuwidthcb(ICUDriver *icup) {
- palSetPad(GPIOI, GPIOI_ARD_D13);
+ palSetLine(LINE_ARD_D13);
last_width = icuGetWidthX(icup);
}
static void icuperiodcb(ICUDriver *icup) {
- palClearPad(GPIOI, GPIOI_ARD_D13);
+ palClearLine(LINE_ARD_D13);
last_period = icuGetPeriodX(icup);
}
@@ -103,20 +103,20 @@ int main(void) {
*/
pwmStart(&PWMD1, &pwmcfg);
pwmEnablePeriodicNotification(&PWMD1);
- palSetPadMode(GPIOA, GPIOA_ARD_D5, PAL_MODE_ALTERNATE(1));
+ palSetLineMode(LINE_ARD_D5, PAL_MODE_ALTERNATE(1));
/*
* Starting ICU driver 2.
* GPIOA15 is programmed as ICU input (channel 1 of TIM2).
*/
icuStart(&ICUD2, &icucfg);
- palSetPadMode(GPIOA, GPIOA_ARD_D9, PAL_MODE_ALTERNATE(1));
+ palSetLineMode(LINE_ARD_D9, PAL_MODE_ALTERNATE(1));
/*
* GPIOI1 is programmed as output (board LED).
*/
- palClearPad(GPIOI, GPIOI_ARD_D13);
- palSetPadMode(GPIOI, GPIOI_ARD_D13, PAL_MODE_OUTPUT_PUSHPULL);
+ palClearLine(LINE_ARD_D13);
+ palSetLineMode(LINE_ARD_D13, PAL_MODE_OUTPUT_PUSHPULL);
chThdSleepMilliseconds(1000);
/*
diff --git a/testhal/STM32/STM32F7xx/SPI/main.c b/testhal/STM32/STM32F7xx/SPI/main.c
index 547e49501..4a89aa958 100644
--- a/testhal/STM32/STM32F7xx/SPI/main.c
+++ b/testhal/STM32/STM32F7xx/SPI/main.c
@@ -148,26 +148,21 @@ int main(void) {
/*
* SPI2 I/O pins setup.
*/
- palSetPadMode(GPIOI,
- GPIOI_ARD_D13,
- PAL_MODE_ALTERNATE(5) |
- PAL_STM32_OSPEED_HIGHEST); /* SPI SCK. */
- palSetPadMode(GPIOB,
- GPIOB_ARD_D12,
- PAL_MODE_ALTERNATE(5) |
- PAL_STM32_OSPEED_HIGHEST); /* MISO. */
- palSetPadMode(GPIOB,
- GPIOB_ARD_D11,
- PAL_MODE_ALTERNATE(5) |
- PAL_STM32_OSPEED_HIGHEST); /* MOSI. */
- palSetPad(GPIOB, GPIOB_ARD_D15);
- palSetPadMode(GPIOB,
- GPIOB_ARD_D15,
- PAL_MODE_OUTPUT_PUSHPULL); /* CS0. */
- palSetPad(GPIOB, GPIOB_ARD_D14);
- palSetPadMode(GPIOB,
- GPIOB_ARD_D14,
- PAL_MODE_OUTPUT_PUSHPULL); /* CS1. */
+ palSetLineMode(LINE_ARD_D13,
+ PAL_MODE_ALTERNATE(5) |
+ PAL_STM32_OSPEED_HIGHEST); /* SPI SCK. */
+ palSetLineMode(LINE_ARD_D12,
+ PAL_MODE_ALTERNATE(5) |
+ PAL_STM32_OSPEED_HIGHEST); /* MISO. */
+ palSetLineMode(LINE_ARD_D11,
+ PAL_MODE_ALTERNATE(5) |
+ PAL_STM32_OSPEED_HIGHEST); /* MOSI. */
+ palSetLine(LINE_ARD_D15);
+ palSetLineMode(LINE_ARD_D15,
+ PAL_MODE_OUTPUT_PUSHPULL); /* CS0. */
+ palSetLine(LINE_ARD_D14);
+ palSetLineMode(LINE_ARD_D14,
+ PAL_MODE_OUTPUT_PUSHPULL); /* CS1. */
/*
* Starting the transmitter and receiver threads.
diff --git a/testhal/STM32/STM32F7xx/USB_CDC/main.c b/testhal/STM32/STM32F7xx/USB_CDC/main.c
index 92894ee5a..d992623c0 100644
--- a/testhal/STM32/STM32F7xx/USB_CDC/main.c
+++ b/testhal/STM32/STM32F7xx/USB_CDC/main.c
@@ -147,9 +147,9 @@ static THD_FUNCTION(Thread1, arg) {
systime_t time;
time = serusbcfg.usbp->state == USB_ACTIVE ? 250 : 500;
- palClearPad(GPIOI, GPIOI_ARD_D13);
+ palClearLine(LINE_ARD_D13);
chThdSleepMilliseconds(time);
- palSetPad(GPIOI, GPIOI_ARD_D13);
+ palSetLine(LINE_ARD_D13);
chThdSleepMilliseconds(time);
}
}
@@ -179,8 +179,8 @@ int main(void) {
/*
* GPIOI1 is programmed as output (board LED).
*/
- palClearPad(GPIOI, GPIOI_ARD_D13);
- palSetPadMode(GPIOI, GPIOI_ARD_D13, PAL_MODE_OUTPUT_PUSHPULL);
+ palClearLine(LINE_ARD_D13);
+ palSetLineMode(LINE_ARD_D13, PAL_MODE_OUTPUT_PUSHPULL);
/*
* Activates the USB driver and then the USB bus pull-up on D+.