STC15W408AS library 0.9.0
Macros
pin.h File Reference
#include <sys.h>
#include <bits.h>
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for pin.h:

Go to the source code of this file.

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