SDK3.5
This document shows Ameba SDK 3.5 APIs
|
port functions More...
Ameba Common | |
typedef struct port_s | port_t |
void | port_init (port_t *obj, PortName port, int mask, PinDirection dir) |
Initializes the GPIO device port, include data direction registers. More... | |
PinName | port_pin (PortName port, int pin_n) |
Get GPIO port pin name. More... | |
void | port_mode (port_t *obj, PinMode mode) |
Configure GPIO port pins pull up/pull down. More... | |
void | port_dir (port_t *obj, PinDirection dir) |
Set GPIO port pins data direction. More... | |
void | port_write (port_t *obj, int value) |
Sets value to the selected port pins. More... | |
int | port_read (port_t *obj) |
Reads the specified gpio port pins. More... | |
port functions
void port_dir | ( | port_t * | obj, |
PinDirection | dir | ||
) |
Set GPIO port pins data direction.
obj | gpio port object define in application software. |
dir | this parameter can be one of the following values:
|
none |
void port_init | ( | port_t * | obj, |
PortName | port, | ||
int | mask, | ||
PinDirection | dir | ||
) |
Initializes the GPIO device port, include data direction registers.
obj | gpio port object define in application software. |
port | PortName according to pinmux spec, this parameter can be one of the following values:
|
mask | One bit one gpio pin, select one or multiple pins of the specified port. |
dir | gpio port direction, this parameter can be one of the following values:
|
none |
void port_mode | ( | port_t * | obj, |
PinMode | mode | ||
) |
Configure GPIO port pins pull up/pull down.
obj | gpio port object define in application software. |
mode | this parameter can be one of the following values:
|
none |
PinName port_pin | ( | PortName | port, |
int | pin_n | ||
) |
Get GPIO port pin name.
port | PortName according to pinmux spec, this parameter can be one of the following values:
|
pin_n | pin number. |
none |
int port_read | ( | port_t * | obj | ) |
Reads the specified gpio port pins.
obj | gpio port object define in application software. |
state of the specified gpio port pins |
void port_write | ( | port_t * | obj, |
int | value | ||
) |
Sets value to the selected port pins.
obj | gpio port object define in application software. |
value | One bit one gpio pin, set value to one or multiple pins of the specified port. |
none |