/*!
 * \file driver_types.h
 *
 * Author: Christos Choutouridis AEM: 8997
 * email : <cchoutou@ece.auth.gr>
 *
 */

#ifndef DRIVERS_DRIVER_TYPES_H_
#define DRIVERS_DRIVER_TYPES_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>


typedef uint8_t  byte_t;         /*!< 8 bits wide */
typedef uint16_t word_t;         /*!< 16 bits wide */
typedef uint32_t dword_t;        /*!< 32 bits wide */

typedef int32_t  iterator_t;     /*!< general iterator type */

/*!
 * This is a driver wide generic driver status type.
 * \note
 *    DRV_NOINIT = 0, so after memset to zero called by XXXX_deinit() the
 *    module/device will automatically set to NOINIT state.
 */
typedef enum {
   DRV_NODEV=-1,     /*!< No device/module */                      //!< DRV_NODEV
   DRV_NOINIT=0,     /*!< Module/Device exist but no initialized *///!< DRV_NOINIT
   DRV_READY,        /*!< Module/Device initialized succesfully */ //!< DRV_READY
   DRV_BUSY,         /*!< Module/Device busy */                    //!< DRV_BUSY
   //DRV_COMPLETE,     /*!< Module/device operation complete status */
   DRV_ERROR         /*!< Module/Device error */                   //!< DRV_ERROR
}drv_status_en;


typedef enum {
   drv_pin_disable = 0,
   drv_pin_input,
   drv_pin_output
}drv_pin_dir_en;

/*!
 * Pin function pointers
 * \note
 *    These function pointers do not correspond to pin levels.
 *    They correspond to the enable/disable functionality of that pin.
 */
//! @{
typedef uint8_t (*drv_pinin_ft)  (void);
typedef    void (*drv_pinout_ft) (uint8_t);
typedef uint8_t (*drv_pinio_ft)  (uint8_t);
typedef    void (*drv_pindir_ft) (drv_pin_dir_en);
//! @}

#ifdef __cplusplus
}
#endif

#endif /* DRIVERS_DRIVER_TYPES_H_ */
