license: update source file and licensing files
[libsi24] / libsi24reg.h
index f357298..7ca2fa6 100644 (file)
@@ -1,9 +1,19 @@
-/**
- * File              : libsi24reg.h
- * Author            : Robin Krens <robin@robinkrens.nl>
- * Date              : 18.01.2023
- * Last Modified Date: 22.01.2023
- * Last Modified By  : Robin Krens <robin@robinkrens.nl>
+/* Copyright (C) 
+ * 2023 - Robin Krens
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ * 
  */
 
 /* SI24R1 commands */
@@ -74,7 +84,7 @@
 #define AW_4 0x2
 #define AW_5 0x3
 
-#define ARD(x) ((x << 3) & 0xF0)
+#define ARD(x) (x << 4)
 #define ARC(x) (x & 0xF)
 
 #define RF_CH 0x0
 #define EN_DYN_ACK 0x0
 #define EN_ACK_PAY 0x1
 #define EN_DPL 0x2
-
-typedef struct {
-       union {
-               unsigned char byte;
-               struct {
-                       unsigned _RESERVED:1;
-                       unsigned RX_DR:1;
-                       unsigned TX_DS:1;
-                       unsigned MAX_RT:1;
-                       unsigned RX_P_NO:3;
-                       unsigned TX_FULL:1;
-               } bits;
-       };
-} si24_status_reg_t;
-
-
+                       
+#define TX_FULL 0x0
+#define RX_P_NO 0x1
+#define MAX_RT 0x4
+#define TX_DS 0x5
+#define RX_DR 0x6