3 * This program is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU General Public License
5 * as published by the Free Software Foundation; either version 2
6 * of the License, or (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #if defined(__cplusplus)
32 typedef enum si24_status_t si24_status_t;
39 typedef enum si24_mode_t si24_mode_t;
46 typedef enum si24_crc_t si24_crc_t;
54 typedef enum si24_speed_t si24_speed_t;
67 typedef enum si24_txpower_t si24_txpower_t;
69 enum si24_event_type_t {
81 typedef enum si24_event_type_t si24_event_type_t;
84 enum si24_event_type_t type;
86 enum si24_event_type_t _type;
94 typedef union si24_event_t si24_event_t;
96 /* low level IO control */
98 int (*write_and_read)(unsigned char *data, size_t sz);
99 void (*chip_enable)(unsigned val);
105 unsigned non_blocking;
107 unsigned enable_dynpd;
111 si24_txpower_t txpwr;
113 unsigned timeout; /* 1: 250 us, 15: 4000 us */
114 unsigned retries; /* 1 to 15 */
115 unsigned char mac_addr[5];
118 /* private data structure */
119 typedef struct si24_t si24_t;
121 typedef void (*si24_event_handler_t)(si24_t* si24, si24_event_t* event);
123 extern si24_t* si24_init(const si24_opts_t* si24opts, si24_event_handler_t eh);
124 extern void si24_free(si24_t* si24);
125 extern size_t si24_send(si24_t* si24, const unsigned char * buf, size_t size);
126 extern size_t si24_recv(si24_t* si24, unsigned char * buf, size_t size);
127 extern void si24_reset(si24_t* si24);
129 #if defined(__cplusplus)