imx update
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1738 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
9b0a418568
commit
e506daa279
@ -70,16 +70,16 @@
|
||||
|
||||
void imxgpio_configoutput(int port, int bit, int value)
|
||||
{
|
||||
imxgpio_configinput(port, bit); /* Same as input except: */
|
||||
imxgpio_dirout(GPIOA, 2); /* Output */
|
||||
imxgpio_configinput(port, bit); /* Same as input except: */
|
||||
imxgpio_dirout(port, bit); /* Output */
|
||||
|
||||
if (value)
|
||||
{
|
||||
imxgpio_setoutput(GPIOA, 2); /* Set output = 1 */
|
||||
imxgpio_setoutput(port, bit); /* Set output = 1 */
|
||||
}
|
||||
else
|
||||
{
|
||||
imxgpio_clroutput(GPIOA, 2); /* Set output = 0 */
|
||||
imxgpio_clroutput(port, bit); /* Set output = 0 */
|
||||
}
|
||||
}
|
||||
|
||||
@ -89,22 +89,34 @@ void imxgpio_configoutput(int port, int bit, int value)
|
||||
|
||||
void imxgpio_configinput(int port, int bit)
|
||||
{
|
||||
imxgpio_pullupdisable(GPIOA, 2); /* No pullup */
|
||||
imxgpio_dirin(GPIOA, 2); /* Input */
|
||||
imxgpio_gpiofunc(GPIOA, 2); /* Use as GPIO */
|
||||
imxgpio_primaryperipheralfunc(GPIOA, 2); /* Not necessary */
|
||||
imxgpio_ocrain(GPIOA, 2); /* Output AIN */
|
||||
imxgpio_aoutgpio(GPIOA, 2); /* AOUT input is GPIO */
|
||||
imxgpio_boutgpio(GPIOA, 2); /* BOUT input is GPIO */
|
||||
imxgpio_pullupdisable(port, bit); /* No pullup */
|
||||
imxgpio_dirin(port, bit); /* Input */
|
||||
imxgpio_gpiofunc(port, bit); /* Use as GPIO */
|
||||
imxgpio_primaryperipheralfunc(port, bit); /* Not necessary */
|
||||
imxgpio_ocrain(port, bit); /* Output AIN */
|
||||
imxgpio_aoutgpio(port, bit); /* AOUT input is GPIO */
|
||||
imxgpio_boutgpio(port, bit); /* BOUT input is GPIO */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: imxgpio_configprimary
|
||||
* Name: imxgpio_configpfoutput
|
||||
****************************************************************************/
|
||||
|
||||
void imxgpio_configprimary(int port, int bit)
|
||||
void imxgpio_configpfoutput(int port, int bit)
|
||||
{
|
||||
imxgpio_configinput(port, bit); /* Same as input except: */
|
||||
imxgpio_peripheralfunc(GPIOA, 2); /* Use as peripheral */
|
||||
imxgpio_primaryperipheralfunc(GPIOA, 2); /* Primary function*/
|
||||
imxgpio_configinput(port, bit); /* Same as input except: */
|
||||
imxgpio_peripheralfunc(port, bit); /* Use as peripheral */
|
||||
imxgpio_primaryperipheralfunc(port, bit); /* Primary function*/
|
||||
imxgpio_dirout(port, bit); /* Make output */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: imxgpio_configpfinput
|
||||
****************************************************************************/
|
||||
|
||||
void imxgpio_configpfinput(int port, int bit)
|
||||
{
|
||||
imxgpio_configinput(port, bit); /* Same as input except: */
|
||||
imxgpio_peripheralfunc(port, bit); /* Use as peripheral */
|
||||
imxgpio_primaryperipheralfunc(port, bit); /* Primary function*/
|
||||
}
|
||||
|
@ -548,10 +548,10 @@ static inline void imxgpio_clroutput(int port, int bit)
|
||||
|
||||
/* Useful functions for normal configurations */
|
||||
|
||||
extern void imxgpio_configreset(int port, int bit);
|
||||
extern void imxgpio_configoutput(int port, int bit, int value);
|
||||
extern void imxgpio_configinput(int port, int bit);
|
||||
extern void imxgpio_configprimary(int port, int bit);
|
||||
extern void imxgpio_configpfoutput(int port, int bit);
|
||||
extern void imxgpio_configpfinput(int port, int bit);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -1070,10 +1070,10 @@ void up_earlyserialinit(void)
|
||||
|
||||
/* Configure UART1 pins: RXD, TXD, RTS, and CTS */
|
||||
|
||||
imxgpio_configprimary(GPIOC, 9);
|
||||
imxgpio_configprimary(GPIOC, 10);
|
||||
imxgpio_configprimary(GPIOC, 11);
|
||||
imxgpio_configprimary(GPIOC, 12);
|
||||
imxgpio_configpfoutput(GPIOC, 9); /* Port C, pin 9: CTS */
|
||||
imxgpio_configpfinput(GPIOC, 10); /* Port C, pin 10: RTS */
|
||||
imxgpio_configpfoutput(GPIOC, 11); /* Port C, pin 11: TXD */
|
||||
imxgpio_configpfinput(GPIOC, 12); /* Port C, pin 12: RXD */
|
||||
#endif
|
||||
|
||||
/* Configure and disable the UART2 */
|
||||
@ -1083,13 +1083,13 @@ void up_earlyserialinit(void)
|
||||
up_serialout(&g_uart2priv, UART_UCR2, 0);
|
||||
|
||||
/* Configure UART2 pins: RXD, TXD, RTS, and CTS (only, also
|
||||
* supports DTR, DCD, RI, and DSR
|
||||
* supports DTR, DCD, RI, and DSR -- not configured)
|
||||
*/
|
||||
|
||||
imxgpio_configprimary(GPIOB, 28);
|
||||
imxgpio_configprimary(GPIOB, 29);
|
||||
imxgpio_configprimary(GPIOB, 30);
|
||||
imxgpio_configprimary(GPIOB, 31);
|
||||
imxgpio_configpfoutput(GPIOB, 28); /* Port B, pin 28: CTS */
|
||||
imxgpio_configpfinput(GPIOB, 29); /* Port B, pin 29: RTS */
|
||||
imxgpio_configpfoutput(GPIOB, 30); /* Port B, pin 30: TXD */
|
||||
imxgpio_configpfinput(GPIOB, 31); /* Port B, pin 31: RXD */
|
||||
#endif
|
||||
|
||||
/* Configure and disable the UART3 */
|
||||
@ -1099,13 +1099,13 @@ void up_earlyserialinit(void)
|
||||
up_serialout(&g_uart3priv, UART_UCR2, 0);
|
||||
|
||||
/* Configure UART2 pins: RXD, TXD, RTS, and CTS (only, also
|
||||
* supports DTR, DCD, RI, and DSR
|
||||
* supports DTR, DCD, RI, and DSR -- not configured)
|
||||
*/
|
||||
|
||||
imxgpio_configprimary(GPIOC, 28);
|
||||
imxgpio_configprimary(GPIOC, 29);
|
||||
imxgpio_configprimary(GPIOC, 30);
|
||||
imxgpio_configprimary(GPIOC, 31);
|
||||
imxgpio_configpfoutput(GPIOC, 28); /* Port C, pin 18: CTS */
|
||||
imxgpio_configpfinput(GPIOC, 29); /* Port C, pin 29: RTS */
|
||||
imxgpio_configpfoutput(GPIOC, 30); /* Port C, pin 30: TXD */
|
||||
imxgpio_configpfinput(GPIOC, 31); /* Port C, pin 31: RXD */
|
||||
#endif
|
||||
|
||||
/* Then enable the console UART. The others will be initialized
|
||||
|
Loading…
Reference in New Issue
Block a user