Difference between revisions of "MansOS API"

From DiLab
Jump to: navigation, search
Line 1: Line 1:
== LEDs ==
== LEDs ==


* toggleRedLed()
toggleRedLed()
* toggleGreenLed()
toggleGreenLed()
* toggleBlueLed()
toggleBlueLed()
* toggleLed(ledNr)
toggleLed(ledNr)


* redLedOn()
redLedOn()
* greenLedOn()
greenLedOn()
* blueLedOn()
blueLedOn()


* redLedOff()
redLedOff()
* greenLedOff()
greenLedOff()
* blueLedOff()
blueLedOff()


* ledOn(uint8_t ledNr)
ledOn(uint8_t ledNr)
* ledOff(uint8_t ledNr)
ledOff(uint8_t ledNr)
* bool ledIsOn(ledNr)
bool ledIsOn(ledNr)


* uint8_t getLeds()
uint8_t getLeds()
* setLeds(bitmap)
setLeds(bitmap)

== Humidity sensor ==
void humidityInit(); // init humidity sensor, do not turn it on - called by kernel automatically, not needed in application cod
void humidityOn(); // turn on humidity sensor
void humidityOff(); // turn off humidity sensor
uint16_t readHumidity(); // read humidity value


== ADC ==
== ADC ==
* uint16_t adcRead(channel)
uint16_t adcRead(channel)
* uint8_t adcGetChannelCount() - how many ADC channel the mote provides
uint8_t adcGetChannelCount() - how many ADC channel the mote provides


== Sleep ==
== Sleep ==


* threadSleep(miliseconds)
mleep(miliseconds)


== USART ==
== USART ==
uint_t USARTSendString(uint8_t id, uint8_t *data);
uint_t USARTSendStringLine(uint8_t id, uint8_t *data);
void USARTSendData(uint8_t id, uint8_t *data, uint16_t len);

/**
* Set callback function for per-byte data receive. The callback is called
* on every received packet
* @param id - ID of the UART used (See MCU datasheet to get IDs)
* @param cb - callback function: void myCallback(uint8_t byte)
*/
uint_t USARTSetReceiveHandle(uint8_t id, USARTCallback_t cb);


TODO
TODO

Revision as of 10:05, 21 September 2011

LEDs

toggleRedLed()
toggleGreenLed()
toggleBlueLed()
toggleLed(ledNr)
redLedOn()
greenLedOn()
blueLedOn()
redLedOff()
greenLedOff()
blueLedOff()
ledOn(uint8_t ledNr)
ledOff(uint8_t ledNr)
bool ledIsOn(ledNr)
uint8_t getLeds()
setLeds(bitmap)

Humidity sensor

void humidityInit();      // init humidity sensor, do not turn it on - called by kernel automatically, not needed in application cod
void humidityOn();        // turn on humidity sensor
void humidityOff();       // turn off humidity sensor
uint16_t readHumidity();  // read humidity value

ADC

uint16_t adcRead(channel)
uint8_t adcGetChannelCount() - how many ADC channel the mote provides

Sleep

mleep(miliseconds)

USART

uint_t USARTSendString(uint8_t id, uint8_t *data);
uint_t USARTSendStringLine(uint8_t id, uint8_t *data);
void USARTSendData(uint8_t id, uint8_t *data, uint16_t len);
/**
* Set callback function for per-byte data receive. The callback is called
* on every received packet
* @param id - ID of the UART used (See MCU datasheet to get IDs)
* @param cb - callback function: void myCallback(uint8_t byte)
*/
uint_t USARTSetReceiveHandle(uint8_t id, USARTCallback_t cb);

TODO