2023-08-26 12:36:10 +08:00
|
|
|
#ifndef _GPIO_DRV_H_
|
|
|
|
#define _GPIO_DRV_H_
|
|
|
|
|
|
|
|
#include "dw_apb_gpio.h"
|
|
|
|
#include "typedef.h"
|
|
|
|
|
|
|
|
#define JESD_RF_CH_NUM 4
|
|
|
|
|
|
|
|
typedef enum _tagGpioLValid
|
|
|
|
{
|
|
|
|
LOW_AS_VALID = 0,
|
|
|
|
HIGH_AS_VALID
|
|
|
|
}gpioLValid;
|
|
|
|
|
|
|
|
typedef enum _tagJesdGpioTRCH
|
|
|
|
{
|
|
|
|
JESD_RF_TX = 0,
|
|
|
|
JESD_RF_RX = 1,
|
|
|
|
JESD_RF_ORX = 2,
|
|
|
|
JESD_TRCH_MAXNUM = 3
|
|
|
|
}jesdGpioTRch;
|
|
|
|
|
2023-09-15 14:59:25 +08:00
|
|
|
typedef enum _tagGpioState
|
2023-08-26 12:36:10 +08:00
|
|
|
{
|
2023-09-15 14:59:25 +08:00
|
|
|
GPIO_OFF = 0,
|
|
|
|
GPIO_ON = 1
|
2023-08-26 12:36:10 +08:00
|
|
|
}jesdGpioState;
|
|
|
|
|
|
|
|
typedef struct _tagGpioInfo
|
|
|
|
{
|
|
|
|
uint8_t pinId; // 0~31
|
|
|
|
uint8_t vaFlag; // 0: low as valid; 1: high as valid
|
|
|
|
}stGpioInfo;
|
|
|
|
|
|
|
|
typedef struct _tagGpioJesd
|
|
|
|
{
|
|
|
|
stGpioInfo txGpioInfo[JESD_RF_CH_NUM];
|
|
|
|
stGpioInfo rxGpioInfo[JESD_RF_CH_NUM];
|
|
|
|
stGpioInfo orxGpioInfo[JESD_RF_CH_NUM];
|
|
|
|
}stGpioJesd;
|
|
|
|
|
|
|
|
typedef struct _tagGpioOnBoard
|
|
|
|
{
|
|
|
|
stGpioJesd jesdGpioInfo;
|
|
|
|
stGpioInfo triggerGpioInfo;
|
|
|
|
}stGpioOnBoard;
|
|
|
|
|
|
|
|
int32_t hw_gpio_init();
|
|
|
|
|
|
|
|
int32_t set_jesd_rf_state(uint8_t nTRCh, uint8_t nState);
|
|
|
|
|
|
|
|
int32_t set_trigger_state(uint8_t nState);
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
int32_t set_tx_on();
|
|
|
|
|
|
|
|
int32_t set_tx_off();
|
|
|
|
|
|
|
|
int32_t set_rx_on();
|
|
|
|
|
|
|
|
int32_t set_rx_off();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|