icE1usb fw: Internal API for configuring E1 rx/tx config register

Related: OS#4675
Change-Id: Ib23f9b99f169ab18d730bcf67b97a7b6bf863e98
This commit is contained in:
Harald Welte 2020-12-16 00:02:11 +01:00
parent 7f74fe6e48
commit 06fbf6b3ff
2 changed files with 26 additions and 0 deletions

View File

@ -263,6 +263,29 @@ e1_init(bool clk_mode)
g_e1.tx.state = BOOT;
}
#define TXCR_PERMITTED ( \
E1_TX_CR_MODE_TS0_CRC_E | \
E1_TX_CR_TICK_REMOTE | \
E1_TX_CR_ALARM | \
E1_TX_CR_LOOPBACK | \
E1_TX_CR_LOOPBACK_CROSS )
void
e1_tx_config(uint16_t cr)
{
g_e1.tx.cr = (cr & TXCR_PERMITTED);
e1_regs->tx.csr = (e1_regs->tx.csr & ~TXCR_PERMITTED) | g_e1.tx.cr;
}
#define RXCR_PERMITTED ( \
E1_RX_CR_MODE_MFA )
void
e1_rx_config(uint16_t cr)
{
g_e1.rx.cr = (cr & RXCR_PERMITTED);
e1_regs->rx.csr = (e1_regs->rx.csr & ~RXCR_PERMITTED) | g_e1.rx.cr;
}
#include "dma.h"

View File

@ -11,6 +11,9 @@ void e1_init(bool clk_mode);
void e1_poll(void);
void e1_debug_print(bool data);
void e1_tx_config(uint16_t cr);
void e1_rx_config(uint16_t cr);
volatile uint8_t *e1_data_ptr(int mf, int frame, int ts);
unsigned int e1_data_ofs(int mf, int frame, int ts);