Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
| Functions | |
| PinName | port_pin (PortName port, int pin_n) | 
| Get the pin name from the port's pin number. | |
| void | port_init (port_t *obj, PortName port, int mask, PinDirection dir) | 
| Initilize the port. | |
| void | port_mode (port_t *obj, PinMode mode) | 
| Set the input port mode. | |
| void | port_dir (port_t *obj, PinDirection dir) | 
| Set port direction (in/out) | |
| void | port_write (port_t *obj, int value) | 
| Write value to the port. | |
| int | port_read (port_t *obj) | 
| Read the current value on the port. | |
Function Documentation
| void port_dir | ( | port_t * | obj, | 
| PinDirection | dir | ||
| ) | 
Set port direction (in/out)
- Parameters:
- 
  obj The port object dir The port direction to be set 
| void port_init | ( | port_t * | obj, | 
| PortName | port, | ||
| int | mask, | ||
| PinDirection | dir | ||
| ) | 
Initilize the port.
- Parameters:
- 
  obj The port object to initialize port The port name mask The bitmask to identify which bits in the port should be included (0 - ignore) dir The port direction 
| void port_mode | ( | port_t * | obj, | 
| PinMode | mode | ||
| ) | 
Set the input port mode.
- Parameters:
- 
  obj The port object mode THe port mode to be set 
| PinName port_pin | ( | PortName | port, | 
| int | pin_n | ||
| ) | 
Get the pin name from the port's pin number.
- Parameters:
- 
  port The port name pin_n The pin number within the specified port 
- Returns:
- The pin name for the port's pin number
| int port_read | ( | port_t * | obj ) | 
Read the current value on the port.
- Parameters:
- 
  obj The port object 
- Returns:
- An integer with each bit corresponding to an associated port pin setting
| void port_write | ( | port_t * | obj, | 
| int | value | ||
| ) | 
Write value to the port.
- Parameters:
- 
  obj The port object value The value to be set 
Generated on Tue Jul 12 2022 18:19:01 by
 1.7.2
 1.7.2