this software.
*/
+/** \file
+ *
+ * Header file for SoftUART.c.
+ */
+
#ifndef _SOFT_UART_
#define _SOFT_UART_
#include "LightweightRingBuff.h"
/* Macros: */
- #define BAUD 9600
- #define BIT_TIME (uint16_t)((F_CPU + (BAUD / 2)) / BAUD)
-
#define SRX PD0
#define SRXPIN PIND
#define SRXPORT PORTD
#define STXPORT PORTD
#define STXDDR DDRD
+ /* Inline Functions: */
+ static inline void SoftUART_SetBaud(const uint32_t Baud)
+ {
+ uint16_t BitTime = ((F_CPU / Baud) - 1);
+
+ ICR1 = BitTime;
+ ICR3 = BitTime;
+ }
+
/* Function Prototypes: */
- void SoftUART_Init(void);
+ void SoftUART_Init(void);
#endif
\ No newline at end of file