1
0
mirror of https://github.com/rene-dev/stmbl.git synced 2024-12-25 10:02:18 +00:00
stmbl/stmsp/stm32f303/inc/stmsp_f3hw.h

26 lines
584 B
C
Raw Permalink Normal View History

2018-04-20 01:43:43 +00:00
#pragma once
2018-04-18 23:21:56 +00:00
2018-04-20 01:43:43 +00:00
#define AREF 3.3 // analog reference voltage
2018-04-18 23:21:56 +00:00
#define VDIVUP 20000.0 * 2.0 //HV div pullup R1,R12
#define VDIVDOWN 1000.0 //HV div pulldown R2,R9
#define SHUNT 0.013 //shunt
#define SHUNT_PULLUP 3900.0
#define SHUNT_SERIE 120.0
2018-04-20 01:43:43 +00:00
#define LED_PIN GPIO_PIN_13
#define LED_PORT GPIOC
2018-04-18 23:21:56 +00:00
#define PWM_DEADTIME 0
#define PWM_FREQ 100000.0
2018-04-20 01:43:43 +00:00
#define PWM_RES (72000000.0 * 2.0 / PWM_FREQ / 2.0)
2018-04-18 23:21:56 +00:00
#define ADC_OVER (PWM_FREQ * 2 / RT_FREQ)
#define ADC_COUNT (ADC_OVER * 4)
2018-04-20 01:43:43 +00:00
2018-04-18 23:21:56 +00:00
#define USB_CONNECT_PIN GPIO_PIN_2
#define USB_CONNECT_PORT GPIOB
2018-04-20 01:43:43 +00:00
#define RT_FREQ 5000
#define FRT_FREQ 0