|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-5-3 08:42:18
|
显示全部楼层
__inline void AT91F_PIO_CfgOutput(
AT91PS_PIO pPio, // \arg pointer to a PIO controller
unsigned int pioEnable) // \arg PIO to be enabled
{
pPio->PIO_PER = pioEnable; // Set in PIO mode
pPio->PIO_OER = pioEnable; // Configure in Output
}
//*----------------------------------------------------------------------------
//* \fn AT91F_PIO_CfgInput
//* \brief Enable PIO in input mode
//*----------------------------------------------------------------------------
__inline void AT91F_PIO_CfgInput(
AT91PS_PIO pPio, // \arg pointer to a PIO controller
unsigned int inputEnable) // \arg PIO to be enabled
{
// Disable output
pPio->PIO_ODR = inputEnable;
pPio->PIO_PER = inputEnable;
}
AT91F_PIO_CfgOutput( AT91C_BASE_PIOA, CC1100_MOSI|CC1100_SCK|CC1100_CSN|CC1100_TXEN|CC1100_RXEN|CC1100_POWER);//设置为输出
AT91F_PIO_CfgPullup( AT91C_BASE_PIOA, CC1100_MOSI|CC1100_SCK|CC1100_CSN|CC1100_TXEN|CC1100_RXEN|CC1100_POWER);//启用上拉电阻
AT91F_PIO_CfgInput( AT91C_BASE_PIOA, CC1100_MISO|CC1100_GDO2|CC1100_GDO0);//设置为输入
AT91F_PIO_CfgPullup( AT91C_BASE_PIOA, CC1100_MISO|CC1100_GDO2|CC1100_GDO0);//启用上拉电阻 |
|