|
| #define | MAKE_PORT_NAME(_p) |
| | Make PORTx register by by port letter.
|
| |
| #define | MAKE_DDR_NAME(_p) |
| | Make DDRx register by by port letter.
|
| |
| #define | MAKE_PIN_NAME(_p) |
| | Make PINx register by by port letter.
|
| |
| #define | MAKE_MASK_x0 0x00 |
| | No pins selected.
|
| |
| #define | MAKE_MASK_x1 _BV |
| | Creates a port mask from a single pin bit.
|
| |
| #define | MAKE_MASK_x2(_b1, _b2) |
| | Creates a port mask from two pin bits.
|
| |
| #define | MAKE_MASK_x3(_b1, _b2, _b3) |
| | Creates a port mask using three pin bits.
|
| |
| #define | MAKE_MASK_x4(_b1, _b2, _b3, _b4) |
| | Creates a port mask from four pin bits.
|
| |
| #define | MAKE_MASK_x5(_b1, _b2, _b3, _b4, _b5) |
| | Creates a port mask from five pin bits.
|
| |
| #define | MAKE_MASK_x6(_b1, _b2, _b3, _b4, _b5, _b6) |
| | Creates a port mask from six pin bits.
|
| |
| #define | MAKE_MASK_x7(_b1, _b2, _b3, _b4, _b5, _b6, _b7) |
| | Creates a port mask from seven pin bits.
|
| |
| #define | MAKE_MASK_x8 0xFF |
| | All port pins(entire port).
|
| |
| #define | gpio_init(_ddr, _val) |
| | Writes the specified value to the DDRx register.
|
| |
| #define | GPIO_INIT(_p, _val) |
| | A wrapper for short register naming for gpio_init()
|
| |
| #define | gpio_set(_port, _val) |
| | Writes the specified value to the PORTx register.
|
| |
| #define | GPIO_SET(_p, _val) |
| | A wrapper for short register naming for gpio_set()
|
| |
| #define | gpio_switch(_port) |
| | Inverts the bits in a PORTx register.
|
| |
| #define | GPIO_SWITCH(_p) |
| | A wrapper for short register naming for gpio_switch()
|
| |
| #define | gpio_byte(_pin) |
| | Returns PINx register.
|
| |
| #define | GPIO_BYTE(_p) |
| | A wrapper for short register naming for gpio_byte()
|
| |
| #define | gpio_set_in(_ddr) |
| | Sets a entire port to input state.
|
| |
| #define | GPIO_SET_IN(_p) |
| | A wrapper for short register naming for gpio_set_in()
|
| |
| #define | gpio_set_in_z(_ddr, _port) |
| | Sets a entire port to high Z input state.
|
| |
| #define | GPIO_SET_IN_Z(_p) |
| | A wrapper for short register naming for gpio_set_in_z()
|
| |
| #define | gpio_set_in_pu(_ddr, _port) |
| | Sets a entire port to input state with use internal pull-up resistor.
|
| |
| #define | GPIO_SET_IN_PU(_p) |
| | A wrapper for short register naming for gpio_set_in_pu()
|
| |
| #define | gpio_set_out(_ddr) |
| | Sets a entire port to output state.
|
| |
| #define | GPIO_SET_OUT(_p) |
| | A wrapper for short register naming for gpio_set_out()
|
| |
| #define | gpio_set_out_d_lo(_ddr, _port) |
| | Sets port out driving low.
|
| |
| #define | GPIO_SET_OUT_D_LO(_p) |
| | A wrapper for short register naming for gpio_set_out_d_lo()
|
| |
| #define | gpio_set_out_d_hi(_ddr, _port) |
| | Sets port out driving hi.
|
| |
| #define | GPIO_SET_OUT_D_HI(_p) |
| | A wrapper for short register naming for gpio_set_out_d_hi()
|
| |
| #define | gpio_set_hi(_port) |
| | Sets entire PORTx register to high state.
|
| |
| #define | GPIO_SET_HI(_p) |
| | A wrapper for short register naming for gpio_set_hi()
|
| |
| #define | gpio_set_lo(_port) |
| | Sets entire PORTx register to low state.
|
| |
| #define | GPIO_SET_LO(_p) |
| | A wrapper for short register naming for gpio_set_lo()
|
| |
| #define | gpio_read gpio_byte |
| | The meaningful name alias for gpio_byte.
|
| |
| #define | GPIO_READ GPIO_BYTE |
| | The meaningful name alias for GPIO_BYTE.
|
| |
| #define | read_byte gpio_byte |
| | The meaningful name alias for gpio_byte.
|
| |
| #define | READ_BYTE GPIO_BYTE |
| | The meaningful name alias for GPIO_BYTE.
|
| |
| #define | gpio_to_read gpio_set_in |
| | The meaningful name alias for gpio_set_in.
|
| |
| #define | GPIO_TO_READ GPIO_SET_IN |
| | The meaningful name alias for GPIO_SET_IN.
|
| |
| #define | gpio_to_read_z gpio_set_in_z |
| | The meaningful name alias for gpio_set_in_z.
|
| |
| #define | GPIO_TO_READ_Z GPIO_SET_IN_Z |
| | The meaningful name alias for GPIO_SET_IN_Z.
|
| |
| #define | gpio_to_read_pu gpio_set_in_pu |
| | The meaningful name alias for gpio_set_in_pu.
|
| |
| #define | GPIO_TO_READ_PU GPIO_SET_IN_PU |
| | The meaningful name alias for GPIO_SET_IN_PU.
|
| |
| #define | gpio_pull_up gpio_set_hi |
| | The meaningful name alias for gpio_set_hi.
|
| |
| #define | GPIO_PULL_UP GPIO_SET_HI |
| | The meaningful name alias for GPIO_SET_HI.
|
| |
| #define | gpio_to_write gpio_set_out |
| | The meaningful name alias for gpio_set_out.
|
| |
| #define | GPIO_TO_WRITE GPIO_SET_OUT |
| | The meaningful name alias for GPIO_SET_OUT.
|
| |
| #define | gpio_to_write_d_lo gpio_set_out_d_lo |
| | The meaningful name alias for gpio_set_out_d_lo.
|
| |
| #define | GPIO_TO_WRITE_D_LO GPIO_SET_OUT_D_LO |
| | The meaningful name alias for GPIO_SET_OUT_D_LO.
|
| |
| #define | gpio_to_write_d_hi gpio_set_out_d_hi |
| | The meaningful name alias for gpio_set_out_d_hi.
|
| |
| #define | GPIO_TO_WRITE_D_HI GPIO_SET_OUT_D_HI |
| | The meaningful name alias for GPIO_SET_OUT_D_HI.
|
| |
| #define | gpio_write gpio_set |
| | The meaningful name alias for gpio_set.
|
| |
| #define | GPIO_WRITE GPIO_SET |
| | The meaningful name alias for GPIO_SET.
|
| |
| #define | write_byte gpio_set |
| | The meaningful name alias for gpio_set.
|
| |
| #define | WRITE_BYTE GPIO_SET |
| | The meaningful name alias for GPIO_SET.
|
| |
| #define | port_set_in(_ddr, _pinset) |
| |
| #define | PORT_SET_IN(_p, _pinset) |
| |
| #define | port_set_out(_ddr, _pinset) |
| |
| #define | PORT_SET_OUT(_p, _pinset) |
| |
| #define | port_set(_port, _pinset) |
| |
| #define | PORT_SET(_p, _pinset) |
| |
| #define | port_clear(_port, _pinset) |
| |
| #define | PORT_CLEAR(_p, _pinset) |
| |
| #define | port_switch(_port, _pinset) |
| |
| #define | PORT_SWITCH(_p, _pinset) |
| |
| #define | port_replace(_port, _pinset, _val) |
| |
| #define | PORT_REPLACE(_p, _pinset, _val) |
| |
| #define | port_read(_pin, _pinset) |
| |
| #define | PORT_READ(_p, _pinset) |
| |
| #define | port_set_in_z(_ddr, _port, _pinset) |
| |
| #define | PORT_SET_IN_Z(_p, _pinset) |
| |
| #define | port_set_in_pu(_ddr, _port, _pinset) |
| |
| #define | PORT_SET_IN_PU(_p, _pinset) |
| |
| #define | port_set_out_d_lo(_ddr, _port, _pinset) |
| |
| #define | PORT_SET_OUT_D_LO(_p, _pinset) |
| |
| #define | port_set_out_d_hi(_ddr, _port, _pinset) |
| |
| #define | PORT_SET_OUT_D_HI(_p, _pinset) |
| |
| #define | port_set_hi port_set |
| |
| #define | PORT_SET_HI PORT_SET |
| |
| #define | port_pull_up port_set |
| |
| #define | PORT_PULL_UP PORT_SET |
| |
| #define | port_set_lo port_clear |
| |
| #define | PORT_SET_LO PORT_CLEAR |
| |
| #define | port_to_read port_set_in |
| |
| #define | PORT_TO_READ PORT_SET_IN |
| |
| #define | port_to_read_pu port_set_in_pu |
| |
| #define | PORT_TO_READ_PU PORT_SET_IN_PU |
| |
| #define | port_to_read_z port_set_in_z |
| |
| #define | PORT_TO_READ_Z PORT_SET_IN_Z |
| |
| #define | port_to_write port_set_out |
| |
| #define | PORT_TO_WRITE PORT_SET_OUT |
| |
| #define | port_write port_replace |
| |
| #define | PORT_WRITE PORT_REPLACE |
| |
| #define | port_to_write_d_lo port_set_out_d_lo |
| |
| #define | PORT_TO_WRITE_D_LO PORT_SET_OUT_D_LO |
| |
| #define | port_to_write_d_hi port_set_out_d_hi |
| |
| #define | PORT_TO_WRITE_D_HI PORT_SET_OUT_D_HI |
| |
| #define | NIBBLE_LO_PINSET 0x0F |
| | The lower nibble port mask.
|
| |
| #define | nibble_lo_set_in(_ddr) |
| |
| #define | NIBBLE_LO_SET_IN(_p) |
| |
| #define | nibble_lo_set_out(_ddr) |
| |
| #define | NIBBLE_LO_SET_OUT(_p) |
| |
| #define | nibble_lo_set(_port) |
| |
| #define | NIBBLE_LO_SET(_p) |
| |
| #define | nibble_lo_clear(_port) |
| |
| #define | NIBBLE_LO_CLEAR(_p) |
| |
| #define | nibble_lo_switch(_port) |
| |
| #define | NIBBLE_LO_SWITCH(_p) |
| |
| #define | nibble_lo_replace(_port, _val) |
| |
| #define | NIBBLE_LO_REPLACE(_p, _val) |
| |
| #define | nibble_lo_read(_pin) |
| |
| #define | NIBBLE_LO_READ(_p) |
| |
| #define | nibble_lo_set_in_z(_ddr, _port) |
| |
| #define | NIBBLE_LO_SET_IN_Z(_p) |
| |
| #define | nibble_lo_set_in_pu(_ddr, _port) |
| |
| #define | NIBBLE_LO_SET_IN_PU(_p) |
| |
| #define | nibble_lo_set_out_d_lo(_ddr, _port) |
| |
| #define | NIBBLE_LO_SET_OUT_D_LO(_p) |
| |
| #define | nibble_lo_set_out_d_hi(_ddr, _port) |
| |
| #define | NIBBLE_LO_SET_OUT_D_HI(_p) |
| |
| #define | nibble_lo_set_hi nibble_lo_set |
| |
| #define | NIBBLE_LO_SET_HI NIBBLE_LO_SET |
| |
| #define | nibble_lo_pull_up nibble_lo_set |
| |
| #define | NIBBLE_LO_PULL_UP NIBBLE_LO_SET |
| |
| #define | nibble_lo_set_lo nibble_lo_clear |
| |
| #define | NIBBLE_LO_SET_LO NIBBLE_LO_CLEAR |
| |
| #define | nibble_lo_to_read nibble_lo_set_in |
| |
| #define | NIBBLE_LO_TO_READ NIBBLE_LO_SET_IN |
| |
| #define | nibble_lo_to_read_pu nibble_lo_set_in_pu |
| |
| #define | NIBBLE_LO_TO_READ_PU NIBBLE_LO_SET_IN_PU |
| |
| #define | nibble_lo_to_read_z nibble_lo_set_in_z |
| |
| #define | NIBBLE_LO_TO_READ_Z NIBBLE_LO_SET_IN_Z |
| |
| #define | nibble_lo_to_write nibble_lo_set_out |
| |
| #define | NIBBLE_LO_TO_WRITE NIBBLE_LO_SET_OUT |
| |
| #define | nibble_lo_write nibble_lo_replace |
| |
| #define | NIBBLE_LO_WRITE NIBBLE_LO_REPLACE |
| |
| #define | nibble_lo_to_write_d_lo nibble_lo_set_out_d_lo |
| |
| #define | NIBBLE_LO_TO_WRITE_D_LO NIBBLE_LO_SET_OUT_D_LO |
| |
| #define | nibble_lo_to_write_d_hi nibble_lo_set_out_d_hi |
| |
| #define | NIBBLE_LO_TO_WRITE_D_HI NIBBLE_LO_SET_OUT_D_HI |
| |
| #define | NIBBLE_UP_PINSET 0xF0 |
| | The upper nibble port mask.
|
| |
| #define | nibble_up_set_in(_ddr) |
| |
| #define | NIBBLE_UP_SET_IN(_p) |
| |
| #define | nibble_up_set_out(_ddr) |
| |
| #define | NIBBLE_UP_SET_OUT(_p) |
| |
| #define | nibble_up_set(_port) |
| |
| #define | NIBBLE_UP_SET(_p) |
| |
| #define | nibble_up_clear(_port) |
| |
| #define | NIBBLE_UP_CLEAR(_p) |
| |
| #define | nibble_up_switch(_port) |
| |
| #define | NIBBLE_UP_SWITCH(_p) |
| |
| #define | nibble_up_replace(_port, _val) |
| |
| #define | NIBBLE_UP_REPLACE(_p, _val) |
| |
| #define | nibble_up_read(_pin) |
| |
| #define | NIBBLE_UP_READ(_p) |
| |
| #define | nibble_up_set_in_z(_ddr, _port) |
| |
| #define | NIBBLE_UP_SET_IN_Z(_p) |
| |
| #define | nibble_up_set_in_pu(_ddr, _port) |
| |
| #define | NIBBLE_UP_SET_IN_PU(_p) |
| |
| #define | nibble_up_set_out_d_lo(_ddr, _port) |
| |
| #define | NIBBLE_UP_SET_OUT_D_LO(_p) |
| |
| #define | nibble_up_set_out_d_hi(_ddr, _port) |
| |
| #define | NIBBLE_UP_SET_OUT_D_HI(_p) |
| |
| #define | nibble_up_set_hi nibble_up_set |
| |
| #define | NIBBLE_UP_SET_HI NIBBLE_UP_SET |
| |
| #define | nibble_up_pull_up nibble_up_set |
| |
| #define | NIBBLE_UP_PULL_UP NIBBLE_UP_SET |
| |
| #define | nibble_up_set_lo nibble_up_clear |
| |
| #define | NIBBLE_UP_SET_LO NIBBLE_UP_CLEAR |
| |
| #define | nibble_up_to_read nibble_up_set_in |
| |
| #define | NIBBLE_UP_TO_READ NIBBLE_UP_SET_IN |
| |
| #define | nibble_up_to_read_pu nibble_up_set_in_pu |
| |
| #define | NIBBLE_UP_TO_READ_PU NIBBLE_UP_SET_IN_PU |
| |
| #define | nibble_up_to_read_z nibble_up_set_in_z |
| |
| #define | NIBBLE_UP_TO_READ_Z NIBBLE_UP_SET_IN_Z |
| |
| #define | nibble_up_to_write nibble_up_set_out |
| |
| #define | NIBBLE_UP_TO_WRITE NIBBLE_UP_SET_OUT |
| |
| #define | nibble_up_write nibble_up_replace |
| |
| #define | NIBBLE_UP_WRITE NIBBLE_UP_REPLACE |
| |
| #define | nibble_up_to_write_d_lo nibble_up_set_out_d_lo |
| |
| #define | NIBBLE_UP_TO_WRITE_D_LO NIBBLE_UP_SET_OUT_D_LO |
| |
| #define | nibble_up_to_write_d_hi nibble_up_set_out_d_hi |
| |
| #define | NIBBLE_UP_TO_WRITE_D_HI NIBBLE_UP_SET_OUT_D_HI |
| |
| #define | pin_set_in(_ddr, _b) |
| |
| #define | PIN_SET_IN(_p, _b) |
| |
| #define | pin_set_out(_ddr, _b) |
| |
| #define | PIN_SET_OUT(_p, _b) |
| |
| #define | pin_set(_port, _b) |
| |
| #define | PIN_SET(_p, _b) |
| |
| #define | pin_clear(_port, _b) |
| |
| #define | PIN_CLEAR(_p, _b) |
| |
| #define | pin_switch(_port, _b) |
| |
| #define | PIN_SWITCH(_p, _b) |
| |
| #define | pin_replace(_port, _b, _val) |
| |
| #define | PIN_REPLACE(_p, _b, _val) |
| |
| #define | pin_read(_pin, _b) |
| |
| #define | PIN_READ(_p, _b) |
| |
| #define | pin_set_in_z(_ddr, _port, _b) |
| |
| #define | PIN_SET_IN_Z(_p, _b) |
| |
| #define | pin_set_in_pu(_ddr, _port, _b) |
| |
| #define | PIN_SET_IN_PU(_p, _b) |
| |
| #define | pin_set_out_d_lo(_ddr, _port, _b) |
| |
| #define | PIN_SET_OUT_D_LO(_p, _b) |
| |
| #define | pin_set_out_d_hi(_ddr, _port, _b) |
| |
| #define | PIN_SET_OUT_D_HI(_p, _b) |
| |
| #define | pin_set_hi pin_set |
| |
| #define | PIN_SET_HI PIN_SET |
| |
| #define | pin_on pin_set |
| |
| #define | PIN_ON PIN_SET |
| |
| #define | pin_pull_up pin_set |
| |
| #define | PIN_PULL_UP PIN_SET |
| |
| #define | pin_set_lo pin_clear |
| |
| #define | PIN_SET_LO PIN_CLEAR |
| |
| #define | pin_off pin_clear |
| |
| #define | PIN_OFF PIN_CLEAR |
| |
| #define | pin_to_read pin_set_in |
| |
| #define | PIN_TO_READ PIN_SET_IN |
| |
| #define | pin_to_read_pu pin_set_in_pu |
| |
| #define | PIN_TO_READ_PU PIN_SET_IN_PU |
| |
| #define | pin_to_read_z pin_set_in_z |
| |
| #define | PIN_TO_READ_Z PIN_SET_IN_Z |
| |
| #define | pin_to_write pin_set_out |
| |
| #define | PIN_TO_WRITE PIN_SET_OUT |
| |
| #define | pin_write pin_replace |
| |
| #define | PIN_WRITE PIN_REPLACE |
| |
| #define | pin_to_write_d_lo pin_set_out_d_lo |
| |
| #define | PIN_TO_WRITE_D_LO PIN_SET_OUT_D_LO |
| |
| #define | pin_to_write_d_hi pin_set_out_d_hi |
| |
| #define | PIN_TO_WRITE_D_HI PIN_SET_OUT_D_HI |
| |
AVR port register helpers.
- Author
- Simon Litt simon.nosp@m.@1it.nosp@m.t.net https://coding.1itt.net, https://github.com/SimonLitt
- Copyright
- GNU General Public License v3.0
Function naming convention:
gpio_xxx(GPIO_XXX) - the entire port
port_xxx(PORT_XXX) - the port pin set
nibble_lo_xxx(NIBBLE_LO_XXX) - the lower nibble pin set
nibble_up_xxx(NIBBLE_HI_XXX) - the upper nibble pin set
pin_xxx(PIN_XXX) - the distinct pin
Parameters naming convention:
_ddr - AVR Data Direction Register
_port - AVR PORTx Register
_pin - AVR PINx Register
_p - the port name (single char). For example С for DDRC, PORTC or for PINC
_b - the port bit as numder from 0 to 7 or as definded macro e.g. PC3
_pinset - the port bit set
_val - the transmitted value
int main(void) {
...
...
}
#define PIN_TO_READ
Definition gpio.h:497
#define GPIO_SET_OUT_D_HI(_p)
A wrapper for short register naming for gpio_set_out_d_hi()
Definition gpio.h:183
#define GPIO_SET(_p, _val)
A wrapper for short register naming for gpio_set()
Definition gpio.h:124
#define PORT_SET(_p, _pinset)
Definition gpio.h:247
int main(void) {
...
...
}
#define pin_to_read
Definition gpio.h:496
#define port_set(_port, _pinset)
Definition gpio.h:246
#define gpio_set_out_d_hi(_ddr, _port)
Sets port out driving hi.
Definition gpio.h:182
#define gpio_set(_port, _val)
Writes the specified value to the PORTx register.
Definition gpio.h:123