[Cryptech-Commits] [sw/stm32] 04/12: Update LED pinouts, don't think the colors are right yet though.
git at cryptech.is
git at cryptech.is
Mon May 16 09:43:17 UTC 2016
This is an automated email from the git hooks/post-receive script.
fredrik at thulin.net pushed a commit to branch ft-alpha_board_bringup
in repository sw/stm32.
commit 2ddb4f618f34582ea8c9731898651284aec600e7
Author: Fredrik Thulin <fredrik at thulin.net>
AuthorDate: Thu May 12 19:49:20 2016 +0200
Update LED pinouts, don't think the colors are right yet though.
---
projects/board-test/led-test.c | 8 ++++++++
stm-init.c | 2 +-
stm-led.h | 10 +++++-----
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/projects/board-test/led-test.c b/projects/board-test/led-test.c
index 5e4401f..7e72788 100644
--- a/projects/board-test/led-test.c
+++ b/projects/board-test/led-test.c
@@ -7,6 +7,14 @@
#define DELAY() HAL_Delay(125)
+/*
+ * PK4 = ARM_LED1 - GREEN
+ * PK5 = ARM_LED2 - RED
+ * PK6 = ARM_LED3 - BLUE
+ ' PK7 = ARM_LED4 - YELLOW
+ */
+
+
void toggle_led(uint32_t times, uint32_t led_pin)
{
uint32_t i;
diff --git a/stm-init.c b/stm-init.c
index 0c0fd0f..216f127 100644
--- a/stm-init.c
+++ b/stm-init.c
@@ -169,7 +169,7 @@ static void MX_GPIO_Init(void)
GPIO_InitTypeDef GPIO_InitStruct;
/* GPIO Ports Clock Enable */
- __GPIOJ_CLK_ENABLE();
+ __GPIOK_CLK_ENABLE();
/* Configure LED GPIO pins PJ1==red, PJ2==yellow, PJ3==green, PJ4==blue */
GPIO_InitStruct.Pin = LED_RED | LED_YELLOW | LED_GREEN | LED_BLUE;
diff --git a/stm-led.h b/stm-led.h
index 5af084a..bcac463 100644
--- a/stm-led.h
+++ b/stm-led.h
@@ -37,11 +37,11 @@
#include "stm32f4xx_hal.h"
-#define LED_PORT GPIOJ
-#define LED_RED GPIO_PIN_1
-#define LED_YELLOW GPIO_PIN_2
-#define LED_GREEN GPIO_PIN_3
-#define LED_BLUE GPIO_PIN_4
+#define LED_PORT GPIOK
+#define LED_RED GPIO_PIN_5
+#define LED_YELLOW GPIO_PIN_7
+#define LED_GREEN GPIO_PIN_4
+#define LED_BLUE GPIO_PIN_6
#define led_on(pin) HAL_GPIO_WritePin(LED_PORT,pin,SET)
#define led_off(pin) HAL_GPIO_WritePin(LED_PORT,pin,RESET)
More information about the Commits
mailing list