WISP ERT (Client)
1.0.0
The WISP Extended Runtime (WISP side)
|
#include <stdint.h>
#include <msp430.h>
Go to the source code of this file.
Enumerations | |
enum | ADC_referenceSelect { ADC_reference_1_2V = REFVSEL_0, ADC_reference_2_0V = REFVSEL_1, ADC_reference_2_5V = REFVSEL_2 } |
enum | ADC_precisionSelect { ADC_precision_8bit = ADC12RES__8BIT, ADC_precision_10bit = ADC12RES__10BIT, ADC_precision_12bit = ADC12RES__12BIT } |
enum | ADC_inputSelect { ADC_input_temperature, ADC_input_A0 = ADC12INCH_0, ADC_input_A1 = ADC12INCH_1, ADC_input_A2 = ADC12INCH_2, ADC_input_A3 = ADC12INCH_3, ADC_input_A4 = ADC12INCH_4, ADC_input_A5 = ADC12INCH_5, ADC_input_A6 = ADC12INCH_6, ADC_input_A7 = ADC12INCH_7, ADC_input_A8 = ADC12INCH_8, ADC_input_A9 = ADC12INCH_9, ADC_input_A10 = ADC12INCH_10, ADC_input_A11 = ADC12INCH_11, ADC_input_A12 = ADC12INCH_12, ADC_input_A13 = ADC12INCH_13, ADC_input_A14 = ADC12INCH_14, ADC_input_A15 = ADC12INCH_15, ADC_input_A16 = ADC12INCH_16, ADC_input_A17 = ADC12INCH_17, ADC_input_A18 = ADC12INCH_18, ADC_input_A19 = ADC12INCH_19, ADC_input_A20 = ADC12INCH_20, ADC_input_A21 = ADC12INCH_21, ADC_input_A22 = ADC12INCH_22, ADC_input_A23 = ADC12INCH_23, ADC_input_A24 = ADC12INCH_24, ADC_input_A25 = ADC12INCH_25, ADC_input_A26 = ADC12INCH_26, ADC_input_A27 = ADC12INCH_27, ADC_input_A28 = ADC12INCH_28, ADC_input_A29 = ADC12INCH_29, ADC_input_A30 = ADC12INCH_30, ADC_input_A31 = ADC12INCH_31 } |
Functions | |
void | ADC_init (void) |
void | ADC_initCustom (ADC_referenceSelect, ADC_precisionSelect, ADC_inputSelect) |
uint16_t | ADC_read (void) |
void | ADC_asyncRead (void(*)(uint16_t)) |
uint16_t | ADC_critRead (void) |
uint16_t | ADC_rawCorrection (uint16_t) |
uint16_t | ADC_rawToVoltage (uint16_t) |
int16_t | ADC_rawToTemperature (uint16_t) |
uint8_t | ADC_isBusy (void) |
uint8_t | ADC_isReady (void) |
void | ADC_enable (void) |
void | ADC_disable (void) |
void | ADC_enableConversion (void) |
void | ADC_disableConversion (void) |
void | ADC_enableInterrupts (void) |
void | ADC_disableInterrupts (void) |
void | ADC_setReference (ADC_referenceSelect) |
ADC_referenceSelect | ADC_getReference (void) |
void | ADC_setPrecision (ADC_precisionSelect) |
ADC_precisionSelect | ADC_getPrecision (void) |
void | ADC_setInputChannel (ADC_inputSelect) |
ADC_inputSelect | ADC_getInputChannel (void) |
void | ADC_setSampleHold (void) |
enum ADC_inputSelect |
ADC input channel, for now only external analog inputs
enum ADC_precisionSelect |
enum ADC_referenceSelect |
void ADC_asyncRead | ( | void(*)(uint16_t) | callback | ) |
Asynchronously read ADC. Do not block, call callback when done.
callback | function to be called after conversion finishes |
uint16_t ADC_critRead | ( | void | ) |
Critical ADC read. Does block, does not use interrupts.
void ADC_disable | ( | void | ) |
Disable the ADC12_B peripheral.
void ADC_disableConversion | ( | void | ) |
Disable ADC conversions.
void ADC_disableInterrupts | ( | void | ) |
Disable all ADC interrupts.
void ADC_enable | ( | void | ) |
Enable the ADC12_B peripheral.
void ADC_enableConversion | ( | void | ) |
Enable ADC conversions.
void ADC_enableInterrupts | ( | void | ) |
Enable ADC interrupts.
ADC_inputSelect ADC_getInputChannel | ( | void | ) |
Get currently set input channel.
ADC_precisionSelect ADC_getPrecision | ( | void | ) |
Get currently set conversion precision.
ADC_referenceSelect ADC_getReference | ( | void | ) |
Get currently set voltage reference.
void ADC_init | ( | void | ) |
Configure the ADC12_B module in single channel single measurement mode and prepare for measurement.
void ADC_initCustom | ( | ADC_referenceSelect | reference, |
ADC_precisionSelect | precision, | ||
ADC_inputSelect | channel | ||
) |
Configure the ADC12_B module in single channel single measurement mode and prepare for measurement.
reference | voltage reference source |
precision | ADC measurement precision |
channel | ADC input channel |
uint8_t ADC_isBusy | ( | void | ) |
Return true if ADC module is in the middle of a conversion, false if not.
uint8_t ADC_isReady | ( | void | ) |
Return false if ADC module is in the middle of a conversion, true if not.
uint16_t ADC_rawCorrection | ( | uint16_t | raw | ) |
Correct RAW ADC reading according to calibration procedure
See user guide 1.14.3.2
raw | RAW ADC value |
int16_t ADC_rawToTemperature | ( | uint16_t | raw | ) |
Convert RAW ADC reading to milli degree Celcius.
raw | RAW ADC value |
uint16_t ADC_rawToVoltage | ( | uint16_t | raw | ) |
Convert RAW ADC reading to MilliVolts.
Based on formula (see user guide 25.2.1): Nadc = 4096 * ( (Vin + .5LSB) - Vr- ) / ( Vr+ - Vr- ) where LSB = ( Vr+ - Vr- ) / 4096
Formula converted to: Vin = (Nadc * ( Vr+ - Vr- ) ) / 4096 + Vr- - .5LSB where LSB = ( Vr+ - Vr- ) / 4096
raw | RAW ADC value |
uint16_t ADC_read | ( | void | ) |
Synchronously read ADC. Does block.
void ADC_setInputChannel | ( | ADC_inputSelect | channel | ) |
Set ADC input channel and single channel-single conversion mode.
Possible channels: analog input pins A0-A31 and internal temperature sensor.
channel | the wanted channel. |
void ADC_setPrecision | ( | ADC_precisionSelect | precision | ) |
Set ADC conversion precision.
precision | the wanted precision. |
void ADC_setReference | ( | ADC_referenceSelect | reference | ) |
Set voltage reference and make the ADC to use it.
reference | the wanted reference voltage. |
void ADC_setSampleHold | ( | void | ) |
Set ADC to sample and hold pulse mode.