1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-11-29 07:24:13 +01:00

OP-1828 - add support for Revonano

This commit is contained in:
Alessio Morale 2015-04-08 14:53:24 +02:00
parent 6bc338885e
commit 3152ebcaf0
2 changed files with 25 additions and 9 deletions

View File

@ -729,8 +729,17 @@ void PIOS_Board_Init(void)
if (ws2811_pin_settings != HWSETTINGS_WS2811LED_OUT_DISABLED && ws2811_pin_settings < NELEMENTS(pios_ws2811_pin_cfg)) {
PIOS_WS2811_Init(&pios_ws2811_cfg, &pios_ws2811_pin_cfg[ws2811_pin_settings]);
}
#endif // PIOS_INCLUDE_WS2811
#ifdef PIOS_INCLUDE_ADC
uint8_t adc_config[HWSETTINGS_ADCROUTING_NUMELEM];
HwSettingsADCRoutingArrayGet(adc_config);
for(uint32_t i = 0; i < HWSETTINGS_ADCROUTING_NUMELEM; i++){
if(adc_config[i] != HWSETTINGS_ADCROUTING_DISABLED){
PIOS_ADC_PinSetup(i);
}
}
#endif
}
/**

View File

@ -282,23 +282,30 @@ extern uint32_t pios_packet_handler;
// PIOS_ADC_PinGet(4) = VREF
// PIOS_ADC_PinGet(5) = Temperature sensor
// -------------------------
#define PIOS_DMA_PIN_CONFIG \
{ \
{ GPIOC, GPIO_Pin_1, ADC_Channel_11 }, \
{ GPIOC, GPIO_Pin_2, ADC_Channel_12 }, \
{ NULL, 0, ADC_Channel_Vrefint }, /* Voltage reference */ \
{ NULL, 0, ADC_Channel_TempSensor }, /* Temperature sensor */ \
#define PIOS_DMA_PIN_CONFIG \
{ \
{ GPIOB, GPIO_Pin_1, ADC_Channel_9, false},/* FLEXI-IO PIN 4 */ \
{ GPIOB, GPIO_Pin_0, ADC_Channel_8, false},/* FLEXI-IO PIN 5 */ \
{ GPIOA, GPIO_Pin_7, ADC_Channel_7, false},/* FLEXI-IO PIN 6 */ \
{ GPIOA, GPIO_Pin_6, ADC_Channel_6, false},/* FLEXI-IO PIN 7 */ \
{ GPIOA, GPIO_Pin_5, ADC_Channel_5, false},/* FLEXI-IO PIN 8 */ \
\
{ GPIOA, GPIO_Pin_0, ADC_Channel_0, false},/* SERVO PIN 5 */ \
{ GPIOA, GPIO_Pin_1, ADC_Channel_1, false},/* SERVO PIN 6 */ \
\
{ NULL, 0, ADC_Channel_Vrefint, false}, /* Voltage reference */ \
{ NULL, 0, ADC_Channel_TempSensor, false}, /* Temperature sensor */ \
}
/* we have to do all this to satisfy the PIOS_ADC_MAX_SAMPLES define in pios_adc.h */
/* which is annoying because this then determines the rate at which we generate buffer turnover events */
/* the objective here is to get enough buffer space to support 100Hz averaging rate */
#define PIOS_ADC_NUM_CHANNELS 4
#define PIOS_ADC_NUM_CHANNELS 9
#define PIOS_ADC_MAX_OVERSAMPLING 2
#define PIOS_ADC_USE_ADC2 0
#define PIOS_ADC_USE_TEMP_SENSOR
#define PIOS_ADC_TEMPERATURE_PIN 3
#define PIOS_ADC_TEMPERATURE_PIN 8
// -------------------------
// USB