mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 13:27:01 +08:00
nxstyle: Fix existing long line to match code style
Signed-off-by: Brennan Ashton <bashton@brennanashton.com>
This commit is contained in:
@@ -310,7 +310,8 @@ void arm_lowputc(char ch)
|
|||||||
* redesigning all of the FIFO status logic.
|
* redesigning all of the FIFO status logic.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while ((getreg8(CONSOLE_BASE+KINETIS_UART_S1_OFFSET) & UART_S1_TDRE) == 0);
|
while (
|
||||||
|
(getreg8(CONSOLE_BASE + KINETIS_UART_S1_OFFSET) & UART_S1_TDRE) == 0);
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
/* Then write the character to the UART data register */
|
/* Then write the character to the UART data register */
|
||||||
@@ -318,7 +319,8 @@ void arm_lowputc(char ch)
|
|||||||
putreg8((uint8_t)ch, CONSOLE_BASE + KINETIS_UART_D_OFFSET);
|
putreg8((uint8_t)ch, CONSOLE_BASE + KINETIS_UART_D_OFFSET);
|
||||||
|
|
||||||
#elif defined(HAVE_LPUART_CONSOLE)
|
#elif defined(HAVE_LPUART_CONSOLE)
|
||||||
while ((getreg32(CONSOLE_BASE + KINETIS_LPUART_STAT_OFFSET) & LPUART_STAT_TDRE) == 0);
|
while ((getreg32(CONSOLE_BASE + KINETIS_LPUART_STAT_OFFSET) &
|
||||||
|
LPUART_STAT_TDRE) == 0);
|
||||||
|
|
||||||
/* Then send the character */
|
/* Then send the character */
|
||||||
|
|
||||||
@@ -681,6 +683,7 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud,
|
|||||||
{
|
{
|
||||||
regval |= UART_BDH_SBNS;
|
regval |= UART_BDH_SBNS;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = sbr >> 8;
|
tmp = sbr >> 8;
|
||||||
regval |= (((uint8_t)tmp) << UART_BDH_SBR_SHIFT) & UART_BDH_SBR_MASK;
|
regval |= (((uint8_t)tmp) << UART_BDH_SBR_SHIFT) & UART_BDH_SBR_MASK;
|
||||||
putreg8(regval, uart_base + KINETIS_UART_BDH_OFFSET);
|
putreg8(regval, uart_base + KINETIS_UART_BDH_OFFSET);
|
||||||
@@ -720,7 +723,8 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud,
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef CONFIG_KINETIS_UARTFIFOS
|
#ifdef CONFIG_KINETIS_UARTFIFOS
|
||||||
depth = g_sizemap[(regval & UART_PFIFO_RXFIFOSIZE_MASK) >> UART_PFIFO_RXFIFOSIZE_SHIFT];
|
depth = g_sizemap[(regval & UART_PFIFO_RXFIFOSIZE_MASK) >>
|
||||||
|
UART_PFIFO_RXFIFOSIZE_SHIFT];
|
||||||
if (depth > 1)
|
if (depth > 1)
|
||||||
{
|
{
|
||||||
depth = (3 * depth) >> 2;
|
depth = (3 * depth) >> 2;
|
||||||
@@ -728,7 +732,8 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud,
|
|||||||
|
|
||||||
putreg8(depth , uart_base + KINETIS_UART_RWFIFO_OFFSET);
|
putreg8(depth , uart_base + KINETIS_UART_RWFIFO_OFFSET);
|
||||||
|
|
||||||
depth = g_sizemap[(regval & UART_PFIFO_TXFIFOSIZE_MASK) >> UART_PFIFO_TXFIFOSIZE_SHIFT];
|
depth = g_sizemap[(regval & UART_PFIFO_TXFIFOSIZE_MASK) >>
|
||||||
|
UART_PFIFO_TXFIFOSIZE_SHIFT];
|
||||||
if (depth > 3)
|
if (depth > 3)
|
||||||
{
|
{
|
||||||
depth = (depth >> 2);
|
depth = (depth >> 2);
|
||||||
@@ -738,7 +743,8 @@ void kinetis_uartconfigure(uintptr_t uart_base, uint32_t baud,
|
|||||||
|
|
||||||
/* Enable RX and TX FIFOs */
|
/* Enable RX and TX FIFOs */
|
||||||
|
|
||||||
putreg8(UART_PFIFO_RXFE | UART_PFIFO_TXFE, uart_base+KINETIS_UART_PFIFO_OFFSET);
|
putreg8(UART_PFIFO_RXFE | UART_PFIFO_TXFE,
|
||||||
|
uart_base + KINETIS_UART_PFIFO_OFFSET);
|
||||||
#else
|
#else
|
||||||
/* Otherwise, disable the FIFOs. Then the FIFOs are disable, the effective
|
/* Otherwise, disable the FIFOs. Then the FIFOs are disable, the effective
|
||||||
* FIFO depth is 1. So set the watermarks as follows:
|
* FIFO depth is 1. So set the watermarks as follows:
|
||||||
@@ -957,12 +963,14 @@ void kinetis_lpuartconfigure(uintptr_t uart_base, uint32_t baud,
|
|||||||
{
|
{
|
||||||
regval |= LPUART_MODIR_RXRTSE;
|
regval |= LPUART_MODIR_RXRTSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_SERIAL_OFLOWCONTROL
|
#ifdef CONFIG_SERIAL_OFLOWCONTROL
|
||||||
if (oflow)
|
if (oflow)
|
||||||
{
|
{
|
||||||
regval |= LPUART_MODIR_TXCTSE;
|
regval |= LPUART_MODIR_TXCTSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
putreg32(regval, uart_base + KINETIS_LPUART_MODIR_OFFSET);
|
putreg32(regval, uart_base + KINETIS_LPUART_MODIR_OFFSET);
|
||||||
|
|
||||||
@@ -971,4 +979,5 @@ void kinetis_lpuartconfigure(uintptr_t uart_base, uint32_t baud,
|
|||||||
regval |= (LPUART_CTRL_RE | LPUART_CTRL_TE);
|
regval |= (LPUART_CTRL_RE | LPUART_CTRL_TE);
|
||||||
putreg32(regval, uart_base + KINETIS_LPUART_CTRL_OFFSET);
|
putreg32(regval, uart_base + KINETIS_LPUART_CTRL_OFFSET);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -100,6 +100,7 @@
|
|||||||
#define I2S_DAO_WSHALFPER_MASK (0x01ff << I2S_DAO_WSHALFPER_SHIFT)
|
#define I2S_DAO_WSHALFPER_MASK (0x01ff << I2S_DAO_WSHALFPER_SHIFT)
|
||||||
#define I2S_DAO_MUTE (1 << 15) /* Bit 15: Send only zeros on channel */
|
#define I2S_DAO_MUTE (1 << 15) /* Bit 15: Send only zeros on channel */
|
||||||
/* Bits 16-31: Reserved */
|
/* Bits 16-31: Reserved */
|
||||||
|
|
||||||
/* Digital Audio Input Register */
|
/* Digital Audio Input Register */
|
||||||
|
|
||||||
#define I2S_DAI_WDWID_SHIFT (0) /* Bits 0-1: Selects the number of bytes in data */
|
#define I2S_DAI_WDWID_SHIFT (0) /* Bits 0-1: Selects the number of bytes in data */
|
||||||
@@ -114,8 +115,10 @@
|
|||||||
#define I2S_DAI_WSHALFPER_SHIFT (6) /* Bits 6-14: Word select half period minus 1 */
|
#define I2S_DAI_WSHALFPER_SHIFT (6) /* Bits 6-14: Word select half period minus 1 */
|
||||||
#define I2S_DAI_WSHALFPER_MASK (0x01ff << I2S_DAI_WSHALFPER_SHIFT)
|
#define I2S_DAI_WSHALFPER_MASK (0x01ff << I2S_DAI_WSHALFPER_SHIFT)
|
||||||
/* Bits 15-31: Reserved */
|
/* Bits 15-31: Reserved */
|
||||||
/* Transmit FIFO: 8 - 32-bit transmit FIFO */
|
|
||||||
/* Receive FIFO: 8 - 32-bit receive FIFO */
|
/* Transmit FIFO: 8 - 32-bit transmit FIFO
|
||||||
|
* Receive FIFO: 8 - 32-bit receive FIFO
|
||||||
|
*/
|
||||||
|
|
||||||
/* Status Feedback Register */
|
/* Status Feedback Register */
|
||||||
|
|
||||||
@@ -129,6 +132,7 @@
|
|||||||
#define I2S_STATE_TXLEVEL_SHIFT (16) /* Bits 16-19: Current level of the Transmit FIFO */
|
#define I2S_STATE_TXLEVEL_SHIFT (16) /* Bits 16-19: Current level of the Transmit FIFO */
|
||||||
#define I2S_STATE_TXLEVEL_MASK (15 << I2S_STATE_TXLEVEL_SHIFT)
|
#define I2S_STATE_TXLEVEL_MASK (15 << I2S_STATE_TXLEVEL_SHIFT)
|
||||||
/* Bits 20-31: Reserved */
|
/* Bits 20-31: Reserved */
|
||||||
|
|
||||||
/* DMA Configuration Register 1 and 2 */
|
/* DMA Configuration Register 1 and 2 */
|
||||||
|
|
||||||
#define I2S_DMA_RXDMAEN (1 << 0) /* Bit 0: Enable DMA1 for I2S receive */
|
#define I2S_DMA_RXDMAEN (1 << 0) /* Bit 0: Enable DMA1 for I2S receive */
|
||||||
@@ -140,6 +144,7 @@
|
|||||||
#define I2S_DMA_TXDEPTH_SHIFT (16) /* Bits 16-19: FIFO level that triggers a TX request on DMA1 */
|
#define I2S_DMA_TXDEPTH_SHIFT (16) /* Bits 16-19: FIFO level that triggers a TX request on DMA1 */
|
||||||
#define I2S_DMA_TXDEPTH_MASK (15 << I2S_DMA_TXDEPTH_SHIFT)
|
#define I2S_DMA_TXDEPTH_MASK (15 << I2S_DMA_TXDEPTH_SHIFT)
|
||||||
/* Bits 20-31: Reserved */
|
/* Bits 20-31: Reserved */
|
||||||
|
|
||||||
/* Interrupt Request Control Register */
|
/* Interrupt Request Control Register */
|
||||||
|
|
||||||
#define I2S_IRQ_RXEN (1 << 0) /* Bit 0: Enable I2S receive interrupt */
|
#define I2S_IRQ_RXEN (1 << 0) /* Bit 0: Enable I2S receive interrupt */
|
||||||
@@ -151,6 +156,7 @@
|
|||||||
#define I2S_IRQ_TXDEPTH_SHIFT (16) /* Bits 16-19: Set FIFO level for irq request */
|
#define I2S_IRQ_TXDEPTH_SHIFT (16) /* Bits 16-19: Set FIFO level for irq request */
|
||||||
#define I2S_IRQ_TXDEPTH_MASK (15 << I2S_IRQ_TXDEPTH_SHIFT)
|
#define I2S_IRQ_TXDEPTH_MASK (15 << I2S_IRQ_TXDEPTH_SHIFT)
|
||||||
/* Bits 20-31: Reserved */
|
/* Bits 20-31: Reserved */
|
||||||
|
|
||||||
/* Transmit and Receive MCLK divider */
|
/* Transmit and Receive MCLK divider */
|
||||||
|
|
||||||
#define I2S_RATE_YDIV_SHIFT (0) /* Bits 0-7: I2S transmit MCLK rate denominator */
|
#define I2S_RATE_YDIV_SHIFT (0) /* Bits 0-7: I2S transmit MCLK rate denominator */
|
||||||
@@ -164,6 +170,7 @@
|
|||||||
#define I2S_BITRATE_SHIFT (0) /* Bits 0-5: I2S transmit bit rate */
|
#define I2S_BITRATE_SHIFT (0) /* Bits 0-5: I2S transmit bit rate */
|
||||||
#define I2S_BITRATE_MASK (0x3f << I2S_BITRATE_SHIFT)
|
#define I2S_BITRATE_MASK (0x3f << I2S_BITRATE_SHIFT)
|
||||||
/* Bits 6-31: Reserved */
|
/* Bits 6-31: Reserved */
|
||||||
|
|
||||||
/* Transmit and Receive mode control */
|
/* Transmit and Receive mode control */
|
||||||
|
|
||||||
#define I2S_MODE_CLKSEL_SHIFT (0) /* Bits 0-1: Clock source for bit clock divider */
|
#define I2S_MODE_CLKSEL_SHIFT (0) /* Bits 0-1: Clock source for bit clock divider */
|
||||||
@@ -171,20 +178,9 @@
|
|||||||
# define I2S_MODE_CLKSEL_FRACDIV (0 << I2S_MODE_CLKSEL_SHIFT) /* TX/RX fractional rate divider */
|
# define I2S_MODE_CLKSEL_FRACDIV (0 << I2S_MODE_CLKSEL_SHIFT) /* TX/RX fractional rate divider */
|
||||||
# define I2S_MODE_CLKSEL_RXMCLK (2 << I2S_MODE_CLKSEL_SHIFT) /* RX_CLCK for TX_MCLK source */
|
# define I2S_MODE_CLKSEL_RXMCLK (2 << I2S_MODE_CLKSEL_SHIFT) /* RX_CLCK for TX_MCLK source */
|
||||||
# define I2S_MODE_CLKSEL_TXMCLK (2 << I2S_MODE_CLKSEL_SHIFT) /* TX_CLCK for RX_MCLK source */
|
# define I2S_MODE_CLKSEL_TXMCLK (2 << I2S_MODE_CLKSEL_SHIFT) /* TX_CLCK for RX_MCLK source */
|
||||||
|
|
||||||
#define I2S_MODE_4PIN (1 << 2) /* Bit 2: Transmit/Receive 4-pin mode selection */
|
#define I2S_MODE_4PIN (1 << 2) /* Bit 2: Transmit/Receive 4-pin mode selection */
|
||||||
#define I2S_MODE_MCENA (1 << 3) /* Bit 3: Enable for the TX/RX_MCLK output */
|
#define I2S_MODE_MCENA (1 << 3) /* Bit 3: Enable for the TX/RX_MCLK output */
|
||||||
/* Bits 4-31: Reserved */
|
/* Bits 4-31: Reserved */
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Public Types
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Public Data
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
#endif /* __ARCH_ARM_SRC_LPC17XX_40XX_HARDWARE_LPC17_40_I2S_H */
|
#endif /* __ARCH_ARM_SRC_LPC17XX_40XX_HARDWARE_LPC17_40_I2S_H */
|
||||||
|
|||||||
@@ -433,7 +433,8 @@ static inline uint32_t up_serialin(struct up_dev_s *priv, int offset)
|
|||||||
* Name: up_serialout
|
* Name: up_serialout
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline void up_serialout(struct up_dev_s *priv, int offset, uint32_t value)
|
static inline void up_serialout(struct up_dev_s *priv, int offset,
|
||||||
|
uint32_t value)
|
||||||
{
|
{
|
||||||
putreg32(value, priv->uartbase + offset);
|
putreg32(value, priv->uartbase + offset);
|
||||||
}
|
}
|
||||||
@@ -507,11 +508,13 @@ static int up_setup(struct uart_dev_s *dev)
|
|||||||
|
|
||||||
/* Clear fifos */
|
/* Clear fifos */
|
||||||
|
|
||||||
up_serialout(priv, LPC43_UART_FCR_OFFSET, (UART_FCR_RXRST | UART_FCR_TXRST));
|
up_serialout(priv, LPC43_UART_FCR_OFFSET,
|
||||||
|
(UART_FCR_RXRST | UART_FCR_TXRST));
|
||||||
|
|
||||||
/* Set trigger */
|
/* Set trigger */
|
||||||
|
|
||||||
up_serialout(priv, LPC43_UART_FCR_OFFSET, (UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8));
|
up_serialout(priv, LPC43_UART_FCR_OFFSET,
|
||||||
|
(UART_FCR_FIFOEN | UART_FCR_RXTRIGGER_8));
|
||||||
|
|
||||||
/* Set up the IER */
|
/* Set up the IER */
|
||||||
|
|
||||||
@@ -563,7 +566,8 @@ static int up_setup(struct uart_dev_s *dev)
|
|||||||
#ifdef CONFIG_UART1_FLOWCONTROL
|
#ifdef CONFIG_UART1_FLOWCONTROL
|
||||||
if (priv->id == 1)
|
if (priv->id == 1)
|
||||||
{
|
{
|
||||||
up_serialout(priv, LPC43_UART_MCR_OFFSET, (UART_MCR_RTSEN | UART_MCR_CTSEN));
|
up_serialout(priv, LPC43_UART_MCR_OFFSET,
|
||||||
|
(UART_MCR_RTSEN | UART_MCR_CTSEN));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -642,14 +646,15 @@ static void up_shutdown(struct uart_dev_s *dev)
|
|||||||
* Name: up_attach
|
* Name: up_attach
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Configure the UART to operation in interrupt driven mode. This method is
|
* Configure the UART to operation in interrupt driven mode. This method
|
||||||
* called when the serial port is opened. Normally, this is just after the
|
* is called when the serial port is opened. Normally, this is just
|
||||||
* the setup() method is called, however, the serial console may operate in
|
* after the the setup() method is called, however, the serial console may
|
||||||
* a non-interrupt driven mode during the boot phase.
|
* operate in a non-interrupt driven mode during the boot phase.
|
||||||
*
|
*
|
||||||
* RX and TX interrupts are not enabled when by the attach method (unless the
|
* RX and TX interrupts are not enabled when by the attach method (unless
|
||||||
* hardware supports multiple levels of interrupt enabling). The RX and TX
|
* the hardware supports multiple levels of interrupt enabling). The RX
|
||||||
* interrupts are not enabled until the txint() and rxint() methods are called.
|
* and TX interrupts are not enabled until the txint() and rxint() methods
|
||||||
|
* are called.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -678,8 +683,8 @@ static int up_attach(struct uart_dev_s *dev)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Detach UART interrupts. This method is called when the serial port is
|
* Detach UART interrupts. This method is called when the serial port is
|
||||||
* closed normally just before the shutdown method is called. The exception is
|
* closed normally just before the shutdown method is called. The
|
||||||
* the serial console which is never shutdown.
|
* exception is the serial console which is never shutdown.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@@ -804,10 +809,10 @@ static int up_interrupt(int irq, void *context, void *arg)
|
|||||||
*
|
*
|
||||||
* RS-485/EIA-485 Normal Multidrop Mode (NMM) -- NOT supported
|
* RS-485/EIA-485 Normal Multidrop Mode (NMM) -- NOT supported
|
||||||
*
|
*
|
||||||
* In this mode, an address is detected when a received byte causes the
|
* In this mode, an address is detected when a received byte causes
|
||||||
* USART to set the parity error and generate an interrupt. When the
|
* the USART to set the parity error and generate an interrupt. When
|
||||||
* parity error interrupt will be generated and the processor can decide
|
* the parity error interrupt will be generated and the processor can
|
||||||
* whether or not to disable the receiver.
|
* decide whether or not to disable the receiver.
|
||||||
*
|
*
|
||||||
* RS-485/EIA-485 Auto Address Detection (AAD) mode -- NOT supported
|
* RS-485/EIA-485 Auto Address Detection (AAD) mode -- NOT supported
|
||||||
*
|
*
|
||||||
@@ -818,21 +823,23 @@ static int up_interrupt(int irq, void *context, void *arg)
|
|||||||
* will be automatically enabled.
|
* will be automatically enabled.
|
||||||
*
|
*
|
||||||
* When an address byte which does not match the RS485ADRMATCH value
|
* When an address byte which does not match the RS485ADRMATCH value
|
||||||
* is received, the receiver will be automatically disabled in hardware.
|
* is received, the receiver will be automatically disabled in
|
||||||
|
* hardware.
|
||||||
*
|
*
|
||||||
* RS-485/EIA-485 Auto Direction Control -- Supported
|
* RS-485/EIA-485 Auto Direction Control -- Supported
|
||||||
*
|
*
|
||||||
* Allow the transmitter to automatically control the state of the DIR
|
* Allow the transmitter to automatically control the state of the DIR
|
||||||
* pin as a direction control output signal. The DIR pin will be asserted
|
* pin as a direction control output signal. The DIR pin will be
|
||||||
* (driven LOW) when the CPU writes data into the TXFIFO. The pin will be
|
* asserted (driven LOW) when the CPU writes data into the TXFIFO. The
|
||||||
* de-asserted (driven HIGH) once the last bit of data has been transmitted.
|
* pin will be de-asserted (driven HIGH) once the last bit of data has
|
||||||
|
* been transmitted.
|
||||||
*
|
*
|
||||||
* RS485/EIA-485 driver delay time -- Supported
|
* RS485/EIA-485 driver delay time -- Supported
|
||||||
*
|
*
|
||||||
* The driver delay time is the delay between the last stop bit leaving
|
* The driver delay time is the delay between the last stop bit leaving
|
||||||
* the TXFIFO and the de-assertion of the DIR pin. This delay time can be
|
* the TXFIFO and the de-assertion of the DIR pin. This delay time can
|
||||||
* programmed in the 8-bit RS485DLY register. The delay time is in periods
|
* be programmed in the 8-bit RS485DLY register. The delay time is in
|
||||||
* of the baud clock.
|
* periods of the baud clock.
|
||||||
*
|
*
|
||||||
* RS485/EIA-485 output inversion -- Supported
|
* RS485/EIA-485 output inversion -- Supported
|
||||||
*
|
*
|
||||||
@@ -991,8 +998,9 @@ static inline int up_get_rs485_mode(struct up_dev_s *priv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We only have control of the delay after send. Time must be
|
/* We only have control of the delay after send. Time must be
|
||||||
* returned in milliseconds; this must be converted from the baud clock.
|
* returned in milliseconds; this must be converted from the baud
|
||||||
* (The baud clock should be 16 times the currently selected BAUD.)
|
* clock. (The baud clock should be 16 times the currently
|
||||||
|
* selected BAUD.)
|
||||||
*
|
*
|
||||||
* msec = 1000 * dly / baud
|
* msec = 1000 * dly / baud
|
||||||
*/
|
*/
|
||||||
@@ -1100,15 +1108,15 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
#ifdef HAVE_RS485
|
#ifdef HAVE_RS485
|
||||||
case TIOCSRS485: /* Set RS485 mode, arg: pointer to struct serial_rs485 */
|
case TIOCSRS485: /* Set RS485 mode, arg: pointer to struct serial_rs485 */
|
||||||
{
|
{
|
||||||
ret = up_set_rs485_mode(priv,
|
ret = up_set_rs485_mode(
|
||||||
(const struct serial_rs485 *)((uintptr_t)arg));
|
priv, (const struct serial_rs485 *)((uintptr_t)arg));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TIOCGRS485: /* Get RS485 mode, arg: pointer to struct serial_rs485 */
|
case TIOCGRS485: /* Get RS485 mode, arg: pointer to struct serial_rs485 */
|
||||||
{
|
{
|
||||||
ret = up_get_rs485_mode(priv,
|
ret = up_get_rs485_mode(
|
||||||
(struct serial_rs485 *)((uintptr_t)arg));
|
priv, (struct serial_rs485 *)((uintptr_t)arg));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -161,11 +161,15 @@
|
|||||||
* Where CLKDIV has a range of 0-255.
|
* Where CLKDIV has a range of 0-255.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* MCK = 132MHz, CLKDIV = 164, MCI_SPEED = 132MHz / (2*164 + 0 + 2) = 400 KHz */
|
/* MCK = 132MHz, CLKDIV = 164,
|
||||||
|
* MCI_SPEED = 132MHz / (2*164 + 0 + 2) = 400 KHz
|
||||||
|
*/
|
||||||
|
|
||||||
#define HSMCI_INIT_CLKDIV (164 << HSMCI_MR_CLKDIV_SHIFT)
|
#define HSMCI_INIT_CLKDIV (164 << HSMCI_MR_CLKDIV_SHIFT)
|
||||||
|
|
||||||
/* MCK = 132MHz, CLKDIV = 2 w/CLOCKODD, MCI_SPEED = 132MHz /(2*2 + 1 + 2) = 18.9 MHz */
|
/* MCK = 132MHz, CLKDIV = 2 w/CLOCKODD,
|
||||||
|
* MCI_SPEED = 132MHz /(2*2 + 1 + 2) = 18.9 MHz
|
||||||
|
*/
|
||||||
|
|
||||||
#define HSMCI_MMCXFR_CLKDIV ((2 << HSMCI_MR_CLKDIV_SHIFT) | HSMCI_MR_CLKODD)
|
#define HSMCI_MMCXFR_CLKDIV ((2 << HSMCI_MR_CLKDIV_SHIFT) | HSMCI_MR_CLKODD)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user