43 lines
953 B
C
43 lines
953 B
C
#ifndef RF_SWITCH_DRIVER_H_
|
|
#define RF_SWITCH_DRIVER_H_
|
|
|
|
#include "stdint.h"
|
|
#include "stdio.h"
|
|
#ifndef RF_SWITCH_MODEL
|
|
#define RF_SWITCH_MODEL HMC253
|
|
#endif
|
|
|
|
typedef enum
|
|
{
|
|
#if RF_SWITCH_MODEL == HMC253
|
|
RF_OUT_01 = 0,
|
|
RF_OUT_02 = 1,
|
|
RF_OUT_03 = 2,
|
|
RF_OUT_04 = 3,
|
|
RF_OUT_05 = 4,
|
|
RF_OUT_06 = 5,
|
|
RF_OUT_07 = 6,
|
|
RF_OUT_08 = 7
|
|
#endif
|
|
} RF_OUT_ENUM;
|
|
|
|
struct rf_switch_config
|
|
{
|
|
uint8_t enable;
|
|
RF_OUT_ENUM rfOutState;
|
|
uint32_t portA;
|
|
uint32_t pinA;
|
|
uint32_t portB;
|
|
uint32_t pinB;
|
|
uint32_t portC;
|
|
uint32_t pinC;
|
|
};
|
|
|
|
void vRFSwitchInit(struct rf_switch_config *config, uint32_t portA, uint32_t pinA, uint32_t portB, uint32_t pinB, uint32_t portC, uint32_t pinC);
|
|
void vRFSwitchEnable(struct rf_switch_config *config);
|
|
void vRFSwitchDisable(struct rf_switch_config *config);
|
|
void vSwitchRFOut(struct rf_switch_config *config, RF_OUT_ENUM state);
|
|
RF_OUT_ENUM xGetRFSwitchState(struct rf_switch_config *config);
|
|
|
|
#endif /*RF_SWITCH_DRIVER_H_*/
|