Microprocessor and peripheral 2 assignments for AUTH
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

65 lines
1.7 KiB

  1. /*!
  2. * \file driver_types.h
  3. *
  4. * Author: Christos Choutouridis AEM: 8997
  5. * email : <cchoutou@ece.auth.gr>
  6. *
  7. */
  8. #ifndef DRIVERS_DRIVER_TYPES_H_
  9. #define DRIVERS_DRIVER_TYPES_H_
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif
  13. #include <stdint.h>
  14. typedef uint8_t byte_t; /*!< 8 bits wide */
  15. typedef uint16_t word_t; /*!< 16 bits wide */
  16. typedef uint32_t dword_t; /*!< 32 bits wide */
  17. typedef int32_t iterator_t; /*!< general iterator type */
  18. /*!
  19. * This is a driver wide generic driver status type.
  20. * \note
  21. * DRV_NOINIT = 0, so after memset to zero called by XXXX_deinit() the
  22. * module/device will automatically set to NOINIT state.
  23. */
  24. typedef enum {
  25. DRV_NODEV=-1, /*!< No device/module */ //!< DRV_NODEV
  26. DRV_NOINIT=0, /*!< Module/Device exist but no initialized *///!< DRV_NOINIT
  27. DRV_READY, /*!< Module/Device initialized succesfully */ //!< DRV_READY
  28. DRV_BUSY, /*!< Module/Device busy */ //!< DRV_BUSY
  29. //DRV_COMPLETE, /*!< Module/device operation complete status */
  30. DRV_ERROR /*!< Module/Device error */ //!< DRV_ERROR
  31. }drv_status_en;
  32. typedef enum {
  33. drv_pin_disable = 0,
  34. drv_pin_input,
  35. drv_pin_output
  36. }drv_pin_dir_en;
  37. /*!
  38. * Pin function pointers
  39. * \note
  40. * These function pointers do not correspond to pin levels.
  41. * They correspond to the enable/disable functionality of that pin.
  42. */
  43. //! @{
  44. typedef uint8_t (*drv_pinin_ft) (void);
  45. typedef void (*drv_pinout_ft) (uint8_t);
  46. typedef uint8_t (*drv_pinio_ft) (uint8_t);
  47. typedef void (*drv_pindir_ft) (drv_pin_dir_en);
  48. //! @}
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif /* DRIVERS_DRIVER_TYPES_H_ */