Private
Public Access
2
0

aio: change return from uint16 to unsigned int

Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
Thomas Ingleby
2014-09-22 15:29:02 +01:00
parent 1fcdfde02c
commit e82a76593d
3 changed files with 12 additions and 15 deletions

View File

@@ -59,12 +59,13 @@ typedef struct _aio* mraa_aio_context;
mraa_aio_context mraa_aio_init(unsigned int pin);
/**
* Read the input voltage
* Read the input voltage. By default mraa will shift
* the raw value up or down to a 10 bit value.
*
* @param dev The AIO context
* @returns The current input voltage, normalised to a 16-bit value
* @returns The current input voltage.
*/
uint16_t mraa_aio_read(mraa_aio_context dev);
unsigned int mraa_aio_read(mraa_aio_context dev);
/**
* Close the analog input context, this will free the memory for the context

View File

@@ -53,14 +53,13 @@ class Aio {
mraa_aio_close(m_aio);
}
/**
* Read a value from the AIO pin. Note this value can never be outside
* of the bounds of an unsigned short
* Read a value from the AIO pin. By default mraa will shift
* the raw value up or down to a 10 bit value.
*
* @returns The current input voltage, normalised to a 16-bit value
* @returns The current input voltage. By default, a 10bit value
*/
int read() {
// Use basic types to make swig code generation simpler
return (int) mraa_aio_read(m_aio);
return mraa_aio_read(m_aio);
}
/**
* Set the bit value which mraa will shift the raw reading