Main Page | Modules | Data Structures | File List | Data Fields | Globals

ect.h File Reference

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Defines

#define TCNT_CLK   64 /* TCNT rate is 64us, check ect_init. */
#define MSEC2TCNT(ms)   ((ms*1000) / TCNT_CLK)
#define ECT_TEN   0x80 /* Timer Enable */
#define ECT_TSWAI   0x40 /* Timer Module Stops While in Wait */
#define ECT_TSFRZ   0x20 /* Timer and Modulus Counter Stop While in Freeze Mode */
#define ECT_TFFCA   0x10 /* Timer Fast Flag Clear All */
#define ECT_TOI   0x80 /* Timer Overflow Interrupt Enable (intr on TOF flag set) */
#define ECT_TCRE   0x08 /* Timer Counter Reset Enable */
#define ECT_PR2   0x04 /* PR2, PR1, PR0 Timer Prescaler Select */
#define ECT_PR1   0x02 /* PR2, PR1, PR0 Timer Prescaler Select */
#define ECT_PR0   0x01 /* PR2, PR1, PR0 Timer Prescaler Select */
#define ECT_TOF   0x80 /* Timer Overflow Flag */
#define ECT_PAEN   0x40 /* Pulse Accumulator A System Enable */
#define ECT_PAMOD   0x20 /* Pulse Accumulator Mode */
#define ECT_PEDGE   0x10 /* Pulse Accumulator Edge Control */
#define ECT_CLK1   0X08 /* CLK1 CLK0 Clock Source */
#define ECT_CLK2   0x04 /* CLK1 CLK0 Clock Source */
#define ECT_PAOVI   0x02 /* Pulse Accumulator A Overflow Interrupt enable */
#define ECT_PAI   0x01 /* Pulse Accumulator Input Interrupt enable */
#define ECT_PAOVF   0x02 /* Pulse Accumulator A Overflow Flag */
#define ECT_PAIF   0x01 /* Pulse Accumulator Input edge Flag */
#define ECT_MCCTL   0x80 /* Modulus Counter Underflow Interrupt Enable */
#define ECT_MODMC   0x40 /* Modulus Mode Enable */
#define ECT_RDMCL   0x20 /* Read Modulus Down-Counter Load */
#define ECT_ICLAT   0x10 /* Input Capture Force Latch Action */
#define ECT_FLMC   0x08 /* Force Load Register into the Modulus Counter Count Register */
#define ECT_MCEN   0x04 /* Modulus Down-Counter Enable */
#define ECT_MCPR1   0x02 /* MCPR1, MCPR0 Modulus Counter Prescaler select */
#define ECT_MCPR0   0x01 /* MCPR1, MCPR0 Modulus Counter Prescaler select */
#define ECT_MCZF   0x80 /* Modulus Counter Underflow Flag */
#define ECT_PBEN   0x40 /* Pulse Accumulator B System Enable */
#define ECT_PBOVI   0x02 /* Pulse Accumulator B Overflow Interrupt enable */
#define ECT_PBOVF   0x02 /* Pulse Accumulator B Overflow Flag */
#define OFF_TIOS   0x00 /* Timer Input Capture/Output Compare Select TIOS Read/Write */
#define OFF_CFORC   0x01 /* Timer Compare Force Register CFORC Read/Write 1 */
#define OFF_OC7M   0x02 /* Output Compare 7 Mask Register OC7M Read/Write */
#define OFF_OC7D   0x03 /* Output Compare 7 Data Register OC7D Read/Write */
#define OFF_TCNT_H   0x04 /* Timer Count Register High TCNT Read/Write 2 */
#define OFF_TCNT_L   0x05 /* Timer Count Register Low TCNT Read/Write 2 */
#define OFF_TSCR1   0x06 /* Timer System Control Register1 TSCR1 Read/Write */
#define OFF_TTOV   0x07 /* Timer Toggle Overflow Register TTOV Read/Write */
#define OFF_TCTL1   0x08 /* Timer Control Register1 TCTL1 Read/Write */
#define OFF_TCTL2   0x09 /* Timer Control Register2 TCTL2 Read/Write */
#define OFF_TCTL3   0x0A /* Timer Control Register3 TCTL3 Read/Write */
#define OFF_TCTL4   0x0B /* Timer Control Register4 TCTL4 Read/Write */
#define OFF_TIE   0x0C /* Timer Interrupt Enable Register TIE Read/Write */
#define OFF_TSCR2   0x0D /* Timer System Control Register2 TSCR2 Read/Write */
#define OFF_TFLG1   0x0E /* Main Timer Interrupt Flag1 TFLG1 Read/Write */
#define OFF_TFLG2   0x0F /* Main Timer Interrupt Flag2 TFLG2 Read/Write */
#define OFF_TC0_H   0x10 /* (TC0) Read/Write 3 */
#define OFF_TC0_L   0x11 /* (TC0) Read/Write 3 */
#define OFF_TC1_H   0x12 /* (TC1) Read/Write 3 */
#define OFF_TC1_L   0x13 /* (TC1) Read/Write 3 */
#define OFF_TC2_H   0x14 /* (TC2) Read/Write 3 */
#define OFF_TC2_L   0x15 /* (TC2) Read/Write 3 */
#define OFF_TC3_H   0x16 /* (TC3) Read/Write 3 */
#define OFF_TC3_L   0x17 /* (TC3) Read/Write 3 */
#define OFF_TC4_H   0x18 /* (TC4) Read/Write 3 */
#define OFF_TC4_L   0x19 /* (TC4) Read/Write 3 */
#define OFF_TC5_H   0x1A /* (TC5) Read/Write 3 */
#define OFF_TC5_L   0x1B /* (TC5) Read/Write 3 */
#define OFF_TC6_H   0x1C /* (TC6) Read/Write 3 */
#define OFF_TC6_L   0x1D /* (TC6) Read/Write 3 */
#define OFF_TC7_H   0x1E /* (TC7) Read/Write 3 */
#define OFF_TC7_L   0x1F /* (TC7) Read/Write 3 */
#define OFF_PACTL   0x20 /* 16­Bit Pulse Accumulator A Control Register (PACTL) Read/Write */
#define OFF_PAFLG   0x21 /* Pulse Accumulator A Flag Register PAFLG Read/Write */
#define OFF_PACN3   0x22 /* Pulse Accumulator Count Register3 PACN3 Read/Write */
#define OFF_PACN2   0x23 /* Pulse Accumulator Count Register2 PACN2 Read/Write */
#define OFF_PACN1   0x24 /* Pulse Accumulator Count Register1 PACN1 Read/Write */
#define OFF_PACN0   0x25 /* Pulse Accumulator Count Register0 PACN0 Read/Write */
#define OFF_MCCTL   0x26 /* 16­Bit Modulus Down Counter Register MCCTL Read/Write */
#define OFF_MCFLG   0x27 /* 16­Bit Modulus Down Counter Flag Register (MCFLG) Read/Write */
#define OFF_ICPAR   0x28 /* Input Control Pulse Accumulator Register ICPAR Read/Write */
#define OFF_DLYCT   0x29 /* Delay Counter Control Register DLYCT Read/Write */
#define OFF_ICOVW   0x2A /* Input Control Overwrite Register ICOVW Read/Write */
#define OFF_ICSYS   0x2B /* Input Control System Control Register ICSYS Read/Write 4 */
#define OFF_TIMTST   0x2D /* Timer Test Register TIMTST Read/Write 2 */
#define OFF_PBCTL   0x30 /* 16­Bit Pulse Accumulator B Control Register (PBCTL) Read/Write */
#define OFF_PBFLG   0x31 /* 16­Bit Pulse Accumulator B Flag Register PBFLG Read/Write */
#define OFF_PA3H   0x32 /* 8­Bit Pulse Accumulator Holding Register3 PA3H Read/Write 5 */
#define OFF_PA2H   0x33 /* 8­Bit Pulse Accumulator Holding Register2 PA2H Read/Write 5 */
#define OFF_PA1H   0x34 /* 8­Bit Pulse Accumulator Holding Register1 PA1H Read/Write 5 */
#define OFF_PA0H   0x35 /* 8­Bit Pulse Accumulator Holding Register0 PA0H Read/Write 5 */
#define OFF_MCCNT_H   0x36 /* Modulus Down­Counter Count Register High (MCCNT) Read/Write */
#define OFF_MCCNT_L   0x37 /* Modulus Down­Counter Count Register Low */
#define OFF_TC0H_H   0x38 /* Timer Input Capture Holding Register0 High TC0H Read/Write 5 */
#define OFF_TC0H_L   0x39 /* Timer Input Capture Holding Register0 Low TC0H Read/Write 5 */
#define OFF_TC1H_H   0x3A /* Timer Input Capture Holding Register1 HighTC1H Read/Write 5 */
#define OFF_TC1H_L   0x3B /* Timer Input Capture Holding Register1 Low TC1H Read/Write 5 */
#define OFF_TC2H_H   0x3C /* Timer Input Capture Holding Register2 High TC2H Read/Write 5 */
#define OFF_TC2H_L   0x3D /* Timer Input Capture Holding Register2 Low TC2H Read/Write 5 */
#define OFF_TC3H_H   0x3E /* Timer Input Capture Holding Register3 High TC3H Read/Write 5 */
#define OFF_TC3H_L   0x3F /* Timer Input Capture Holding Register3 Low TC3H Read/Write 5 */

