DIY Logging Volt/Ampmeter
main.h File Reference

Main header-file for the high-precision logging voltage/current meter project. More...

Go to the source code of this file.

Macros

#define SW0_Pin   LL_GPIO_PIN_0
 
#define SW0_GPIO_Port   GPIOA
 
#define SW0_EXTI_IRQn   EXTI0_IRQn
 
#define SW1_Pin   LL_GPIO_PIN_1
 
#define SW1_GPIO_Port   GPIOA
 
#define SW1_EXTI_IRQn   EXTI1_IRQn
 
#define V_ENin_Pin   LL_GPIO_PIN_4
 
#define V_ENin_GPIO_Port   GPIOA
 
#define A_ENin_Pin   LL_GPIO_PIN_1
 
#define A_ENin_GPIO_Port   GPIOB
 
#define LED_Pin   LL_GPIO_PIN_2
 
#define LED_GPIO_Port   GPIOB
 
#define Buzzer_Pin   LL_GPIO_PIN_13
 
#define Buzzer_GPIO_Port   GPIOB
 
#define UART1_3V3out_Pin   LL_GPIO_PIN_14
 
#define UART1_3V3out_GPIO_Port   GPIOB
 
#define Relay_Pin   LL_GPIO_PIN_8
 
#define Relay_GPIO_Port   GPIOA
 
#define ENC_Key_Pin   LL_GPIO_PIN_5
 
#define ENC_Key_GPIO_Port   GPIOB
 
#define ENC_Key_EXTI_IRQn   EXTI9_5_IRQn
 
#define UART1_ENout_Pin   LL_GPIO_PIN_8
 
#define UART1_ENout_GPIO_Port   GPIOB
 
#define UART1_DTRout_Pin   LL_GPIO_PIN_9
 
#define UART1_DTRout_GPIO_Port   GPIOB
 
#define GPIO1_Pin   LL_GPIO_PIN_5
 
#define GPIO1_Port   GPIOA
 
#define GPIO2_Pin   LL_GPIO_PIN_13
 
#define GPIO2_Port   GPIOC
 

Functions

void Error_Handler (void)
 This function is executed in case of error occurrence. More...
 

Detailed Description

Main header-file for the high-precision logging voltage/current meter project.

Version
1.0
Author
Brecht Van Eeckhoudt

Versions

  • v1.0: Initial version.

Attention
Due to mistakes in the schematic/PCB-layout of the first hardware board the functionality of some GPIO pins is swapped:
  • UART1_ENout is not used, but UART1_3V3out instead.
  • SW0and SW0 are swapped with GPIO1and GPIO2 so the internal circuitry can be used for encoder-turn logic.

License

Copyright (C) 2021 - Brecht Van Eeckhoudt

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

A copy of the GNU General Public License can be found in the LICENSE file along with this source code.


Some methods also use code obtained from examples from STMicroelectronics.

Copyright (c) 2020 STMicroelectronics. All rights reserved.

These sections are licensed by ST under BSD 3-Clause license, the "License"; One may not use these example files except in compliance with the License. One may obtain a copy of the License at: opensource.org/licenses/BSD-3-Clause

Definition in file main.h.

Macro Definition Documentation

◆ A_ENin_GPIO_Port

#define A_ENin_GPIO_Port   GPIOB

Definition at line 119 of file main.h.

◆ A_ENin_Pin

#define A_ENin_Pin   LL_GPIO_PIN_1

Definition at line 118 of file main.h.

◆ Buzzer_GPIO_Port

#define Buzzer_GPIO_Port   GPIOB

Definition at line 123 of file main.h.

◆ Buzzer_Pin

#define Buzzer_Pin   LL_GPIO_PIN_13

Definition at line 122 of file main.h.

◆ ENC_Key_EXTI_IRQn

#define ENC_Key_EXTI_IRQn   EXTI9_5_IRQn

Definition at line 130 of file main.h.

◆ ENC_Key_GPIO_Port

#define ENC_Key_GPIO_Port   GPIOB

Definition at line 129 of file main.h.

◆ ENC_Key_Pin

#define ENC_Key_Pin   LL_GPIO_PIN_5

Definition at line 128 of file main.h.

◆ GPIO1_Pin

#define GPIO1_Pin   LL_GPIO_PIN_5

Definition at line 137 of file main.h.

◆ GPIO1_Port

#define GPIO1_Port   GPIOA

Definition at line 138 of file main.h.

◆ GPIO2_Pin

#define GPIO2_Pin   LL_GPIO_PIN_13

Definition at line 139 of file main.h.

◆ GPIO2_Port

#define GPIO2_Port   GPIOC

Definition at line 140 of file main.h.

◆ LED_GPIO_Port

#define LED_GPIO_Port   GPIOB

Definition at line 121 of file main.h.

◆ LED_Pin

#define LED_Pin   LL_GPIO_PIN_2

Definition at line 120 of file main.h.

◆ Relay_GPIO_Port

#define Relay_GPIO_Port   GPIOA

Definition at line 127 of file main.h.

◆ Relay_Pin

#define Relay_Pin   LL_GPIO_PIN_8

Definition at line 126 of file main.h.

◆ SW0_EXTI_IRQn

#define SW0_EXTI_IRQn   EXTI0_IRQn

Definition at line 112 of file main.h.

◆ SW0_GPIO_Port

#define SW0_GPIO_Port   GPIOA

Definition at line 111 of file main.h.

◆ SW0_Pin

#define SW0_Pin   LL_GPIO_PIN_0

Definition at line 110 of file main.h.

◆ SW1_EXTI_IRQn

#define SW1_EXTI_IRQn   EXTI1_IRQn

Definition at line 115 of file main.h.

◆ SW1_GPIO_Port

#define SW1_GPIO_Port   GPIOA

Definition at line 114 of file main.h.

◆ SW1_Pin

#define SW1_Pin   LL_GPIO_PIN_1

Definition at line 113 of file main.h.

◆ UART1_3V3out_GPIO_Port

#define UART1_3V3out_GPIO_Port   GPIOB

Definition at line 125 of file main.h.

◆ UART1_3V3out_Pin

#define UART1_3V3out_Pin   LL_GPIO_PIN_14

Definition at line 124 of file main.h.

◆ UART1_DTRout_GPIO_Port

#define UART1_DTRout_GPIO_Port   GPIOB

Definition at line 134 of file main.h.

◆ UART1_DTRout_Pin

#define UART1_DTRout_Pin   LL_GPIO_PIN_9

Definition at line 133 of file main.h.

◆ UART1_ENout_GPIO_Port

#define UART1_ENout_GPIO_Port   GPIOB

Definition at line 132 of file main.h.

◆ UART1_ENout_Pin

#define UART1_ENout_Pin   LL_GPIO_PIN_8

Definition at line 131 of file main.h.

◆ V_ENin_GPIO_Port

#define V_ENin_GPIO_Port   GPIOA

Definition at line 117 of file main.h.

◆ V_ENin_Pin

#define V_ENin_Pin   LL_GPIO_PIN_4

Definition at line 116 of file main.h.

Function Documentation

◆ Error_Handler()

void Error_Handler ( void  )

This function is executed in case of error occurrence.

Return values
None

Definition at line 1102 of file main.c.

1103 {
1104  /* USER CODE BEGIN Error_Handler_Debug */
1105  /* User can add his own implementation to report the HAL error return state */
1106  __disable_irq();
1107  while (1)
1108  {
1109  }
1110  /* USER CODE END Error_Handler_Debug */
1111 }
__disable_irq
#define __disable_irq
Definition: cmsis_iccarm.h:545