数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

PM0222 数据表(PDF) 13 Page - STMicroelectronics

部件名 PM0222
功能描述  Brain smart hub family
PDF  33 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

PM0222 数据表(HTML) 13 Page - STMicroelectronics

Back Button PM0222 Datasheet HTML 9Page - STMicroelectronics PM0222 Datasheet HTML 10Page - STMicroelectronics PM0222 Datasheet HTML 11Page - STMicroelectronics PM0222 Datasheet HTML 12Page - STMicroelectronics PM0222 Datasheet HTML 13Page - STMicroelectronics PM0222 Datasheet HTML 14Page - STMicroelectronics PM0222 Datasheet HTML 15Page - STMicroelectronics PM0222 Datasheet HTML 16Page - STMicroelectronics PM0222 Datasheet HTML 17Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 13 / 33 page
background image
DocID025476 Rev 1
13/33
PM0222
GPIO / IOs management
33
Figure 1. GPIO_MODE configuration
5.1.2
Simple I/O configurations
This example shows how to configure an I/O in a specific mode and how to configure an
interrupt. This set of commands will select the GPIO mode for IO9, configure it in output
mode, and program an interrupt to be set when a rising edge is detected on this I/O. Then
the GPIO will be driven by the software to set a ‘1’ in order to trigger the interrupt:
GPIO->GPIO_MODE = 0x00080000; // IO9 in GPIO mode
GPIO->GPIO_DIR = 0x0200; // IO9 in output mode
GPIO->GPIO_IS = 0x0000; // edge detection for the interrupt
GPIO->GPIO_IBE = 0x0000; // single edge for the interrupt detection
GPIO->GPIO_IVE = 0x0200; // rising edge for the interrupt detection
GPIO->GPIO_IC = 0x0200; // clear pending interrupt on IO9
GPIO->GPIO_IE = 0x0200; // enable interrupt on IO9
// set a ‘1’ in IO9, to trigger the interrupt
GPIO->GPIO_DATA = 0x0200
In this sequence of commands, the GPIO mode is selected for IO9 as an output and
interrupts upon detection of the rising edge at which point a ‘1’ is set on IO9, and this
command triggers the interrupt. When the interrupt is detected by the Cortex-M0, the
program enters in the corresponding interrupt subroutine if the corresponding interrupt has
been properly enabled on the Cortex-M0 side (see Section 4: Interrupt management).
Note:
In this example, to trigger the interrupt the IO is in GPIO mode driven by the software to set
the bit to ‘1’. But the IO can also be in serial mode 0 or serial mode 1 with a specific interrupt
configuration through GPIO_IS, GPIO_IBE, GPIO_IVE in order to wait for an interrupt
coming from an external event.
5.1.3
Configuration of IO7/8/9/10 to become SPI I/Os
This example shows how to configure IO 7, 8, 9 and 10 in serial mode 1 (see Table 5: GPIO
modes).
// IO 7, 8, 9 and 10 in serial mode 1
GPIO->GPIO_MODE = 0x00154000
This configuration will reroute the SPI pins to these four I/Os. This configuration is
mandatory if the user program wants to use the SPI IP.



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com