Functions

__inline__ void ect_init (void)


Define Documentation

#define ECT_CLK1   0X08 /* CLK1 CLK0 Clock Source */
 

Definition at line 47 of file ect.h.

#define ECT_CLK2   0x04 /* CLK1 CLK0 Clock Source */
 

Definition at line 49 of file ect.h.

#define ECT_FLMC   0x08 /* Force Load Register into the Modulus Counter Count Register */
 

Definition at line 69 of file ect.h.

#define ECT_ICLAT   0x10 /* Input Capture Force Latch Action */
 

Definition at line 67 of file ect.h.

#define ECT_MCCTL   0x80 /* Modulus Counter Underflow Interrupt Enable */
 

Definition at line 61 of file ect.h.

#define ECT_MCEN   0x04 /* Modulus Down-Counter Enable */
 

Definition at line 71 of file ect.h.

#define ECT_MCPR0   0x01 /* MCPR1, MCPR0 Modulus Counter Prescaler select */
 

Definition at line 75 of file ect.h.

#define ECT_MCPR1   0x02 /* MCPR1, MCPR0 Modulus Counter Prescaler select */
 

Definition at line 73 of file ect.h.

#define ECT_MCZF   0x80 /* Modulus Counter Underflow Flag */
 

Definition at line 78 of file ect.h.

