STC15W408AS library 0.9.0
|
Macros | |
#define | pin_quasi_bidiretional_init(port, port_pin) |
Init pin in in QUASI_BIDIRECTIONAL mode. More... | |
#define | pin_push_pull_init(port, port_pin) |
Init pin in in PUSH_PULL mode. More... | |
#define | pin_input_only_init(port, port_pin) |
Init pin in in INPUT_ONLY mode. More... | |
#define | pin_open_drain_init(port, port_pin) |
Init pin in in OPEN_DRAIN mode. More... | |
#define | is_pin_mode_quasi_bidiretional(port, port_pin) ( ((port ## M1 & (1 << port_pin)) == 0) && ((port ## M0 & (1 << port_pin)) == 0 ) ) |
Assert pin in quasy-bidirectional mode. More... | |
#define | is_pin_mode_push_pull(port, port_pin) ( ((port ## M1 & (1 << port_pin)) == 0) && ((port ## M0 & (1 << port_pin)) != 0) ) |
Assert pin in push-pull mode. More... | |
#define | is_pin_mode_input_only(port, port_pin) ( ((port ## M1 & (1 << port_pin)) != 0) && ((port ## M0 & (1 << port_pin)) == 0) ) |
Assert pin in input-only mode. More... | |
#define | is_pin_mode_open_drain(port, port_pin) ( ((port ## M1 & (1 << port_pin)) != 0) && ((port ## M0 & (1 << port_pin)) != 0) ) |
Assert pin in open-drain mode. More... | |
#define | pin_port_quasi_bidiretional_init(port) |
Set quasy-bidirectional mode for all port pins. More... | |
#define | pin_port_pull_push_init(port) |
Set pull-push mode for all port pins. More... | |
#define | pin_port_input_only_init(port) |
Set input-only mode for all port pins. More... | |
#define | pin_port_open_drain_init(port) |
Set open-drain mode for all port pins. More... | |
Pin modes data structures and routines
#define is_pin_mode_input_only | ( | port, | |
port_pin | |||
) | ( ((port ## M1 & (1 << port_pin)) != 0) && ((port ## M0 & (1 << port_pin)) == 0) ) |
Assert pin in input-only mode.
#define is_pin_mode_open_drain | ( | port, | |
port_pin | |||
) | ( ((port ## M1 & (1 << port_pin)) != 0) && ((port ## M0 & (1 << port_pin)) != 0) ) |
Assert pin in open-drain mode.
#define is_pin_mode_push_pull | ( | port, | |
port_pin | |||
) | ( ((port ## M1 & (1 << port_pin)) == 0) && ((port ## M0 & (1 << port_pin)) != 0) ) |
Assert pin in push-pull mode.
#define is_pin_mode_quasi_bidiretional | ( | port, | |
port_pin | |||
) | ( ((port ## M1 & (1 << port_pin)) == 0) && ((port ## M0 & (1 << port_pin)) == 0 ) ) |
Assert pin in quasy-bidirectional mode.
#define pin_input_only_init | ( | port, | |
port_pin | |||
) |
Init pin in in INPUT_ONLY mode.
Input only output have high impedance
Set mode for pin in port. For example for pin P10 call this routine with P1, 0 arguments
port | pin port for example P1, P3 and etc |
port_pin | uint8_t pin mumber in port 0..7 |
#define pin_open_drain_init | ( | port, | |
port_pin | |||
) |
Init pin in in OPEN_DRAIN mode.
internal pull-up resistors should be disabled and external pull-up resistors need to join.
Set mode for pin in port. For example for pin P10 call this routine with P1, 0 arguments
port | pin port for example P1, P3 and etc |
port_pin | uint8_t pin mumber in port 0..7 |
#define pin_port_input_only_init | ( | port | ) |
Set input-only mode for all port pins.
port | pin port for example P1, P3 and etc |
#define pin_port_open_drain_init | ( | port | ) |
Set open-drain mode for all port pins.
port | pin port for example P1, P3 and etc |
#define pin_port_pull_push_init | ( | port | ) |
Set pull-push mode for all port pins.
port | pin port for example P1, P3 and etc |
#define pin_port_quasi_bidiretional_init | ( | port | ) |
Set quasy-bidirectional mode for all port pins.
port | pin port for example P1, P3 and etc |
#define pin_push_pull_init | ( | port, | |
port_pin | |||
) |
Init pin in in PUSH_PULL mode.
Push-pull output(strong pull-up output,current can be up to 20mA, resistors need to be added to restrict current
Set mode for pin in port. For example for pin P10 call this routine with P1, 0 arguments
port | pin port for example P1, P3 and etc |
port_pin | uint8_t pin mumber in port 0..7 |
#define pin_quasi_bidiretional_init | ( | port, | |
port_pin | |||
) |
Init pin in in QUASI_BIDIRECTIONAL mode.
QUASI_BIDIRECTIONAL mode is default pin mode and set after MCU power on
Set mode for pin in port. For example for pin P10 call this routine with P1, 0 arguments
port | pin port for example P1, P3 and etc |
port_pin | uint8_t pin mumber in port 0..7 |