summaryrefslogtreecommitdiff
path: root/project/Core/Inc/Devices
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/Inc/Devices
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/Inc/Devices')
-rw-r--r--project/Core/Inc/Devices/GPIO.h18
-rw-r--r--project/Core/Inc/Devices/LED.h12
-rw-r--r--project/Core/Inc/Devices/UART.h18
-rw-r--r--project/Core/Inc/Devices/adc.h19
-rw-r--r--project/Core/Inc/Devices/dac.h19
5 files changed, 86 insertions, 0 deletions
diff --git a/project/Core/Inc/Devices/GPIO.h b/project/Core/Inc/Devices/GPIO.h
new file mode 100644
index 0000000..cb602d8
--- /dev/null
+++ b/project/Core/Inc/Devices/GPIO.h
@@ -0,0 +1,18 @@
+/*
+ * gpio.h
+ *
+ * Created on: Nov 4, 2021
+ * Author: Mitesh Parikh
+ */
+
+#ifndef INC_GPIO_H_
+#define INC_GPIO_H_
+
+#include "main.h"
+
+#define S1_Pin GPIO_PIN_9
+#define S1_GPIO_Port GPIOA
+
+void GPIO_Init(void);
+
+#endif /* INC_GPIO_H_ */
diff --git a/project/Core/Inc/Devices/LED.h b/project/Core/Inc/Devices/LED.h
new file mode 100644
index 0000000..464b56b
--- /dev/null
+++ b/project/Core/Inc/Devices/LED.h
@@ -0,0 +1,12 @@
+#ifndef __NUCLEO476_LED_H
+#define __NUCLEO476_LED_H
+
+#include "stm32l476xx.h"
+
+void LED_Init(void);
+
+void LED_Off(void);
+void LED_On(void);
+void LED_Toggle(void);
+
+#endif /* __NUCLEO476_LED_H */
diff --git a/project/Core/Inc/Devices/UART.h b/project/Core/Inc/Devices/UART.h
new file mode 100644
index 0000000..e9c0f33
--- /dev/null
+++ b/project/Core/Inc/Devices/UART.h
@@ -0,0 +1,18 @@
+#ifndef __NUCLEO476_UART_H
+#define __NUCLEO476_UART_H
+
+#include "stm32l476xx.h"
+
+#define BUFFER_SIZE (32)
+
+void UART2_Init(void);
+void UART2_GPIO_Init(void);
+void USART1_IRQHandler(void);
+void USART2_IRQHandler(void);
+void USART_Init(USART_TypeDef * USARTx);
+void USART_Write(USART_TypeDef * USARTx, uint8_t *buffer, uint32_t nBytes);
+uint8_t USART_Read(USART_TypeDef * USARTx);
+void USART_Delay(uint32_t us);
+void USART_IRQHandler(USART_TypeDef * USARTx, uint8_t *buffer, uint32_t * pRx_counter);
+
+#endif /* __NUCLEO476_UART_H */
diff --git a/project/Core/Inc/Devices/adc.h b/project/Core/Inc/Devices/adc.h
new file mode 100644
index 0000000..15713a8
--- /dev/null
+++ b/project/Core/Inc/Devices/adc.h
@@ -0,0 +1,19 @@
+/*
+ * adc.h
+ *
+ * Created on: Apr 13, 2022
+ * Author: bruce
+ */
+
+#ifndef INC_ADC_H_
+#define INC_ADC_H_
+
+#include "stm32l4xx.h"
+
+#define ADC_CHANNEL ADC_CHANNEL_5 // A0 on the left connector
+
+void ADC_Init ();
+void ADC_Start ();
+uint32_t ADC_Read_Value_Blocking ();
+
+#endif /* INC_ADC_H_ */
diff --git a/project/Core/Inc/Devices/dac.h b/project/Core/Inc/Devices/dac.h
new file mode 100644
index 0000000..6425c77
--- /dev/null
+++ b/project/Core/Inc/Devices/dac.h
@@ -0,0 +1,19 @@
+/*
+ * dac.h
+ *
+ * Created on: Apr 13, 2022
+ * Author: bruce
+ */
+
+#ifndef INC_DAC_H_
+#define INC_DAC_H_
+
+#include "stm32l4xx.h"
+
+// Uses A2 on the right connector
+
+void DAC_Init ();
+void DAC_Start ();
+void DAC_Set_Value (uint32_t value);
+
+#endif /* INC_DAC_H_ */