| Electronic Components Datasheet Search |
|
UM0097 Datasheet(PDF) 70 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0097 Datasheet(HTML) 70 Page - STMicroelectronics |
|
70 / 229 page ![]() Peripheral firmware overview UM0097 70/229 Example: This example illustrates how to configure GPIO0, GPIO1 and GPIO2 port pins. { #define GPIO_PIN4 0x04 #define GPIO_PIN5 0x05 /*Configure the GPIO0 pin 0 as Open Drain Output */ GPIO_Config (GPIO0, 0x0001, GPIO_OUT_OD); /*Configure the GPIO0 pins 4 and 5 as a Push-Pull Output */ GPIO_Config (GPIO0, (0x0001<<GPIO_PIN4) | (0x0001<<GPIO_PIN5), GPIO_OUT_PP); /*Configure the GPIO0 pin 15 as standard TTL input */ GPIO_Config (GPIO0, 0x8000, GPIO_IN_TRI_TTL); /*Configure the GPIO1 pins 0, 1, 2 and 3 as High impedance Analog Input * GPIO_Config (GPIO1, 0x000F, GPIO_HI_AIN_TRI); /* Configure all the GPIO2 pins as Push-Pull Output */ GPIO_Config (GPIO2, 0xFFFF, GPIO_OUT_PP); } GPIO_BitRead Function Name GPIO_BitRead Function Prototype u8 GPIO_BitRead (GPIO_TypeDef *GPIOx, u8 Port_Pin); Behavior Description Reads the specified data port bit and returns its value. Input Parameter 1 GPIOx: selects the port to be read. x can be 0, 1 or 2. Refer to GPIOx values on page 68 for details on the allowed values of this parameter. Input Parameter 2 Port_Pin: Specifies the pin to see the value. Refer to Port pin values on page 68 for more details on this parameter. Output Parameter None Return Value The selected port pin value. It may be 0x00 if the port pin is reset or 0x01 if the port pin is set. Required preconditions The port pin must be configured as GPIO_IN_TRI_TTL or as GPIO_IN_TRI_CMOS mode. Called Functions None See also GPIO_ByteRead on page 71, GPIO_WordRead on page 72 |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| 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 |