101 lines
2.6 KiB
C++
101 lines
2.6 KiB
C++
// --------------------------------------------------------------------------------------------------------------------
|
|
/// \file gpio.h
|
|
/// \brief File description
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
//
|
|
// vbchaos software design
|
|
//
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
/// $Revision: $
|
|
/// $Author: $
|
|
/// $Date: $
|
|
// (c) 2023 vbchaos
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
#ifndef MAIN_INC_GPIO_H_
|
|
#define MAIN_INC_GPIO_H_
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
// Include files
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
|
|
// CompilerIncludes
|
|
// All include files that are provided by the compiler directly
|
|
|
|
|
|
|
|
// ProjectIncludes
|
|
// All include files that are provided by the project
|
|
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
// Constant and macro definitions
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
// Type definitions.
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
|
|
typedef enum
|
|
{
|
|
GPIO_DIRECTION_INPUT = 0,
|
|
GPIO_DIRECTION_OUTPUT = 1
|
|
} GPIO_Direction_t;
|
|
|
|
typedef enum
|
|
{
|
|
GPIO_VALUE_LOW = 0,
|
|
GPIO_VALUE_HIGH = 1
|
|
} GPIO_Value_t;
|
|
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
// Function declarations
|
|
// --------------------------------------------------------------------------------------------------------------------
|
|
|
|
class GPIO
|
|
{
|
|
public:
|
|
<<<<<<< HEAD
|
|
|
|
GPIO(int number, GPIO_Direction_t direction);
|
|
|
|
bool SetOutput(GPIO_Value_t value);
|
|
|
|
GPIO_Value_t GetInput(void);
|
|
|
|
|
|
private:
|
|
|
|
int number;
|
|
|
|
GPIO_Direction_t direction;
|
|
|
|
GPIO_Value_t value = GPIO_VALUE_LOW;
|
|
};
|
|
=======
|
|
>>>>>>> wifi
|
|
|
|
bool GPIO(int number, GPIO_Direction_t direction);
|
|
|
|
bool GPIO_setOutput(GPIO_Value_t value);
|
|
|
|
GPIO_Value_t GPIO_getInput(void);
|
|
|
|
private:
|
|
|
|
int number;
|
|
|
|
GPIO_Direction_t direction;
|
|
|
|
GPIO_Value_t value;
|
|
};
|
|
|
|
|
|
/** @} */
|
|
|
|
#endif /* MAIN_INC_GPIO_H_ */
|