Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
NbAnalogIn Class Reference
Library for non blocking ADC operation. More...
#include <NbAnalogIn.h>
Public Member Functions | |
| NbAnalogIn (PinName pin) | |
| Create a NbAnalogIn object, sets up ADC. | |
| void | setInterrupt (void(*irqfunc)()=0, int prio=-1) |
| Set interrupt options. | |
| int | readBl () |
| does a single blocking read and returns a 12 bit output | |
| void | triggerConv (bool wait=false) |
| starts a conversion and sets the interrupt to fire when ADC is finished the result will be put into the internal buffer | |
| bool | readable () |
| checks if the buffer has new results that can be read | |
| int | read () |
| returns the next value from the buffer | |
| operator int () | |
| An operator shorthand for read() | |
Detailed Description
Library for non blocking ADC operation.
Definition at line 13 of file NbAnalogIn.h.
Constructor & Destructor Documentation
| NbAnalogIn | ( | PinName | pin ) |
Create a NbAnalogIn object, sets up ADC.
- Parameters:
-
pin AnalogIn pin to connect to
Definition at line 29 of file NbAnalogIn.cpp.
Member Function Documentation
| operator int | ( | ) |
An operator shorthand for read()
Definition at line 58 of file NbAnalogIn.h.
| int read | ( | ) |
returns the next value from the buffer
Definition at line 152 of file NbAnalogIn.cpp.
| bool readable | ( | ) |
checks if the buffer has new results that can be read
Definition at line 148 of file NbAnalogIn.cpp.
| int readBl | ( | ) |
does a single blocking read and returns a 12 bit output
Definition at line 76 of file NbAnalogIn.cpp.
| void setInterrupt | ( | void(*)() | irqfunc = 0, |
| int | prio = -1 |
||
| ) |
Set interrupt options.
- Parameters:
-
irqfunc - callback function executed at the end of interrupts priority - set interrupt priority level. -1 (default) leaves them unchanged
Definition at line 68 of file NbAnalogIn.cpp.
| void triggerConv | ( | bool | wait = false ) |
starts a conversion and sets the interrupt to fire when ADC is finished the result will be put into the internal buffer
- Parameters:
-
wait - If true, wait for current adc conversion to finish, if false (default), stop the current conversion replace it
Definition at line 94 of file NbAnalogIn.cpp.
Generated on Sat Jul 16 2022 02:50:33 by
1.7.2