#define ECT_MODMC   0x40 /* Modulus Mode Enable */
 

Definition at line 63 of file ect.h.

#define ECT_PAEN   0x40 /* Pulse Accumulator A System Enable */
 

Definition at line 41 of file ect.h.

#define ECT_PAI   0x01 /* Pulse Accumulator Input Interrupt enable */
 

Definition at line 53 of file ect.h.

#define ECT_PAIF   0x01 /* Pulse Accumulator Input edge Flag */
 

Definition at line 58 of file ect.h.

#define ECT_PAMOD   0x20 /* Pulse Accumulator Mode */
 

Definition at line 43 of file ect.h.

#define ECT_PAOVF   0x02 /* Pulse Accumulator A Overflow Flag */
 

Definition at line 56 of file ect.h.

#define ECT_PAOVI   0x02 /* Pulse Accumulator A Overflow Interrupt enable */
 

Definition at line 51 of file ect.h.

#define ECT_PBEN   0x40 /* Pulse Accumulator B System Enable */
 

Definition at line 81 of file ect.h.

#define ECT_PBOVF   0x02 /* Pulse Accumulator B Overflow Flag */
 

Definition at line 86 of file ect.h.

#define ECT_PBOVI   0x02 /* Pulse Accumulator B Overflow Interrupt enable */
 

Definition at line 83 of file ect.h.

