Modules | |
| ADC | |
| SPI Bus | |
| AVR EEPROM | |
| RSSI | |
| AVR I2C | |
| MICA Light Sensor | |
| MICA Temperature Sensor | |
| MICA Microphone | |
| MICA Sounder | |
| MICA2 Accelerometer | |
| MICA2 Magnet | |
| MICA2 Battery Driver | |
| MICA2 Ultrasound Driver | |
| Hardware ID Driver | |
| TELOSb External Flash | |
| Weatherboard GPS | |
| #define | dev_open_DEV_ATMEL_FLASH(void) mos_mutex_lock(&atmel_flash_mutex) |
| #define | dev_close_DEV_ATMEL_FLASH(void) mos_mutex_unlock(&atmel_flash_mutex) |
| #define | dev_open_DEV_LOOPBACK(void) mos_mutex_lock(&loopback_mutex) |
| #define | dev_close_DEV_LOOPBACK(void) mos_mutex_unlock(&loopback_mutex) |
| #define | dev_open_DEV_MSP_HUMIDITY(void) mos_mutex_lock(&msp_temp_mutex) |
| #define | dev_close_DEV_MSP_HUMIDITY(void) mos_mutex_unlock(&msp_temp_mutex) |
| #define | dev_mode_DEV_MSP_TEMPERTURE(newMode) dev_mode_DEV_MSP_HUMIDITY(newMode) |
| #define | dev_ioctl_DEV_MSP_TEMPERATURE(request) dev_ioctl_DEV_MSP_HUMIDITY(request) |
| #define | dev_open_DEV_MSP_TEMPERATURE(void) mos_mutex_lock(&msp_temp_mutex) |
| #define | dev_close_DEV_MSP_TEMPERATURE(void) mos_mutex_unlock(&msp_temp_mutex) |
| #define | dev_open_DEV_MSP_ACCELEROMETER(void) mos_mutex_lock(&msp_acc_mutex) |
| #define | dev_close_DEV_MSP_ACCELEROMETER(void) mos_mutex_unlock(&msp_acc_mutex) |
| #define | dev_open_DEV_MSP_FLASH(void) |
| #define | dev_close_DEV_MSP_FLASH(void) |
Device Driver Macros | |
| These macros alias functions of the type dev_foo(DEVICE, ...) to dev_foo_DEVICE(...), allowing code to be written either way. | |
| #define | dev_read(dev, buf, count) dev_read_##dev(buf, count) |
| Reads count bytes from a device and stores the result in the provided buffer. | |
| #define | dev_write(dev, buf, count) dev_write_##dev(buf, count) |
| Writes count bytes to a device from the provided buffer. | |
| #define | dev_mode(dev, mode) dev_mode_##dev(mode) |
| Set the mode of a device. | |
| #define | dev_ioctl(dev, request, args...) dev_ioctl_##dev(request, ##args) |
| A pass-through to send arbitrary commands to a device (meaning is defined by device driver). This macro means that dev_ioctl(DEVICE_NAME, request, ...) is equivalent to dev_ioctl_DEVICE_NAME(request, ...), so either format may be used. | |
| #define | dev_open(dev) dev_open_##dev() |
| Gain an exclusive lock on a device driver. | |
| #define | dev_close(dev) dev_close_##dev() |
| Release an exclusive lock on a device driver. | |
Device Mode Constants | |
| These constants can be used as paramenters to any dev_mode function. | |
| #define | DEV_MODE_OFF 0 |
| Power down the device. | |
| #define | DEV_MODE_IDLE 1 |
| Put the device in low power mode, if applicable. | |
| #define | DEV_MODE_ON 2 |
| Turn on the device. | |
Device IOCTL Constants | |
| These constants can be used as parameters to some dev_ioctl functions, depending on the specific device. For information on what IOCTLS a driver will accept, check the documentation for that driver. | |
| #define | DEV_SEEK 1 |
| Seek the underlying device pointer. | |
| #define | DEV_FLUSH 2 |
| Flush any buffered data to the device. | |
| #define | DEV_LOCK 3 |
| Lock the device. | |
| #define | DEV_UNLOCK 4 |
| Unlock the device. | |
Device Return Constants | |
| These constants may be returned from various dev_ functions to indicate The result of an operation. | |
| #define | DEV_OK 0 |
| operation succeeded. | |
| #define | DEV_UNSUPPORTED 100 |
| operation is not supported. | |
| #define | DEV_NOT_REGISTERED 101 |
| device driver not registered (this constant is no longer used) | |
| #define | DEV_OUT_OF_RANGE 102 |
| an argument was not in the expected range. | |
| #define | DEV_BAD_IOCTL 103 |
| device does not support the specified IOCTL. | |
| #define | DEV_BAD_MODE 104 |
| device does not support the specified mode. | |
| #define | DEV_FAILURE 105 |
| operation failed to complete. | |
Functions | |
| uint16_t | dev_read_DEV_MICA2_ULTRASOUND (void *buf, uint16_t count) |
| Not supported for the Ultrasound. | |
Variables | |
| mos_mutex_t | battery_mutex |
| mos_mutex_t | id_mutex |
|
||||||||||||
|
|
|
|
For internal use only. Used by the dev_open and dev_close |
|
|
For internal use only. used for dev_open and dev_close. |
1.4.6