50 lines
845 B
C
50 lines
845 B
C
#ifndef __DRV_RELAY_H__
|
|
#define __DRV_RELAY_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#include "global.h"
|
|
|
|
|
|
typedef enum {
|
|
Relay_Num_1 = 0,
|
|
Relay_Num_2,
|
|
Relay_Num
|
|
|
|
}E_RelayNUM;
|
|
|
|
|
|
typedef struct {
|
|
const char *name; ///< name of the event flags
|
|
uint32_t attr_bits; ///< attribute bits
|
|
void *cb_mem; ///< memory for control block
|
|
uint32_t cb_size; ///< size of provided memory for control block
|
|
} hdRelayAttr_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int index;
|
|
void (*init) (void);
|
|
void (*set) (uint32_t channel,uint16_t state);
|
|
uint16_t (*get) (void);
|
|
}Relay_t;
|
|
|
|
|
|
|
|
|
|
void relay_init(void);
|
|
|
|
void relay_set(uint32_t channel,uint16_t state);
|
|
|
|
uint16_t relay_state(uint32_t channel);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|