#define ECT_PEDGE   0x10 /* Pulse Accumulator Edge Control */
 

Definition at line 45 of file ect.h.

#define ECT_PR0   0x01 /* PR2, PR1, PR0 Timer Prescaler Select */
 

Definition at line 35 of file ect.h.

Referenced by ect_init().

#define ECT_PR1   0x02 /* PR2, PR1, PR0 Timer Prescaler Select */
 

Definition at line 33 of file ect.h.

Referenced by ect_init().

#define ECT_PR2   0x04 /* PR2, PR1, PR0 Timer Prescaler Select */
 

Definition at line 31 of file ect.h.

Referenced by ect_init().

#define ECT_RDMCL   0x20 /* Read Modulus Down-Counter Load */
 

Definition at line 65 of file ect.h.

#define ECT_TCRE   0x08 /* Timer Counter Reset Enable */
 

Definition at line 29 of file ect.h.

#define ECT_TEN   0x80 /* Timer Enable */
 

Definition at line 18 of file ect.h.

Referenced by ect_init().

#define ECT_TFFCA   0x10 /* Timer Fast Flag Clear All */
 

Definition at line 24 of file ect.h.

#define ECT_TOF   0x80 /* Timer Overflow Flag */
 

Definition at line 38 of file ect.h.

Referenced by isr_exec_stuff().

#define ECT_TOI   0x80 /* Timer Overflow Interrupt Enable (intr on TOF flag set) */
 

Definition at line 27 of file ect.h.

#define ECT_TSFRZ   0x20 /* Timer and Modulus Counter Stop While in Freeze Mode */
 

Definition at line 22 of file ect.h.

#define ECT_TSWAI   0x40 /* Timer Module Stops While in Wait */
 

Definition at line 20 of file ect.h.

#define MSEC2TCNT ms   )     ((ms*1000) / TCNT_CLK)
 

Definition at line 14 of file ect.h.

Referenced by bsleep(), and create_task().

#define OFF_CFORC   0x01 /* Timer Compare Force Register CFORC Read/Write 1 */
 

Definition at line 320 of file ect.h.

#define OFF_DLYCT   0x29 /* Delay Counter Control Register DLYCT Read/Write */
 

Definition at line 400 of file ect.h.

#define OFF_ICOVW   0x2A /* Input Control Overwrite Register ICOVW Read/Write */
 

Definition at line 402 of file ect.h.

#define OFF_ICPAR   0x28 /* Input Control Pulse Accumulator Register ICPAR Read/Write */
 

Definition at line 398 of file ect.h.

#define OFF_ICSYS   0x2B /* Input Control System Control Register ICSYS Read/Write 4 */
 

Definition at line 404 of file ect.h.

#define OFF_MCCNT_H   0x36 /* Modulus Down­Counter Count Register High (MCCNT) Read/Write */
 

Definition at line 423 of file ect.h.

#define OFF_MCCNT_L   0x37 /* Modulus Down­Counter Count Register Low */
 

Definition at line 425 of file ect.h.

#define OFF_MCCTL   0x26 /* 16­Bit Modulus Down Counter Register MCCTL Read/Write */
 

Definition at line 394 of file ect.h.

#define OFF_MCFLG   0x27 /* 16­Bit Modulus Down Counter Flag Register (MCFLG) Read/Write */
 

Definition at line 396 of file ect.h.

#define OFF_OC7D   0x03 /* Output Compare 7 Data Register OC7D Read/Write */
 

Definition at line 324 of file ect.h.

#define OFF_OC7M   0x02 /* Output Compare 7 Mask Register OC7M Read/Write */
 

Definition at line 322 of file ect.h.

#define OFF_PA0H   0x35 /* 8­Bit Pulse Accumulator Holding Register0 PA0H Read/Write 5 */
 

Definition at line 421 of file ect.h.

#define OFF_PA1H   0x34 /* 8­Bit Pulse Accumulator Holding Register1 PA1H Read/Write 5 */
 

Definition at line 419 of file ect.h.

