SimpleFOClibrary 2.4.0
Loading...
Searching...
No Matches
current_sense/hardware_specific/samd/samd_mcu.cpp
Go to the documentation of this file.
1#include "../../hardware_api.h"
2
3#if defined(_SAMD21_)|| defined(_SAMD51_) || defined(_SAME51_)
4
5#define _ADC_VOLTAGE 3.3f
6#define _ADC_RESOLUTION 1024.0f
7
8// function reading an ADC value and returning the read voltage
9void* _configureADCInline(const void* driver_params, const int pinA,const int pinB,const int pinC){
10 _UNUSED(driver_params);
11
12 if( _isset(pinA) ) pinMode(pinA, INPUT);
13 if( _isset(pinB) ) pinMode(pinB, INPUT);
14 if( _isset(pinC) ) pinMode(pinC, INPUT);
15
17 .pins = { pinA, pinB, pinC },
18 .adc_voltage_conv = (_ADC_VOLTAGE)/(_ADC_RESOLUTION)
19 };
20
21 return params;
22}
23#endif
void * _configureADCInline(const void *driver_params, const int pinA, const int pinB, const int pinC=NOT_SET)
const int const int const int pinC
GenericCurrentSenseParams * params
#define _UNUSED(v)
Definition foc_utils.h:14
#define _isset(a)
Definition foc_utils.h:13