From 6263ed441f45d636d9a66f94e0bc30eaca13459f Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 6 Mar 2008 23:32:31 +0100 Subject: * digital/avr/modules/twi: - avrconfig cleanup. --- digital/asserv/src/asserv/avrconfig.h | 15 +++-- digital/asserv/src/asserv/twi_proto.c | 4 +- digital/avr/modules/twi/Makefile.module | 2 +- digital/avr/modules/twi/README | 2 +- digital/avr/modules/twi/avrconfig.h | 13 ++++- digital/avr/modules/twi/test/Makefile | 13 +++-- digital/avr/modules/twi/test/avrconfig_master.h | 21 ++++--- digital/avr/modules/twi/test/avrconfig_slave.h | 21 ++++--- digital/avr/modules/twi/test/test_twi_master.c | 3 +- digital/avr/modules/twi/test/test_twi_sl.c | 6 +- digital/avr/modules/twi/twi.avr.c | 76 +++++++++++++----------- digital/avr/modules/twi/twi.c | 33 ----------- digital/avr/modules/twi/twi.h | 10 ++-- digital/avr/modules/twi/twi.host.c | 77 +++++++++++++++++++++++++ 14 files changed, 188 insertions(+), 108 deletions(-) delete mode 100644 digital/avr/modules/twi/twi.c create mode 100644 digital/avr/modules/twi/twi.host.c diff --git a/digital/asserv/src/asserv/avrconfig.h b/digital/asserv/src/asserv/avrconfig.h index f8ced464..984eeef2 100644 --- a/digital/asserv/src/asserv/avrconfig.h +++ b/digital/asserv/src/asserv/avrconfig.h @@ -87,10 +87,17 @@ /** Use external counters. */ #define AC_ASSERV_COUNTER_EXTERNAL 1 /** TWI address. */ -#define AV_ASSERV_TWI_ADDRESS 4 +#define AC_ASSERV_TWI_ADDRESS 4 + +/* twi - TWI module. */ +/** Activate master part. */ +#define AC_TWI_MASTER_ENABLE 0 +/** Activate slave part. */ +#define AC_TWI_SLAVE_ENABLE 1 +/** Slave recv buffer size. */ +#define AC_TWI_SL_RECV_BUFFER_SIZE 16 +/** Slave send buffer size. */ +#define AC_TWI_SL_SEND_BUFFER_SIZE 16 -#define TWI_SLAVE_ENABLE 1 -#define TWI_SL_RCPT_SIZE 16 -#define TWI_SL_SEND_SIZE 16 #endif /* avrconfig_h */ diff --git a/digital/asserv/src/asserv/twi_proto.c b/digital/asserv/src/asserv/twi_proto.c index aa5c9fad..a87db2cf 100644 --- a/digital/asserv/src/asserv/twi_proto.c +++ b/digital/asserv/src/asserv/twi_proto.c @@ -39,7 +39,7 @@ struct twi_proto_t twi_proto; void twi_proto_init (void) { - twi_init (AV_ASSERV_TWI_ADDRESS); + twi_init (AC_ASSERV_TWI_ADDRESS); twi_proto_update (); } @@ -47,7 +47,7 @@ twi_proto_init (void) void twi_proto_update (void) { - u8 buf[TWI_SL_RCPT_SIZE]; + u8 buf[AC_TWI_SL_RECV_BUFFER_SIZE]; /* Handle incoming command. */ while (twi_sl_poll (buf, sizeof (buf))) twi_proto_callback (buf, sizeof (buf)); diff --git a/digital/avr/modules/twi/Makefile.module b/digital/avr/modules/twi/Makefile.module index 422cc96e..e9bfa070 100644 --- a/digital/avr/modules/twi/Makefile.module +++ b/digital/avr/modules/twi/Makefile.module @@ -1 +1 @@ -twi_SOURCES = twi.c +twi_SOURCES = twi.avr.c twi.host.c diff --git a/digital/avr/modules/twi/README b/digital/avr/modules/twi/README index 8fd9677a..c588816d 100644 --- a/digital/avr/modules/twi/README +++ b/digital/avr/modules/twi/README @@ -1,6 +1,6 @@ avr.twi - TWI AVR module. -Twi module for AVR. +TWI module for AVR. Copyright (C) 2005 Demonchy Clément diff --git a/digital/avr/modules/twi/avrconfig.h b/digital/avr/modules/twi/avrconfig.h index 139aa55e..5f94ecd1 100644 --- a/digital/avr/modules/twi/avrconfig.h +++ b/digital/avr/modules/twi/avrconfig.h @@ -1,6 +1,6 @@ #ifndef avrconfig_h #define avrconfig_h -/* avrconfig.h */ +/* avrconfig.h - TWI module configuration template. */ /* avr.twi - TWI AVR module. {{{ * * Copyright (C) 2005 Demonchy Clément @@ -25,7 +25,14 @@ * * }}} */ -#define TWI_SL_RCPT_SIZE 16 -#define TWI_SL_SEND_SIZE 16 +/* twi - TWI module. */ +/** Activate master part. */ +#define AC_TWI_MASTER_ENABLE 0 +/** Activate slave part. */ +#define AC_TWI_SLAVE_ENABLE 0 +/** Slave recv buffer size. */ +#define AC_TWI_SL_RECV_BUFFER_SIZE 16 +/** Slave send buffer size. */ +#define AC_TWI_SL_SEND_BUFFER_SIZE 16 #endif /* avrconfig_h */ diff --git a/digital/avr/modules/twi/test/Makefile b/digital/avr/modules/twi/test/Makefile index a5ba612e..1af68de3 100644 --- a/digital/avr/modules/twi/test/Makefile +++ b/digital/avr/modules/twi/test/Makefile @@ -2,10 +2,7 @@ # It is required to clean before building each program because they share the # same object with different defines. # Files are copied in *.keep.hex. -all: - # General cleaning - $(MAKE) -f Makefile.slave clean - $(MAKE) -f Makefile.master clean +all: subclean # Slave $(MAKE) -f Makefile.slave cp test_twi_sl.hex test_twi_sl.keep.hex @@ -14,3 +11,11 @@ all: $(MAKE) -f Makefile.master cp test_twi_master.hex test_twi_master.keep.hex $(MAKE) -f Makefile.master clean + +subclean: + # General cleaning + $(MAKE) -f Makefile.slave clean + $(MAKE) -f Makefile.master clean + +clean: subclean + rm -f test_twi_master.keep.hex test_twi_sl.keep.hex diff --git a/digital/avr/modules/twi/test/avrconfig_master.h b/digital/avr/modules/twi/test/avrconfig_master.h index bc070738..16becdcf 100644 --- a/digital/avr/modules/twi/test/avrconfig_master.h +++ b/digital/avr/modules/twi/test/avrconfig_master.h @@ -25,10 +25,20 @@ * * }}} */ -#define TWI_SL_RCPT_SIZE 1 -#define TWI_SL_SEND_SIZE 1 +/* global */ +/** AVR Frequency : 1000000, 1843200, 2000000, 3686400, 4000000, 7372800, + * 8000000, 11059200, 14745600, 16000000, 18432000, 20000000. */ +#define AC_FREQ 14745600 -#define TWI_MASTER_ENABLE 1 +/* twi - TWI module. */ +/** Activate master part. */ +#define AC_TWI_MASTER_ENABLE 1 +/** Activate slave part. */ +#define AC_TWI_SLAVE_ENABLE 0 +/** Slave recv buffer size. */ +#define AC_TWI_SL_RECV_BUFFER_SIZE 1 +/** Slave send buffer size. */ +#define AC_TWI_SL_SEND_BUFFER_SIZE 1 /* proto - Protocol module. */ /** Maximum argument size. */ @@ -40,11 +50,6 @@ /** Support for quote parameter. */ #define AC_PROTO_QUOTE 1 -/* global */ -/** AVR Frequency : 1000000, 1843200, 2000000, 3686400, 4000000, 7372800, - * 8000000, 11059200, 14745600, 16000000, 18432000, 20000000. */ -#define AC_FREQ 14745600 - /* uart - UART module. */ /** Select hardware uart for primary uart: 0, 1 or -1 to disable. */ #define AC_UART0_PORT 1 diff --git a/digital/avr/modules/twi/test/avrconfig_slave.h b/digital/avr/modules/twi/test/avrconfig_slave.h index 9cbfd33b..394c5937 100644 --- a/digital/avr/modules/twi/test/avrconfig_slave.h +++ b/digital/avr/modules/twi/test/avrconfig_slave.h @@ -25,10 +25,20 @@ * * }}} */ -#define TWI_SL_RCPT_SIZE 1 -#define TWI_SL_SEND_SIZE 1 +/* global */ +/** AVR Frequency : 1000000, 1843200, 2000000, 3686400, 4000000, 7372800, + * 8000000, 11059200, 14745600, 16000000, 18432000, 20000000. */ +#define AC_FREQ 14745600 -#define TWI_SLAVE_ENABLE 1 +/* twi - TWI module. */ +/** Activate master part. */ +#define AC_TWI_MASTER_ENABLE 0 +/** Activate slave part. */ +#define AC_TWI_SLAVE_ENABLE 1 +/** Slave recv buffer size. */ +#define AC_TWI_SL_RECV_BUFFER_SIZE 1 +/** Slave send buffer size. */ +#define AC_TWI_SL_SEND_BUFFER_SIZE 1 /* proto - Protocol module. */ /** Maximum argument size. */ @@ -40,11 +50,6 @@ /** Support for quote parameter. */ #define AC_PROTO_QUOTE 1 -/* global */ -/** AVR Frequency : 1000000, 1843200, 2000000, 3686400, 4000000, 7372800, - * 8000000, 11059200, 14745600, 16000000, 18432000, 20000000. */ -#define AC_FREQ 14745600 - /* uart - UART module. */ /** Select hardware uart for primary uart: 0, 1 or -1 to disable. */ #define AC_UART0_PORT 1 diff --git a/digital/avr/modules/twi/test/test_twi_master.c b/digital/avr/modules/twi/test/test_twi_master.c index a3301e9a..85b48686 100644 --- a/digital/avr/modules/twi/test/test_twi_master.c +++ b/digital/avr/modules/twi/test/test_twi_master.c @@ -80,7 +80,8 @@ proto_callback (uint8_t cmd, uint8_t size, uint8_t *args) while (compt-- != 0) { /* Maximum number of bytes of the message */ - static const uint8_t max_byte_number = TWI_SL_SEND_SIZE; + static const uint8_t max_byte_number = + AC_TWI_SL_RECV_BUFFER_SIZE; /* Get a random number */ uint32_t random = random_u32 (); /* Extract a number under max_byte_number */ diff --git a/digital/avr/modules/twi/test/test_twi_sl.c b/digital/avr/modules/twi/test/test_twi_sl.c index b6cbc050..020c9e6b 100644 --- a/digital/avr/modules/twi/test/test_twi_sl.c +++ b/digital/avr/modules/twi/test/test_twi_sl.c @@ -65,13 +65,13 @@ main (void) proto_send0 ('S'); while (42) { - uint8_t data[TWI_SL_RCPT_SIZE]; + uint8_t data[AC_TWI_SL_RECV_BUFFER_SIZE]; data[0] = 0; /* Check for data */ - if (twi_sl_poll (data, TWI_SL_RCPT_SIZE)) + if (twi_sl_poll (data, AC_TWI_SL_RECV_BUFFER_SIZE)) { /* Receive and store them */ - twi_sl_update (data, TWI_SL_RCPT_SIZE); + twi_sl_update (data, AC_TWI_SL_RECV_BUFFER_SIZE); } if (uart0_poll ()) proto_accept (uart0_getc ()); diff --git a/digital/avr/modules/twi/twi.avr.c b/digital/avr/modules/twi/twi.avr.c index 3b2a8e66..3452b36f 100644 --- a/digital/avr/modules/twi/twi.avr.c +++ b/digital/avr/modules/twi/twi.avr.c @@ -22,10 +22,18 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * }}} */ - +#include "common.h" #include "twi.h" +#include "io.h" + +#if !AC_TWI_MASTER_ENABLE && !AC_TWI_SLAVE_ENABLE +# error "twi: you should enable at least master or slave code" +#endif + +#if AC_TWI_MASTER_ENABLE && AC_TWI_SLAVE_ENABLE +# error "twi: multi-master not implemented" +#endif -#include #include // #include "modules/uart/uart.h" @@ -41,30 +49,30 @@ enum TWI_FAILURE }; -#ifdef TWI_SLAVE_ENABLE +#if AC_TWI_SLAVE_ENABLE /* données reçues du master */ -static volatile uint8_t rcpt_buf_sl[TWI_SL_RCPT_SIZE]; +static volatile uint8_t rcpt_buf_sl[AC_TWI_SL_RECV_BUFFER_SIZE]; static volatile uint8_t data_ready_sl; /* données à envoyer au master */ /* 2 buffers 1 pour envoyer vers l'user et l'autre vers l'i2c */ -static volatile uint8_t send_buf_sl1[TWI_SL_SEND_SIZE]; -static volatile uint8_t send_buf_sl2[TWI_SL_SEND_SIZE]; +static volatile uint8_t send_buf_sl1[AC_TWI_SL_SEND_BUFFER_SIZE]; +static volatile uint8_t send_buf_sl2[AC_TWI_SL_SEND_BUFFER_SIZE]; static volatile uint8_t *send_sys_sl, *send_user_sl; static volatile uint8_t update_sl; /* lock pour savoir si on peut switcher les buffers sans risque */ static volatile uint8_t send_switch_sl; -#endif /* TWI_SLAVE_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#endif /* AC_TWI_SLAVE_ENABLE */ +#if AC_TWI_MASTER_ENABLE static volatile int8_t state_ms; static volatile int8_t nb_retry_ms = 5; // XXX utile ? static volatile uint8_t dest_addr_ms; static volatile uint8_t len_buf_ms; static volatile uint8_t *send_buf_ms; -#endif /* TWI_MASTER_ENABLE */ +#endif /* AC_TWI_MASTER_ENABLE */ void twi_init (uint8_t addr) { -#ifdef TWI_SLAVE_ENABLE +#if AC_TWI_SLAVE_ENABLE data_ready_sl = 0; send_switch_sl = 0; update_sl = 0; @@ -73,19 +81,19 @@ twi_init (uint8_t addr) TWAR = addr; TWSR = 0x00; TWCR = _BV(TWEA); -#endif /* TWI_SLAVE_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#endif /* AC_TWI_SLAVE_ENABLE */ +#if AC_TWI_MASTER_ENABLE #if defined(TWPS0) TWSR = 0; #endif TWBR = (AC_FREQ / 100000UL - 16) / 2; state_ms = TWI_FREE; -#endif /* TWI_MASTER_ENABLE */ +#endif /* AC_TWI_MASTER_ENABLE */ /* Active la twi et les interruptions de la twi */ TWCR |= _BV (TWEN) | _BV (TWIE); } -#ifdef TWI_SLAVE_ENABLE +#if AC_TWI_SLAVE_ENABLE uint8_t twi_sl_poll (uint8_t *buffer, uint8_t size) { @@ -102,9 +110,9 @@ twi_sl_poll (uint8_t *buffer, uint8_t size) else return 0; } -#endif /* TWI_SLAVE_ENABLE */ +#endif /* AC_TWI_SLAVE_ENABLE */ -#ifdef TWI_SLAVE_ENABLE +#if AC_TWI_SLAVE_ENABLE void twi_sl_update (uint8_t *buffer, uint8_t size) { @@ -115,9 +123,9 @@ twi_sl_update (uint8_t *buffer, uint8_t size) send_user_sl[size] = buffer[size]; update_sl = 0; } -#endif /* TWI_SLAVE_ENABLE */ +#endif /* AC_TWI_SLAVE_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#if AC_TWI_MASTER_ENABLE int8_t twi_ms_is_finished () { @@ -129,9 +137,9 @@ twi_ms_is_finished () else return 0; } -#endif /* TWI_MASTER_ENABLE */ +#endif /* AC_TWI_MASTER_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#if AC_TWI_MASTER_ENABLE int8_t twi_ms_send (uint8_t addr, uint8_t *data, uint8_t len) { @@ -154,9 +162,9 @@ twi_ms_send (uint8_t addr, uint8_t *data, uint8_t len) return -1; } } -#endif /* TWI_MASTER_ENABLE */ +#endif /* AC_TWI_MASTER_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#if AC_TWI_MASTER_ENABLE int8_t twi_ms_read (uint8_t addr, uint8_t *data, uint8_t len) { @@ -179,21 +187,21 @@ twi_ms_read (uint8_t addr, uint8_t *data, uint8_t len) return -1; } } -#endif /* TWI_MASTER_ENABLE */ +#endif /* AC_TWI_MASTER_ENABLE */ SIGNAL (SIG_2WIRE_SERIAL) { -#ifdef TWI_SLAVE_ENABLE +#if AC_TWI_SLAVE_ENABLE static uint8_t send_idx_sl = 0; static uint8_t rcpt_idx_sl = 0; -#endif /* TWI_SLAVE_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#endif /* AC_TWI_SLAVE_ENABLE */ +#if AC_TWI_MASTER_ENABLE static uint8_t idx_ms; #define NB_RETRY 5 -#endif /* TWI_MASTER_ENABLE */ +#endif /* AC_TWI_MASTER_ENABLE */ switch (TW_STATUS) { -#ifdef TWI_SLAVE_ENABLE +#if AC_TWI_SLAVE_ENABLE /***** slave transmitter mode *****/ /* START + SLA|W + ACK * on a recu un start pour une ecriture et on a acquité @@ -215,7 +223,7 @@ SIGNAL (SIG_2WIRE_SERIAL) case TW_ST_DATA_ACK: //uart0_putc ('p'); TWDR = send_sys_sl[send_idx_sl++]; - if (send_idx_sl == TWI_SL_SEND_SIZE) + if (send_idx_sl == AC_TWI_SL_SEND_BUFFER_SIZE) TWCR &= ~_BV(TWEA); TWCR |= _BV(TWINT); break; @@ -234,7 +242,7 @@ SIGNAL (SIG_2WIRE_SERIAL) //uart0_putc ('u'); data_ready_sl = 0; rcpt_idx_sl = 0; - if (TWI_SL_RCPT_SIZE == 1) + if (AC_TWI_SL_RECV_BUFFER_SIZE == 1) TWCR &= ~_BV(TWEA); TWCR |= _BV(TWINT); break; @@ -243,7 +251,7 @@ SIGNAL (SIG_2WIRE_SERIAL) case TW_SR_GCALL_DATA_ACK: //uart0_putc ('s'); rcpt_buf_sl[rcpt_idx_sl++] = TWDR; - if (TWI_SL_RCPT_SIZE - rcpt_idx_sl == 1) + if (AC_TWI_SL_RECV_BUFFER_SIZE - rcpt_idx_sl == 1) TWCR &= ~_BV(TWEA); TWCR |= _BV(TWINT); break; @@ -259,8 +267,8 @@ SIGNAL (SIG_2WIRE_SERIAL) data_ready_sl = 1; TWCR |= _BV(TWINT); break; -#endif /* TWI_SLAVE_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#endif /* AC_TWI_SLAVE_ENABLE */ +#if AC_TWI_MASTER_ENABLE /* Master */ case TW_START: case TW_REP_START: @@ -358,6 +366,6 @@ SIGNAL (SIG_2WIRE_SERIAL) TWCR |= _BV (TWSTO); TWCR |= _BV (TWINT); break; -#endif/* TWI_MASTER_ENABLE */ +#endif/* AC_TWI_MASTER_ENABLE */ } } diff --git a/digital/avr/modules/twi/twi.c b/digital/avr/modules/twi/twi.c deleted file mode 100644 index e60bfa90..00000000 --- a/digital/avr/modules/twi/twi.c +++ /dev/null @@ -1,33 +0,0 @@ -/* twi.c */ -/* avr.twi - TWI AVR module. {{{ - * - * Copyright (C) 2005 Demonchy Clément - * - * Robot APB Team/Efrei 2006. - * Web: http://assos.efrei.fr/robot/ - * Email: robot AT efrei DOT fr - * - * 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 "twi.h" - -#if defined (HOST) -# error "TO BE IMPLEMENTED" -#elif defined (SIMU) -# error "TO BE IMPLEMENTED" -#else -# include "twi.avr.c" -#endif diff --git a/digital/avr/modules/twi/twi.h b/digital/avr/modules/twi/twi.h index f036417e..6944daa3 100644 --- a/digital/avr/modules/twi/twi.h +++ b/digital/avr/modules/twi/twi.h @@ -25,22 +25,20 @@ * * }}} */ -#include - /** Initialise twi. */ void twi_init (uint8_t addr); -#ifdef TWI_SLAVE_ENABLE +#if AC_TWI_SLAVE_ENABLE /** Récupère dans buffer les données recues en tant qu'esclave */ uint8_t twi_sl_poll (uint8_t *buffer, uint8_t size); /** Met à jour le buffer de donnée à envoyer */ void twi_sl_update (uint8_t *buffer, uint8_t size); -#endif /* TWI_SLAVE_ENABLE */ +#endif /* AC_TWI_SLAVE_ENABLE */ -#ifdef TWI_MASTER_ENABLE +#if AC_TWI_MASTER_ENABLE /** Is the current transaction finished ? */ int8_t twi_ms_is_finished (void); @@ -50,6 +48,6 @@ twi_ms_send (uint8_t address, uint8_t *data, uint8_t len); /** Read len bytes at addresse en put them in data */ int8_t twi_ms_read (uint8_t address, uint8_t *data, uint8_t len); -#endif /* TWI_MASTER_ENABLE */ +#endif /* AC_TWI_MASTER_ENABLE */ #endif /* twi_h */ diff --git a/digital/avr/modules/twi/twi.host.c b/digital/avr/modules/twi/twi.host.c new file mode 100644 index 00000000..526ebe62 --- /dev/null +++ b/digital/avr/modules/twi/twi.host.c @@ -0,0 +1,77 @@ +/* twi.host.c */ +/* avr.twi - TWI AVR module. {{{ + * + * Copyright (C) 2008 Nicolas Schodet + * + * APBTeam: + * Web: http://apbteam.org/ + * Email: team AT apbteam DOT org + * + * 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 "common.h" +#include "twi.h" + +/* Empty for the moment. */ + +/** Initialise twi. */ +void +twi_init (uint8_t addr) +{ +} + +#if AC_TWI_SLAVE_ENABLE + +/** Récupère dans buffer les données recues en tant qu'esclave */ +uint8_t +twi_sl_poll (uint8_t *buffer, uint8_t size) +{ + return 0; +} + +/** Met à jour le buffer de donnée à envoyer */ +void +twi_sl_update (uint8_t *buffer, uint8_t size) +{ +} + +#endif /* AC_TWI_SLAVE_ENABLE */ + +#if AC_TWI_MASTER_ENABLE + +/** Is the current transaction finished ? */ +int8_t +twi_ms_is_finished (void) +{ + return 0; +} + +/** Send len bytes of data to address */ +int8_t +twi_ms_send (uint8_t address, uint8_t *data, uint8_t len) +{ + return -1; +} + +/** Read len bytes at addresse en put them in data */ +int8_t +twi_ms_read (uint8_t address, uint8_t *data, uint8_t len) +{ + return -1; +} + +#endif /* AC_TWI_MASTER_ENABLE */ + -- cgit v1.2.3