]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lib.git/blobdiff - rpp/include/drv/_rm48_hdk/port_def.h
Unify ADC among targets
[pes-rpp/rpp-lib.git] / rpp / include / drv / _rm48_hdk / port_def.h
index 9e688799c3344965bcacd9e5ec5ccb2c93e07715..cc400b6972efb7b7f251b22e2ada61d7ac410f95 100644 (file)
@@ -14,6 +14,8 @@
 #ifndef DRV_TGT_PORT_DEF_H
 #define DRV_TGT_PORT_DEF_H
 
+#include <stdint.h>
+
 /* Port names */
 enum port_id {
        PORT_ID_GIOA,
@@ -24,4 +26,11 @@ enum port_id {
        _PORT_COUNT,
 };
 
+#define PORT_ADC_CHANNELS 16
+
+static double port_adc_lsb2volts(uint16_t lsb)
+{
+       return ((double)lsb + 0.0)*2.5/4095*2;
+}
+
 #endif