aboutsummaryrefslogtreecommitdiffstats
path: root/os/various/sensor.h
blob: 7e77644189a369afff925dc256500a010893acff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef _SENSOR_H_
#define _SENSOR_H_

#define SENSOR_OK        MSG_OK         /**< @brief Operation successful. */
#define SENSOR_TIMEOUT   MSG_TIMEOUT    /**< @brief Communication timeout */
#define SENSOR_RESET     MSG_REST       /**< @brief Communication error.  */
#define SENSOR_NOTFOUND  (msg_t)-20     /**< @brief Sensor not found.     */


/**
 * @brief   Driver state machine possible states.
 */
typedef enum __attribute__ ((__packed__)) {
    SENSOR_UNINIT    = 0,            /**< Not initialized.                */
    SENSOR_INIT      = 1,            /**< Initialized.                    */
    SENSOR_STARTED   = 2,            /**< Started.                        */
    SENSOR_MEASURING = 4,            /**< Measuring.                      */
    SENSOR_READY     = 3,            /**< Ready.                          */
    SENSOR_STOPPED   = 5,            /**< Stopped.                        */
    SENSOR_ERROR     = 6,            /**< Error.                          */
} sensor_state_t;

#endif