2 * Copyright (C) 2012-2013 Jiří Šimek
3 * Copyright (C) 2013 Zbyněk Křivka <krivka@fit.vutbr.cz>
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
23 #ifndef REGPBLAZE_HEADER
24 #define REGPBLAZE_HEADER
28 #define REGISTER_BANK_A 0x01
29 #define REGISTER_BANK_B 0x02
31 #define FLAGS_GET(bit_position) (sfr->get(FLAGS) & bit_position)
32 #define FLAGS_GET_C (sfr->get(FLAGS) & bmC)
33 #define FLAGS_GET_Z (sfr->get(FLAGS) & bmZ)
34 #define FLAGS_GET_I (sfr->get(FLAGS) & bmI)
36 #define FLAGS_SET(flag_value, bit_position) \
38 sfr->set_bit1(FLAGS, bit_position); \
40 sfr->set_bit0(FLAGS, bit_position);
42 #define FLAGS_SET(flag_value, bit_position) \
44 sfr->write(FLAGS, sfr->read(FLAGS) | bit_position); \
46 sfr->write(FLAGS, sfr->read(FLAGS) & ~bit_position);
47 #define FLAGS_SET_C(flag_value) FLAGS_SET(flag_value, bmC)
48 #define FLAGS_SET_Z(flag_value) FLAGS_SET(flag_value, bmZ)
49 #define FLAGS_SET_I(flag_value) FLAGS_SET(flag_value, bmI)
89 // bit position of each flag in FLAGS register
96 /* Emd of pblaze.src/regspblaze.h */