summaryrefslogtreecommitdiff
path: root/project/Core/Src/LED.c
diff options
context:
space:
mode:
authorsowgro <tpoke.ferrari@gmail.com>2025-09-02 14:45:40 -0400
committersowgro <tpoke.ferrari@gmail.com>2025-09-02 14:45:40 -0400
commite3a880051ccf1ba9a16fd9cf031b7386b2533bf1 (patch)
tree96a096b2a668bf7b7929385ebb54c1a3cbd1b9d2 /project/Core/Src/LED.c
parent0ff718e7cd7159c30636aa323a666ac1af684f63 (diff)
download340-repo-Sowgro-e3a880051ccf1ba9a16fd9cf031b7386b2533bf1.tar.gz
340-repo-Sowgro-e3a880051ccf1ba9a16fd9cf031b7386b2533bf1.tar.bz2
340-repo-Sowgro-e3a880051ccf1ba9a16fd9cf031b7386b2533bf1.zip
Organized project
Diffstat (limited to 'project/Core/Src/LED.c')
-rw-r--r--project/Core/Src/LED.c49
1 files changed, 0 insertions, 49 deletions
diff --git a/project/Core/Src/LED.c b/project/Core/Src/LED.c
deleted file mode 100644
index 8b1b9b2..0000000
--- a/project/Core/Src/LED.c
+++ /dev/null
@@ -1,49 +0,0 @@
-#include "LED.h"
-
-
-//******************************************************************************************
-// User LED = LD2 Green LED = PA.5
-//******************************************************************************************
-#define LED_PIN 5
-
-void LED_Init(void){
-
- // Enable the peripheral clock of GPIO Port
- RCC->AHB2ENR |= RCC_AHB2ENR_GPIOAEN;
-
- // GPIO Mode: Input(00), Output(01), AlterFunc(10), Analog(11, reset)
- GPIOA->MODER &= ~(3U<<(2*LED_PIN));
- GPIOA->MODER |= 1U<<(2*LED_PIN); // Output(01)
-
- // GPIO Speed: Low speed (00), Medium speed (01), Fast speed (10), High speed (11)
- GPIOA->OSPEEDR &= ~(3U<<(2*LED_PIN));
- GPIOA->OSPEEDR |= 3U<<(2*LED_PIN); // High speed
-
- // GPIO Output Type: Output push-pull (0, reset), Output open drain (1)
- GPIOA->OTYPER &= ~(1U<<LED_PIN); // Push-pull
-
- // GPIO Push-Pull: No pull-up, pull-down (00), Pull-up (01), Pull-down (10), Reserved (11)
- GPIOA->PUPDR &= ~(3U<<(2*LED_PIN)); // No pull-up, no pull-down
-
-}
-
-//******************************************************************************************
-// Turn LED On
-//******************************************************************************************
-void LED_On(void){
- GPIOA->ODR |= (1UL<<LED_PIN);
-}
-
-//******************************************************************************************
-// Turn LED Off
-//******************************************************************************************
-void LED_Off(void){
- GPIOA->ODR &= ~(1UL<<LED_PIN);
-}
-
-//******************************************************************************************
-// Toggle LED
-//******************************************************************************************
-void LED_Toggle(void){
- GPIOA->ODR ^= (1UL<<LED_PIN);
-}