công cụ tìm kiếm bảng dữ liệu linh kiện điện tử
  Vietnamese  ▼
ALLDATASHEET.VN

X  

PM0222 bảng dữ liệu(PDF) 13 Page - STMicroelectronics

tên linh kiện PM0222
Giải thích chi tiết về linh kiện  Brain smart hub family
PDF  33 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
nhà sản xuất  STMICROELECTRONICS [STMicroelectronics]
Trang chủ  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

PM0222 bảng dữ liệu(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


bảng dữ liệu tải về

Go To PDF Page


Link URL



Cho đến nay ALLDATASHEET có giúp ích cho doanh nghiệp của bạn hay không?  [ DONATE ] 

Alldatasheet là   |   Quảng cáo   |   Liên lạc với chúng tôi   |   Chính sách bảo mật   |   Liên kết đến bảng dữ liệu    |   Trao đổi link   |   Tìm kiếm theo nhà sản xuất
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