-/**
- * File : libsi24.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.
+ *
*/
-
#include <stddef.h>
#if defined(__cplusplus)
typedef enum si24_mode_t si24_mode_t;
enum si24_crc_t {
- ONE_BYTE = 1,
- TWO_BYTE = 2
+ ONE_BYTE = 0,
+ TWO_BYTE = 1
};
typedef enum si24_crc_t si24_crc_t;
EV_RX_COMPLETE = 0,
EV_TX_COMPLETE,
EV_TX_FULL,
+ EV_RX_EMPTY,
EV_ERR_TIMEOUT,
EV_ERR_BUS,
EV_ERR_MAX_RETRIES,
/* low level IO control */
typedef struct {
int (*write_and_read)(unsigned char *data, size_t sz);
- int (*chip_enable)(unsigned val);
+ void (*chip_enable)(unsigned val);
} si24_ioctl_t;
typedef struct {
unsigned payload;
unsigned timeout; /* 1: 250 us, 15: 4000 us */
unsigned retries; /* 1 to 15 */
- unsigned mac_addr;
+ unsigned char mac_addr[5];
} si24_opts_t;
/* private data structure */