mbed library sources. Supersedes mbed-src.

Dependents:   Nucleo_Hello_Encoder BLE_iBeaconScan AM1805_DEMO DISCO-F429ZI_ExportTemplate1 ... more

Embed: (wiki syntax)

« Back to documentation index

Port HAL functions

Port HAL functions
[Hal]

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:
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