From 7ee3b3c3da60b181d18336e892d8d0920166f5ae Mon Sep 17 00:00:00 2001 From: bernie Date: Sun, 23 May 2004 18:21:53 +0000 Subject: [PATCH] Trim CVS logs and cleanup header info. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@5 38d2e660-2303-0410-9eaa-f027e97ec537 --- drv/buzzer.c | 23 +++------------ drv/buzzer.h | 19 ++++++------ drv/kdebug.c | 6 +++- drv/kdebug.h | 5 +++- drv/ser.c | 26 ++--------------- drv/ser.h | 55 +++++++++-------------------------- drv/ser_avr.c | 75 +++++++++++++++++------------------------------- drv/ser_dsp56k.c | 60 ++++++++++++++++++++++---------------- drv/ser_i196.c | 13 ++++----- drv/ser_p.h | 23 ++++++--------- 10 files changed, 114 insertions(+), 191 deletions(-) diff --git a/drv/buzzer.c b/drv/buzzer.c index cb722398..5f3349e1 100755 --- a/drv/buzzer.c +++ b/drv/buzzer.c @@ -1,8 +1,8 @@ /*! * \file * * @@ -15,23 +15,8 @@ /* * $Log$ - * Revision 1.1 2004/05/23 18:10:11 bernie - * Import drv/ modules. - * - * Revision 1.5 2004/04/04 17:44:51 aleph - * Move event.h from mware to kern dir - * - * Revision 1.4 2004/03/24 15:03:45 bernie - * Use explicit include paths; clean Doxygen comments - * - * Revision 1.3 2004/03/03 18:27:44 bernie - * Fixed race conds with IRQ when fiddling with I/O ports - * - * Revision 1.2 2003/12/18 18:15:24 aleph - * Use new IRQ disable/enable reentrant macros - * - * Revision 1.1 2003/12/13 23:53:37 aleph - * Add buzzer driver + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. * */ diff --git a/drv/buzzer.h b/drv/buzzer.h index 646c467b..078daef8 100755 --- a/drv/buzzer.h +++ b/drv/buzzer.h @@ -1,8 +1,10 @@ /*! * \file - * Copyright (C) 1999,2003 Bernardo Innocenti - * Copyright (C) 2003 Develer S.r.l. (http://www.develer.com/) + * * * \version $Id$ * @@ -13,19 +15,16 @@ /* * $Log$ - * Revision 1.1 2004/05/23 18:10:11 bernie - * Import drv/ modules. - * - * Revision 1.1 2003/12/13 23:53:37 aleph - * Add buzzer driver + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. * */ -#ifndef BUZZER_H -#define BUZZER_H +#ifndef DRV_BUZZER_H +#define DRV_BUZZER_H extern void buz_init(void); extern void buz_beep(time_t time); extern void buz_repeat_start(time_t duration, time_t interval); extern void buz_repeat_stop(void); -#endif /* BUZZER_H */ +#endif /* DRV_BUZZER_H */ diff --git a/drv/kdebug.c b/drv/kdebug.c index 44d211ff..99a82d1a 100755 --- a/drv/kdebug.c +++ b/drv/kdebug.c @@ -1,4 +1,4 @@ -/* +/*! * \file * * @@ -28,29 +28,9 @@ /* * $Log$ - * Revision 1.1 2004/05/23 18:10:11 bernie - * Import drv/ modules. - * - * Revision 1.5 2004/05/14 12:47:26 rasky - * Importato nuovo supporto seriale per AVR da Stefano - * - * Revision 1.4 2004/04/29 16:40:23 rasky - * Durante i busy loop della seriale, chiama la proc_switch() per cambiare processo - * - * Revision 1.3 2004/04/21 17:38:24 rasky - * New application - * - * Revision 1.16 2004/04/03 18:30:49 aleph - * Move timeout defines in config, private define in .c - * - * Revision 1.15 2004/03/29 17:01:02 aleph - * Add function to set serial parity, fix it when ser_open is used - * - * Revision 1.14 2004/03/29 16:19:33 aleph - * Add ser_cleanup function; Various code improvements + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. * - * Revision 1.13 2004/03/24 15:48:53 bernie - * Remove Copyright messages from Doxygen output */ #include diff --git a/drv/ser.h b/drv/ser.h index ad643e35..9d584a80 100755 --- a/drv/ser.h +++ b/drv/ser.h @@ -1,8 +1,8 @@ /*! * \file * * @@ -14,38 +14,12 @@ /* * $Log$ - * Revision 1.1 2004/05/23 18:10:11 bernie - * Import drv/ modules. - * - * Revision 1.2 2004/04/21 17:38:24 rasky - * New application - * - * Revision 1.16 2004/04/03 18:30:49 aleph - * Move timeout defines in config, private define in .c - * - * Revision 1.15 2004/03/29 17:01:02 aleph - * Add function to set serial parity, fix it when ser_open is used - * - * Revision 1.14 2004/03/29 16:19:33 aleph - * Add ser_cleanup function; Various code improvements - * - * Revision 1.13 2004/03/24 15:22:27 aleph - * Removed subdirs -I, fix header inclusion, move config.h in board_kf, kctrl - * - * Revision 1.12 2004/03/17 17:30:30 bernie - * Add GCC format checks to printf()-like functions. - * - * Revision 1.11 2004/03/16 23:06:42 aleph - * Doc fix + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. * - * Revision 1.10 2004/03/12 18:46:53 bernie - * ser_read(): New function. - * - * Revision 1.9 2004/03/11 18:11:51 bernie - * Cosmetic fixes */ -#ifndef SER_H -#define SER_H +#ifndef DRV_SER_H +#define DRV_SER_H #include "compiler.h" #include @@ -109,11 +83,11 @@ enum #elif defined(__AVR_ATmega103__) SER_UART0, SER_SPI, - + #elif defined (__m56800__) SER_UART0, - SER_UART1, - + SER_UART1, + #else #error unknown architecture #endif @@ -158,10 +132,9 @@ struct Serial /*! Holds the flags defined above. Will be 0 when no errors have occurred. */ REGISTER uint16_t status; - + /*! Low-level interface to hardware. */ struct SerialHardware* hw; - }; @@ -184,13 +157,13 @@ extern void ser_close(struct Serial *port); extern void ser_settimeouts(struct Serial *port, time_t rxtimeout, time_t txtimeout); #endif -/** - * @name Additional functions implemented as macros +/*! + * \name Additional functions implemented as macros * - * @{ + * \{ */ #define ser_getstatus(h) ((h)->status) #define ser_setstatus(h, x) ((h)->status = (x)) -/* @} */ +/* \} */ -#endif /* SER_H */ +#endif /* DRV_SER_H */ diff --git a/drv/ser_avr.c b/drv/ser_avr.c index c3bab672..af780c11 100755 --- a/drv/ser_avr.c +++ b/drv/ser_avr.c @@ -1,8 +1,8 @@ -/** +/*! * \file * * @@ -15,32 +15,9 @@ /* * $Log$ - * Revision 1.1 2004/05/23 18:10:11 bernie - * Import drv/ modules. - * - * Revision 1.30 2004/05/19 17:06:11 bernie - * Serial TX fill mode - * - * Revision 1.29 2004/05/16 19:16:46 aleph - * Serial always transmitting, first try - * - * Revision 1.28 2004/05/14 12:09:00 aleph - * Fix TX port pull-ups - * - * Revision 1.27 2004/05/08 13:56:02 aleph - * Adapt avr serial driver to new design - * - * Revision 1.25 2004/04/28 13:42:16 aleph - * Serial port fixes - * - * Revision 1.24 2004/04/08 14:17:27 bernie - * Change serial to disable TX when not sending data + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. * - * Revision 1.23 2004/04/03 20:39:41 aleph - * Remove strobe - * - * Revision 1.22 2004/03/29 17:01:02 aleph - * Add function to set serial parity, fix it when ser_open is used */ #include "ser.h" @@ -76,14 +53,14 @@ struct AvrSerial #ifdef __AVR_ATmega103__ /* Macro for ATmega103 compatibility */ - #define UCSR0B UCR - #define UDR0 UDR - #define UCSR0A USR + #define UCSR0B UCR + #define UDR0 UDR + #define UCSR0A USR #define UBRR0L UBRR #else - #define UCR UCSR0B - #define UDR UDR0 - #define USR UCSR0A + #define UCR UCSR0B + #define UDR UDR0 + #define USR UCSR0A #endif @@ -384,7 +361,7 @@ static void spi_starttx(UNUSED(struct SerialHardware *ctx)) /* Send data only if the SPI is not already transmitting */ if (!spi_sending && !fifo_isempty(&ser_handles[SER_SPI].txfifo)) { - SPDR = fifo_pop(&ser_handles[SER_SPI].txfifo); + SPDR = fifo_pop(&ser_handles[SER_SPI].txfifo); spi_sending = true; } @@ -420,12 +397,12 @@ __interrupt void UART_TXC_interrupt(void) { UCSRB &= ~TXCIE; ReceiveMode(); - UCSRB = RXCIE | RXEN | TXEN; //Abilito l'Interrupt in ricezione e RX e TX + UCSRB = RXCIE | RXEN | TXEN; //Abilito l'Interrupt in ricezione e RX e TX } */ -static const struct SerialHardwareVT UART0_VT = +static const struct SerialHardwareVT UART0_VT = { .init = uart0_init, .cleanup = uart0_cleanup, @@ -434,7 +411,7 @@ static const struct SerialHardwareVT UART0_VT = .enabletxirq = uart0_enabletxirq, }; -static const struct SerialHardwareVT UART1_VT = +static const struct SerialHardwareVT UART1_VT = { .init = uart1_init, .cleanup = uart1_cleanup, @@ -443,7 +420,7 @@ static const struct SerialHardwareVT UART1_VT = .enabletxirq = uart1_enabletxirq, }; -static const struct SerialHardwareVT SPI_VT = +static const struct SerialHardwareVT SPI_VT = { .init = spi_init, .cleanup = spi_cleanup, @@ -452,17 +429,17 @@ static const struct SerialHardwareVT SPI_VT = static struct AvrSerial UARTDescs[SER_CNT] = { - { - .hw = { .table = &UART0_VT }, - }, - - { - .hw = { .table = &UART1_VT }, - }, - - { - .hw = { .table = &SPI_VT }, - }, + { + .hw = { .table = &UART0_VT }, + }, + + { + .hw = { .table = &UART1_VT }, + }, + + { + .hw = { .table = &SPI_VT }, + }, }; struct SerialHardware* ser_hw_getdesc(int unit) diff --git a/drv/ser_dsp56k.c b/drv/ser_dsp56k.c index d2f13620..970a5c3d 100755 --- a/drv/ser_dsp56k.c +++ b/drv/ser_dsp56k.c @@ -1,20 +1,30 @@ -/** +/*! * \file - * Copyright (C) 2003 Develer S.r.l. (http://www.develer.com/) + * * * \version $Id$ * * \author Stefano Fedrigo + * \author Giovanni Bajo * * \brief DSP5680x CPU specific serial I/O driver */ -#include -#include -#include +/* + * $Log$ + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. + * + */ + #include "ser.h" #include "ser_p.h" +#include +#include +#include // GPIO E is shared with SPI (in DSP56807). Pins 0&1 are TXD0 and RXD0. To use // the serial, we need to disable the GPIO functions on them. @@ -101,16 +111,16 @@ INLINE void rx_isr(struct SCI *hw) { volatile struct REG_SCI_STRUCT* regs = hw->regs; - hw->serial->status |= regs->SR & (SERRF_PARITYERROR | - SERRF_RXSROVERRUN | - SERRF_FRAMEERROR | + hw->serial->status |= regs->SR & (SERRF_PARITYERROR | + SERRF_RXSROVERRUN | + SERRF_FRAMEERROR | SERRF_NOISEERROR); - + if (fifo_isfull(&hw->serial->rxfifo)) hw->serial->status |= SERRF_RXFIFOOVERRUN; else fifo_push(&hw->serial->rxfifo, regs->DR); - + // Writing anything to the status register clear the // error bits. regs->SR = 0; @@ -124,10 +134,10 @@ static void init(struct SerialHardware* _hw, struct Serial* ser) // Clear status register (IRQ/status flags) (void)regs->SR; regs->SR = 0; - + // Clear data register (void)regs->DR; - + // Set priorities for both IRQs irq_setpriority(hw->irq_tx, IRQ_PRIORITY_SCI_TX); irq_setpriority(hw->irq_rx, IRQ_PRIORITY_SCI_RX); @@ -135,7 +145,7 @@ static void init(struct SerialHardware* _hw, struct Serial* ser) // Activate the RX error interrupts, and RX/TX transmissions regs->CR = REG_SCI_CR_TE | REG_SCI_CR_RE; enable_rx_irq_bare(regs); - + // Disable GPIO pins for TX and RX lines REG_GPIO_SERIAL->PER |= REG_GPIO_SERIAL_MASK; @@ -176,19 +186,19 @@ static const struct SerialHardwareVT SCI_VT = static struct SCI SCIDescs[2] = { - { - .hw = { .table = &SCI_VT }, - .regs = ®_SCI[0], - .irq_rx = IRQ_SCI0_RECEIVER_FULL, - .irq_tx = IRQ_SCI0_TRANSMITTER_READY, - }, - - { - .hw = { .table = &SCI_VT }, + { + .hw = { .table = &SCI_VT }, + .regs = ®_SCI[0], + .irq_rx = IRQ_SCI0_RECEIVER_FULL, + .irq_tx = IRQ_SCI0_TRANSMITTER_READY, + }, + + { + .hw = { .table = &SCI_VT }, .regs = ®_SCI[1], - .irq_rx = IRQ_SCI1_RECEIVER_FULL, - .irq_tx = IRQ_SCI1_TRANSMITTER_READY, - }, + .irq_rx = IRQ_SCI1_RECEIVER_FULL, + .irq_tx = IRQ_SCI1_TRANSMITTER_READY, + }, }; diff --git a/drv/ser_i196.c b/drv/ser_i196.c index 7225e867..1a556aca 100755 --- a/drv/ser_i196.c +++ b/drv/ser_i196.c @@ -1,8 +1,10 @@ -/** +/*! * \file - * Copyright (C) 2000 Bernardo Innocenti + * * * \version $Id$ * @@ -13,11 +15,8 @@ /* * $Log$ - * Revision 1.1 2004/05/23 18:10:11 bernie - * Import drv/ modules. - * - * Revision 1.1 2003/11/20 22:30:21 aleph - * Add serial driver + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. * */ diff --git a/drv/ser_p.h b/drv/ser_p.h index 14d21710..4825bb86 100755 --- a/drv/ser_p.h +++ b/drv/ser_p.h @@ -1,7 +1,9 @@ -/** +/*! * \file + * * * \brief Hardware dependent serial driver (interface) * @@ -13,22 +15,13 @@ /* * $Log$ - * Revision 1.1 2004/05/23 18:10:11 bernie - * Import drv/ modules. - * - * Revision 1.1 2004/05/14 12:47:26 rasky - * Importato nuovo supporto seriale per AVR da Stefano - * - * Revision 1.3 2004/05/08 13:59:08 aleph - * Fix header guard - * - * Revision 1.2 2004/05/08 13:58:36 aleph - * Add log comment + * Revision 1.2 2004/05/23 18:21:53 bernie + * Trim CVS logs and cleanup header info. * */ -#ifndef _DRV_SER_P_H -#define _DRV_SER_P_H +#ifndef DRV_SER_P_H +#define DRV_SER_P_H struct SerialHardware; struct Serial; @@ -49,4 +42,4 @@ struct SerialHardware struct SerialHardware* ser_hw_getdesc(int unit); -#endif // _DRV_SER_P_H +#endif /* DRV_SER_P_H */ -- 2.25.1