Mistake on this page?
Report an issue in GitHub or email us
Functions
Port HAL functions

Functions

PinName port_pin (PortName port, int pin_n)
 Get the pin name from the port's pin number. More...
 
void port_init (port_t *obj, PortName port, int mask, PinDirection dir)
 Initilize the port. More...
 
void port_mode (port_t *obj, PinMode mode)
 Set the input port mode. More...
 
void port_dir (port_t *obj, PinDirection dir)
 Set port direction (in/out) More...
 
void port_write (port_t *obj, int value)
 Write value to the port. More...
 
int port_read (port_t *obj)
 Read the current value on the port. More...
 

Detailed Description

Function Documentation

void port_dir ( port_t obj,
PinDirection  dir 
)

Set port direction (in/out)

Parameters
objThe port object
dirThe port direction to be set
void port_init ( port_t obj,
PortName  port,
int  mask,
PinDirection  dir 
)

Initilize the port.

Parameters
objThe port object to initialize
portThe port name
maskThe bitmask to identify which bits in the port should be included (0 - ignore)
dirThe port direction
void port_mode ( port_t obj,
PinMode  mode 
)

Set the input port mode.

Parameters
objThe port object
modeTHe port mode to be set
PinName port_pin ( PortName  port,
int  pin_n 
)

Get the pin name from the port's pin number.

Parameters
portThe port name
pin_nThe 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
objThe 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
objThe port object
valueThe value to be set
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.