#define OFF_PA2H   0x33 /* 8­Bit Pulse Accumulator Holding Register2 PA2H Read/Write 5 */
 

Definition at line 417 of file ect.h.

#define OFF_PA3H   0x32 /* 8­Bit Pulse Accumulator Holding Register3 PA3H Read/Write 5 */
 

Definition at line 415 of file ect.h.

#define OFF_PACN0   0x25 /* Pulse Accumulator Count Register0 PACN0 Read/Write */
 

Definition at line 392 of file ect.h.

#define OFF_PACN1   0x24 /* Pulse Accumulator Count Register1 PACN1 Read/Write */
 

Definition at line 390 of file ect.h.

#define OFF_PACN2   0x23 /* Pulse Accumulator Count Register2 PACN2 Read/Write */
 

Definition at line 388 of file ect.h.

#define OFF_PACN3   0x22 /* Pulse Accumulator Count Register3 PACN3 Read/Write */
 

Definition at line 386 of file ect.h.

#define OFF_PACTL   0x20 /* 16­Bit Pulse Accumulator A Control Register (PACTL) Read/Write */
 

Definition at line 382 of file ect.h.

#define OFF_PAFLG   0x21 /* Pulse Accumulator A Flag Register PAFLG Read/Write */
 

Definition at line 384 of file ect.h.

#define OFF_PBCTL   0x30 /* 16­Bit Pulse Accumulator B Control Register (PBCTL) Read/Write */
 

Definition at line 411 of file ect.h.

#define OFF_PBFLG   0x31 /* 16­Bit Pulse Accumulator B Flag Register PBFLG Read/Write */
 

Definition at line 413 of file ect.h.

#define OFF_TC0_H   0x10 /* (TC0) Read/Write 3 */
 

Definition at line 350 of file ect.h.

#define OFF_TC0_L   0x11 /* (TC0) Read/Write 3 */
 

Definition at line 352 of file ect.h.

#define OFF_TC0H_H   0x38 /* Timer Input Capture Holding Register0 High TC0H Read/Write 5 */
 

Definition at line 427 of file ect.h.

#define OFF_TC0H_L   0x39 /* Timer Input Capture Holding Register0 Low TC0H Read/Write 5 */
 

Definition at line 429 of file ect.h.

#define OFF_TC1_H   0x12 /* (TC1) Read/Write 3 */
 

Definition at line 354 of file ect.h.

#define OFF_TC1_L   0x13 /* (TC1) Read/Write 3 */
 

Definition at line 356 of file ect.h.

#define OFF_TC1H_H   0x3A /* Timer Input Capture Holding Register1 HighTC1H Read/Write 5 */
 

Definition at line 431 of file ect.h.

#define OFF_TC1H_L   0x3B /* Timer Input Capture Holding Register1 Low TC1H Read/Write 5 */
 

Definition at line 433 of file ect.h.

#define OFF_TC2_H   0x14 /* (TC2) Read/Write 3 */
 

Definition at line 358 of file ect.h.

#define OFF_TC2_L   0x15 /* (TC2) Read/Write 3 */
 

Definition at line 360 of file ect.h.

#define OFF_TC2H_H   0x3C /* Timer Input Capture Holding Register2 High TC2H Read/Write 5 */
 

Definition at line 435 of file ect.h.

#define OFF_TC2H_L   0x3D /* Timer Input Capture Holding Register2 Low TC2H Read/Write 5 */
 

Definition at line 437 of file ect.h.

#define OFF_TC3_H   0x16 /* (TC3) Read/Write 3 */
 

Definition at line 362 of file ect.h.

#define OFF_TC3_L   0x17 /* (TC3) Read/Write 3 */
 

Definition at line 364 of file ect.h.

#define OFF_TC3H_H   0x3E /* Timer Input Capture Holding Register3 High TC3H Read/Write 5 */
 

Definition at line 439 of file ect.h.

#define OFF_TC3H_L   0x3F /* Timer Input Capture Holding Register3 Low TC3H Read/Write 5 */
 

Definition at line 441 of file ect.h.

#define OFF_TC4_H   0x18 /* (TC4) Read/Write 3 */
 

