4781582204
* Changed ATmega168 example for ATmega328 on Arduino Uno R3 with DFR0259 RS485 shield. Added ADC interface from BDK port and mapped to some AV objects. Removed MS/TP MAC address DIP switch GPIO and moved MS/TP configuration to AV objects. Added AV units property. Added some Uno R3 Digital Inputs and outputs mapped to some BV. Added AVR EEPROM from BDK port and mapped some non-volatile data including MAC address and max manager and baud rate, device ID and names and description and location.
24 lines
688 B
C
24 lines
688 B
C
/**
|
|
* @brief This module manages effective C bit manipulation for AVR
|
|
* @author Steve Karg <skarg@users.sourceforge.net>
|
|
* @date 2007
|
|
* @copyright SPDX-License-Identifier: MIT
|
|
* @note From AVR035: Efficient C Coding for AVR
|
|
*/
|
|
#ifndef AVR035_H
|
|
#define AVR035_H
|
|
|
|
/* a=register, b=bit number to act upon */
|
|
#define BIT_SET(a, b) ((a) |= (1 << (b)))
|
|
#define BIT_CLEAR(a, b) ((a) &= ~(1 << (b)))
|
|
#define BIT_FLIP(a, b) ((a) ^= (1 << (b)))
|
|
#define BIT_CHECK(a, b) ((a) & (1 << (b)))
|
|
|
|
/* x=target variable, y=mask */
|
|
#define BITMASK_SET(x, y) ((x) |= (y))
|
|
#define BITMASK_CLEAR(x, y) ((x) &= (~(y)))
|
|
#define BITMASK_FLIP(x, y) ((x) ^= (y))
|
|
#define BITMASK_CHECK(x, y) ((x) & (y))
|
|
|
|
#endif
|