12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #ifndef LIBFRAMEWORK_GPIO_IMPL_H
- #define LIBFRAMEWORK_GPIO_IMPL_H
- #include "GpioClass.h"
- class GPIOClassImpl : public GpioClass
- {
- public:
- GPIOClassImpl();
- ~GPIOClassImpl();
- //DeviceBaseClass
- ErrorCodeEnum GetDevCategory(DevCategoryInfo &devCategory);
- ErrorCodeEnum Reset();
- ErrorCodeEnum DevClose();
- ErrorCodeEnum GetLastErr(DevErrorInfo &devErrInfo);
- //
- // Device initialization.
- // Configure port input/output direction.
- //
- virtual ErrorCodeEnum DevOpen(GpioInitParam initParam)
- {
- ErrorCodeEnum err = Error_Succeed;
- return err;
- }
- //
- // Set ports output.
- // Arguments:
- // - dwPort:port serial number,0~MAX_PORT_NUM-1
- // - btData:output value
- // bit value 1/0 means voltage high or low
- // ex.dwPort=0 btData=10001010 means set port 0's the 2nd,4th,8th pin output high
- //
- virtual ErrorCodeEnum WritePort(DWORD dwPort, BYTE btData)
- {
- return Error_Succeed;
- }
- //
- // Get port input.
- // Arguments:
- // - dwPort:port serial number,0~MAX_PORT_NUM-1
- // - btStatus:input value
- // ex.dwPort=0 btStatus=10001010 means port 0's the 2nd,4th,8th pin with high level
- //
- virtual ErrorCodeEnum ReadPort(DWORD dwPort, BYTE& btStatus)
- {
- return Error_NotImpl;
- }
- private:
- int m_mode;
- };
- #endif //LIBFRAMEWORK_GPIO_IMPL_H
|