Definition at line 366 of file ect.h.

#define OFF_TC4_L   0x19 /* (TC4) Read/Write 3 */
 

Definition at line 368 of file ect.h.

#define OFF_TC5_H   0x1A /* (TC5) Read/Write 3 */
 

Definition at line 370 of file ect.h.

#define OFF_TC5_L   0x1B /* (TC5) Read/Write 3 */
 

Definition at line 372 of file ect.h.

#define OFF_TC6_H   0x1C /* (TC6) Read/Write 3 */
 

Definition at line 374 of file ect.h.

#define OFF_TC6_L   0x1D /* (TC6) Read/Write 3 */
 

Definition at line 376 of file ect.h.

#define OFF_TC7_H   0x1E /* (TC7) Read/Write 3 */
 

Definition at line 378 of file ect.h.

#define OFF_TC7_L   0x1F /* (TC7) Read/Write 3 */
 

Definition at line 380 of file ect.h.

#define OFF_TCNT_H   0x04 /* Timer Count Register High TCNT Read/Write 2 */
 

Definition at line 326 of file ect.h.

#define OFF_TCNT_L   0x05 /* Timer Count Register Low TCNT Read/Write 2 */
 

Definition at line 328 of file ect.h.

#define OFF_TCTL1   0x08 /* Timer Control Register1 TCTL1 Read/Write */
 

Definition at line 334 of file ect.h.

#define OFF_TCTL2   0x09 /* Timer Control Register2 TCTL2 Read/Write */
 

Definition at line 336 of file ect.h.

#define OFF_TCTL3   0x0A /* Timer Control Register3 TCTL3 Read/Write */
 

Definition at line 338 of file ect.h.

#define OFF_TCTL4   0x0B /* Timer Control Register4 TCTL4 Read/Write */
 

Definition at line 340 of file ect.h.

#define OFF_TFLG1   0x0E /* Main Timer Interrupt Flag1 TFLG1 Read/Write */
 

Definition at line 346 of file ect.h.

#define OFF_TFLG2   0x0F /* Main Timer Interrupt Flag2 TFLG2 Read/Write */
 

Definition at line 348 of file ect.h.

#define OFF_TIE   0x0C /* Timer Interrupt Enable Register TIE Read/Write */
 

Definition at line 342 of file ect.h.

#define OFF_TIMTST   0x2D /* Timer Test Register TIMTST Read/Write 2 */
 

Definition at line 407 of file ect.h.

#define OFF_TIOS   0x00 /* Timer Input Capture/Output Compare Select TIOS Read/Write */
 

Definition at line 318 of file ect.h.

#define OFF_TSCR1   0x06 /* Timer System Control Register1 TSCR1 Read/Write */
 

Definition at line 330 of file ect.h.

#define OFF_TSCR2   0x0D /* Timer System Control Register2 TSCR2 Read/Write */
 

Definition at line 344 of file ect.h.

#define OFF_TTOV   0x07 /* Timer Toggle Overflow Register TTOV Read/Write */
 

Definition at line 332 of file ect.h.

#define TCNT_CLK   64 /* TCNT rate is 64us, check ect_init. */
 

Definition at line 12 of file ect.h.


Function Documentation

__inline__ void ect_init void   ) 
 

Definition at line 31 of file ect.c.

References BIT7, ECT_PR0, ECT_PR1, ECT_PR2, ECT_TEN, TFLG1, TIE, TIOS, TSCR1, and TSCR2.

00032 {   
00035     TSCR2 = ECT_PR0 | ECT_PR1 | ECT_PR2;    /* Set timer prescaler to /128. */
00036     TIOS |= BIT7;       /* Set TC7 to output compare. */
00037     TSCR1 |= ECT_TEN;   /* Enable timer. */
00038     TFLG1 |= BIT7;      /* Clear possibly existing interrupt. */
00039     TIE |= BIT7;        /* Enable TC7 interrupt. */
00040      
00041     return;
00042 }


Generated on Sat Apr 10 17:08:12 2004 for BeeOS by doxygen 1.3.6-20040222