HRI board firmware v2.1 Microcontroller firmware of the board used during the HRI labs.

Macros
main.h File Reference
`#include <math.h>`
`#include <stdbool.h>`
`#include "arm_math.h"`
`#include "stm32f4xx_adc.h"`
`#include "stm32f4xx_dac.h"`
`#include "stm32f4xx_dma.h"`
`#include "stm32f4xx_exti.h"`
`#include "stm32f4xx_gpio.h"`
`#include "stm32f4xx_i2c.h"`
`#include "stm32f4xx_iwdg.h"`
`#include "stm32f4xx_pwr.h"`
`#include "stm32f4xx_rcc.h"`
`#include "stm32f4xx_rtc.h"`
`#include "stm32f4xx_spi.h"`
`#include "stm32f4xx_syscfg.h"`
`#include "stm32f4xx_tim.h"`
`#include "stm32f4xx_usart.h"`
`#include "stm32f4xx_wwdg.h"`

Go to the source code of this file.

## Macros
#define | STM_SYSCLOCK_FREQ 168000000
#define | APB1_PRESCALER 4
#define | APB2_PRESCALER 2
#define | TIM_MULTIPLIER 2
#define | CURRENT_LOOP_IRQ_PRIORITY 1
#define | CONTROL_LOOP_IRQ_PRIORITY 2
#define | CODER_INDEX_IRQ_PRIORITY 2
#define | UART_RX_IRQ_PRIORIY 3
#define | DATA_LOOP_IRQ_PRIORITY 4
#define | USER_BUTTON_IRQ_PRIORITY 4
#define | STM_SUPPLY_VOLTAGE 3.3f
#define | ADC_REF_VOLTAGE 2.5f
#define | H_BRIDGE_SUPPLY_VOLTAGE 24.0f
#define | CURRENT_SHUNT_RESISTANCE 0.025f
#define | CURRENT_SHUNT_AMPLIFIER_GAIN 30.0f
#define | MOTOR_RESISTANCE (10.6f + 5.0f)
#define | REDUCTION_RATIO 15.0f
#define | MOTOR_TORQUE_CONST 0.0538f
#define | MOTOR_SPEED_CONST 177.0f
#define | MOTOR_NOMINAL_TORQUE 0.0323f

## Macro Definition Documentation

## ◆ ADC_REF_VOLTAGE

#define ADC_REF_VOLTAGE 2.5f

## ◆ APB1_PRESCALER

#define APB1_PRESCALER 4

## ◆ APB2_PRESCALER

#define APB2_PRESCALER 2

## ◆ CODER_INDEX_IRQ_PRIORITY

#define CODER_INDEX_IRQ_PRIORITY 2

## ◆ CONTROL_LOOP_IRQ_PRIORITY

#define CONTROL_LOOP_IRQ_PRIORITY 2

## ◆ CURRENT_LOOP_IRQ_PRIORITY

#define CURRENT_LOOP_IRQ_PRIORITY 1

## ◆ CURRENT_SHUNT_AMPLIFIER_GAIN

#define CURRENT_SHUNT_AMPLIFIER_GAIN 30.0f

## ◆ CURRENT_SHUNT_RESISTANCE

#define CURRENT_SHUNT_RESISTANCE 0.025f

## ◆ DATA_LOOP_IRQ_PRIORITY

#define DATA_LOOP_IRQ_PRIORITY 4

## ◆ H_BRIDGE_SUPPLY_VOLTAGE

#define H_BRIDGE_SUPPLY_VOLTAGE 24.0f

## ◆ MOTOR_NOMINAL_TORQUE

#define MOTOR_NOMINAL_TORQUE 0.0323f

## ◆ MOTOR_RESISTANCE

#define MOTOR_RESISTANCE (10.6f + 5.0f)

## ◆ MOTOR_SPEED_CONST

#define MOTOR_SPEED_CONST 177.0f

## ◆ MOTOR_TORQUE_CONST

#define MOTOR_TORQUE_CONST 0.0538f

## ◆ REDUCTION_RATIO

#define REDUCTION_RATIO 15.0f

## ◆ STM_SUPPLY_VOLTAGE

#define STM_SUPPLY_VOLTAGE 3.3f

## ◆ STM_SYSCLOCK_FREQ

#define STM_SYSCLOCK_FREQ 168000000

## ◆ TIM_MULTIPLIER

#define TIM_MULTIPLIER 2

## ◆ UART_RX_IRQ_PRIORIY

#define UART_RX_IRQ_PRIORIY 3

## ◆ USER_BUTTON_IRQ_PRIORITY

#define USER_BUTTON_IRQ_PRIORITY 4