blob: 3fa686a21e2c2d06b56cd8af393386c1fb1218aa [file] [log] [blame]
Brian Silverman8d3816a2017-07-03 18:52:15 -07001#ifndef MOTORS_PERIPHERAL_CONFIGURATION_H_
2#define MOTORS_PERIPHERAL_CONFIGURATION_H_
3
4// We're just going to leave the default DMA priorities which correspond to the
5// channel numbers and fixed priority mode, so channel 0 is the lowest priority
6// and 15 is the highest.
7// We're also going to leave DMA_CR alone except for setting EMLM.
8
9// The frequency of the peripheral bus(es) in hz.
10#define BUS_CLOCK_FREQUENCY (F_CPU / 2)
11
12// The frequency we switch the motor FETs at in hz.
13#define SWITCHING_FREQUENCY 20000
14
15#if 0
16// Which PDB the ADC triggering uses.
17#define ADC_TRIGGER_PDB 0
18// The DMA channel which copies ADC results.
19#define ADC_RESULT_DMA_CHANNEL 7
20// The DMA channel which reconfigures the ADCs to take the next samples.
21#define ADC_RECONFIGURE_DMA_CHANNEL 8
22#endif
23
24#endif // MOTORS_PERIPHERAL_CONFIGURATION_H_