init
Dependencies: aconno_I2C Lis2dh12 WatchdogTimer
acd_nrf52_saadc.h
00001 /* 00002 * Made by Jurica Resetar and Karlo Milicevic @ aconno, 2017 00003 * jurica_resetar@yahoo.com 00004 * aconno.de 00005 * All rights reserved 00006 * 00007 */ 00008 00009 #ifndef ACD_NRF52_SAADC_H 00010 #define ACD_NRF52_SAADC_H 00011 00012 #include "mbed.h" 00013 00014 /** NRF52 adc library 00015 */ 00016 class NRF52_SAADC{ 00017 public: 00018 /** Initializes adc module 00019 */ 00020 NRF52_SAADC(); 00021 ~NRF52_SAADC(); 00022 /** @returns 00023 * 0 on success, 1 otherwise 00024 */ 00025 bool addChannel (uint8_t pin); 00026 void calibrate(); 00027 /** Reads analog pins 00028 */ 00029 void updateData(); 00030 /** @returns 00031 * pointer to analog input data - data is stored in channel add order 00032 */ 00033 int16_t *getData () { return data; } 00034 private: 00035 int16_t data[sizeof(int16_t)*8]; // 8 channels 00036 }; 00037 00038 #endif // ACD_NRF52_SAADC_H
Generated on Sat Jul 16 2022 03:03:28 by
1.7.2