|
- /*!
- * \file driver_types.h
- *
- * Copyright (C) 2020 Choutouridis Christos <cchoutou@ece.auth.gr>
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation, either version 3
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
- #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_ */
|