GPIO
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[+Zigbee30+EmberZnet]]
&color(red){※This article is based on EmberZnet SDK 6.7.5...
#contents
* API [#pedaa204]
** GPIO_PinModeSet [#sac84aa8]
Set the mode for a GPIO pin.
#codeprettify{{
void GPIO_PinModeSet(GPIO_Port_TypeDef port,
unsigned int pin,
GPIO_Mode_TypeDef mode,
unsigned int out
)
Parameters
- port The GPIO port to access.
- pin The pin number in the port.
- mode The desired pin mode.
- out A value to set for the pin in the DOUT register. Th...
}}
收发引脚的配置,根据手册中的描述和例子,需要将对应的TX配...
#codeprettify{{
// 配置引脚
GPIO_PinModeSet(PORTIO_USART0_TX_PORT,PORTIO_USART0_TX_PI...
GPIO_PinModeSet(PORTIO_USART0_RX_PORT,PORTIO_USART0_RX_PI...
}}
重要!!!由于硬件设计非常灵活,所以USART0的收发两个引脚必须...
#codeprettify{{
// 引脚路由
GPIO->USARTROUTE_SET[USART_NUM(USART0)].RXROUTE =
(PORTIO_USART0_RX_PORT<<_GPIO_USART_RXROUTE_PORT_SHIFT...
(PORTIO_USART0_RX_PIN <<_GPIO_USART_RXROUTE_PIN_SHIFT);
GPIO->USARTROUTE_SET[USART_NUM(USART0)].TXROUTE =
(PORTIO_USART0_TX_PORT<<_GPIO_USART_TXROUTE_PORT_SHIFT...
(PORTIO_USART0_TX_PIN <<_GPIO_USART_TXROUTE_PIN_SHIFT);
// 引脚使能
GPIO->USARTROUTE_SET[USART_NUM(USART0)].ROUTEEN =(GPIO_US...
}}
** GPIO_IntConfig [#m46bd188]
Configure GPIO interrupt.
If reconfiguring a GPIO interrupt that is already enabled...
The actual GPIO interrupt handler must be in place before...
Notice that any pending interrupt for the selected pin is...
#codeprettify{{
__STATIC_INLINE void GPIO_IntConfig(GPIO_Port_TypeDef po...
unsigned int pin,
bool risingEdge,
bool fallingEdge,
bool enable
)
Deprecated:
Deprecated function. New code should use GPIO_ExtIntConfi...
Note
A certain pin number can only be associated with one port...
Parameters
- port The port to associate with pin.
- pin The pin number on the port ( == GPIO EXTI interrupt...
- risingEdge Set to true if interrupts will be enabled on...
- fallingEdge Set to true if interrupts will be enabled o...
- enable Set to true if interrupt will be enabled after c...
}}
** GPIO_PinOutSet [#m1038908]
Set a single pin in GPIO data out register to 1.
#codeprettify{{
__STATIC_INLINE void GPIO_PinOutSet(GPIO_Port_TypeDef po...
Note
In order for the setting to take effect on the output pad...
Parameters
- port The GPIO port to access.
- pin The pin to set.
}}
GPIO_PinOutSet(gpioPortA, 5); //高电平,耗时约20ns
halResetWatchdog();//耗时约680ns
** GPIO_PinOutClear [#c0b5a8e8]
Set a single pin in GPIO data out port register to 0.
#codeprettify{{
__STATIC_INLINE void GPIO_PinOutClear(GPIO_Port_TypeDef ...
Note
In order for the setting to take effect on the output pad...
Parameters
- port The GPIO port to access.
- pin The pin to set.
}}
GPIO_PinOutClear(gpioPortA, 5); //低电平,耗时约20ns+60ns
&ref(ZigBee.png);
#hr();
Comment:
#comment_kcaptcha
終了行:
[[+Zigbee30+EmberZnet]]
&color(red){※This article is based on EmberZnet SDK 6.7.5...
#contents
* API [#pedaa204]
** GPIO_PinModeSet [#sac84aa8]
Set the mode for a GPIO pin.
#codeprettify{{
void GPIO_PinModeSet(GPIO_Port_TypeDef port,
unsigned int pin,
GPIO_Mode_TypeDef mode,
unsigned int out
)
Parameters
- port The GPIO port to access.
- pin The pin number in the port.
- mode The desired pin mode.
- out A value to set for the pin in the DOUT register. Th...
}}
收发引脚的配置,根据手册中的描述和例子,需要将对应的TX配...
#codeprettify{{
// 配置引脚
GPIO_PinModeSet(PORTIO_USART0_TX_PORT,PORTIO_USART0_TX_PI...
GPIO_PinModeSet(PORTIO_USART0_RX_PORT,PORTIO_USART0_RX_PI...
}}
重要!!!由于硬件设计非常灵活,所以USART0的收发两个引脚必须...
#codeprettify{{
// 引脚路由
GPIO->USARTROUTE_SET[USART_NUM(USART0)].RXROUTE =
(PORTIO_USART0_RX_PORT<<_GPIO_USART_RXROUTE_PORT_SHIFT...
(PORTIO_USART0_RX_PIN <<_GPIO_USART_RXROUTE_PIN_SHIFT);
GPIO->USARTROUTE_SET[USART_NUM(USART0)].TXROUTE =
(PORTIO_USART0_TX_PORT<<_GPIO_USART_TXROUTE_PORT_SHIFT...
(PORTIO_USART0_TX_PIN <<_GPIO_USART_TXROUTE_PIN_SHIFT);
// 引脚使能
GPIO->USARTROUTE_SET[USART_NUM(USART0)].ROUTEEN =(GPIO_US...
}}
** GPIO_IntConfig [#m46bd188]
Configure GPIO interrupt.
If reconfiguring a GPIO interrupt that is already enabled...
The actual GPIO interrupt handler must be in place before...
Notice that any pending interrupt for the selected pin is...
#codeprettify{{
__STATIC_INLINE void GPIO_IntConfig(GPIO_Port_TypeDef po...
unsigned int pin,
bool risingEdge,
bool fallingEdge,
bool enable
)
Deprecated:
Deprecated function. New code should use GPIO_ExtIntConfi...
Note
A certain pin number can only be associated with one port...
Parameters
- port The port to associate with pin.
- pin The pin number on the port ( == GPIO EXTI interrupt...
- risingEdge Set to true if interrupts will be enabled on...
- fallingEdge Set to true if interrupts will be enabled o...
- enable Set to true if interrupt will be enabled after c...
}}
** GPIO_PinOutSet [#m1038908]
Set a single pin in GPIO data out register to 1.
#codeprettify{{
__STATIC_INLINE void GPIO_PinOutSet(GPIO_Port_TypeDef po...
Note
In order for the setting to take effect on the output pad...
Parameters
- port The GPIO port to access.
- pin The pin to set.
}}
GPIO_PinOutSet(gpioPortA, 5); //高电平,耗时约20ns
halResetWatchdog();//耗时约680ns
** GPIO_PinOutClear [#c0b5a8e8]
Set a single pin in GPIO data out port register to 0.
#codeprettify{{
__STATIC_INLINE void GPIO_PinOutClear(GPIO_Port_TypeDef ...
Note
In order for the setting to take effect on the output pad...
Parameters
- port The GPIO port to access.
- pin The pin to set.
}}
GPIO_PinOutClear(gpioPortA, 5); //低电平,耗时约20ns+60ns
&ref(ZigBee.png);
#hr();
Comment:
#comment_kcaptcha
ページ名: