A standard C header file

//*****************************************************************************
///
/// @file    IDigitalUnusedPin.h
/// @brief   The interface for Digital Output port drivers
///
/// @author  eric
///
//*****************************************************************************
#ifndef IFM_HARDWARE_IDIGITALUNUSEDPIN_H
#define IFM_HARDWARE_IDIGITALUNUSEDPIN_H

#include <stdint.h>
#include <stdbool.h>

#ifdef __cplusplus
extern "C"
{
#endif
//*****************************************************************************
/// @brief   Interface for digital unused pin drivers.
/// @details This interface contains virtual void methods necessary for the
///          implementing component to communicate with other components.
///
/// @note    This class contains virtual void method definitions and therefore
///          it cannot be instantiated.
///
//*****************************************************************************
typedef struct IDigitalUnusedPin
{
   // no member here
} IDigitalUnusedPin;

#ifdef __cplusplus
}
#endif

#endif //IFM_HARDWARE_IDIGITALUNUSEDPIN_H

 

 

//*****************************************************************************
///
/// @file    IDigitalOutputPin.h
/// @brief   The interface for Digital Output Pin drivers
///
/// @author  eric
///
//*****************************************************************************

#ifndef IFM_HARDWARE_IDIGITALOUTPUTPIN_H
#define IFM_HARDWARE_IDIGITALOUTPUTPIN_H

#include <stdbool.h>

#ifdef __cplusplus
extern "C"
{
#endif

//*****************************************************************************
/// @brief   Interface for digital output pin drivers.
/// @details This interface contains virtual void methods necessary for the
///          implementing component to communicate with other components.
///
/// @note    This class contains virtual void method definitions and therefore
///          it cannot be instantiated.
///
//*****************************************************************************
typedef struct IDigitalOutputPin
{
   void (*SetActivation)(bool iActive);
   void (*Toggle)(void);
   bool (*IsActivated)(void);
} IDigitalOutputPin;


#ifdef __cplusplus
}
#endif

#endif // IFM_HARDWARE_IDIGITALOUTPUTPIN_H

 

 

#ifndef COMMON_H
#define COMMON_H

#ifdef __cplusplus
extern "C"
{
#endif


#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))

#ifdef __cplusplus
}
#endif

#endif // COMMMON_H

 

posted on 2022-05-08 10:11  荷树栋  阅读(24)  评论(0编辑  收藏  举报

导航