summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschodet2004-07-04 11:14:31 +0000
committerschodet2004-07-04 11:14:31 +0000
commit63165bafcffdcc465bf37b401c4bf739c43f5ab3 (patch)
tree97c7a3bbdc30d0ed781f400322219c71c222d398
parent508c46053cfdfcbacdaadddfd5022bba57294968 (diff)
Mise à jour du .h
Changement des paramètres par defaut. Changement du programme de test.
-rw-r--r--n/avr/rs232/avrconfig.h8
-rw-r--r--n/avr/rs232/rs232.c1
-rw-r--r--n/avr/rs232/rs232.h14
-rw-r--r--n/avr/rs232/test_rs232.c4
4 files changed, 20 insertions, 7 deletions
diff --git a/n/avr/rs232/avrconfig.h b/n/avr/rs232/avrconfig.h
index b661fe9..8b2c68a 100644
--- a/n/avr/rs232/avrconfig.h
+++ b/n/avr/rs232/avrconfig.h
@@ -41,12 +41,12 @@
#define AC_RS232_SEND_MODE POLLING
/** Recv mode, same as send mode. */
#define AC_RS232_RECV_MODE POLLING
-/** Parity : ODD, EVEN, NONE. */
-#define AC_RS232_PARITY ODD
-/** Stop bits : 1, 2. */
-#define AC_RS232_STOP_BITS 2
/** Character size : 5, 6, 7, 8, 9 (only 8 implemented). */
#define AC_RS232_CHAR_SIZE 8
+/** Parity : ODD, EVEN, NONE. */
+#define AC_RS232_PARITY EVEN
+/** Stop bits : 1, 2. */
+#define AC_RS232_STOP_BITS 1
/** SOP (Start of packet) caracter. */
#define AC_RS232_SOP(c) ((c) == '!')
/** EOP (End of packet) caracter. */
diff --git a/n/avr/rs232/rs232.c b/n/avr/rs232/rs232.c
index 6022aa0..68895bd 100644
--- a/n/avr/rs232/rs232.c
+++ b/n/avr/rs232/rs232.c
@@ -25,7 +25,6 @@
#include <avr/io.h>
#include <avr/signal.h>
-#include <inttypes.h>
/* Tested AVR check. */
#if defined (__AVR_ATmega8__)
diff --git a/n/avr/rs232/rs232.h b/n/avr/rs232/rs232.h
index f37fc87..b2c87fb 100644
--- a/n/avr/rs232/rs232.h
+++ b/n/avr/rs232/rs232.h
@@ -25,6 +25,8 @@
* }}} */
#include "avrconfig.h"
+#include <inttypes.h>
+
/* +AutoDec */
/** Initialise rs232. */
@@ -32,12 +34,20 @@ void
rs232_init (void);
/** Read a char. */
-unsigned char
+uint8_t
rs232_getc (void);
/** Write a char. */
void
-rs232_putc (unsigned char c);
+rs232_putc (uint8_t c);
+
+/** Retrieve error condition, 0 if no error. */
+uint8_t
+rs232_error (void);
+
+/** Retrieve availlable chars. */
+uint8_t
+rs232_poll (void);
/* -AutoDec */
diff --git a/n/avr/rs232/test_rs232.c b/n/avr/rs232/test_rs232.c
index 89e0979..3771758 100644
--- a/n/avr/rs232/test_rs232.c
+++ b/n/avr/rs232/test_rs232.c
@@ -30,6 +30,10 @@ int
main (void)
{
rs232_init ();
+ rs232_putc ('N');
+ rs232_putc ('i');
+ rs232_putc ('!');
+ rs232_putc ('\r');
while (1)
rs232_putc (rs232_getc ());
}