File indexing completed on 2025-05-11 08:23:39
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 #ifndef _RTEMS_TMTEST27
0037 #error "This is an RTEMS internal file you must not include directly."
0038 #endif
0039
0040 #ifndef __tm27_h
0041 #define __tm27_h
0042
0043 #include <rtems.h>
0044
0045 #include <bsp/irq.h>
0046 #include <bsp/tms570.h>
0047 #include <rtems/score/armv4.h>
0048
0049 #define MUST_WAIT_FOR_INTERRUPT 1
0050
0051 #define TM27_INTERRUPT_VECTOR_DEFAULT TMS570_IRQ_TIMER_3
0052
0053 #define TM27_INTERRUPT_VECTOR_ALTERNATIVE TMS570_IRQ_TIMER_1
0054
0055 static inline void Install_tm27_vector( rtems_interrupt_handler handler )
0056 {
0057 static rtems_interrupt_entry entry_2;
0058 static rtems_interrupt_entry entry_3;
0059
0060 TMS570_RTI.CNT[1].CPUCx = 1;
0061 TMS570_RTI.CNT[1].UCx = 0;
0062 TMS570_RTI.CNT[1].FRCx = 0;
0063 TMS570_RTI.CMP[1].COMPx = 1;
0064 TMS570_RTI.CMP[1].UDCPx = 1;
0065 TMS570_RTI.CMP[2].COMPx = 1;
0066 TMS570_RTI.CMP[2].UDCPx = 1;
0067 TMS570_RTI.CMP[3].COMPx = 1;
0068 TMS570_RTI.CMP[3].UDCPx = 1;
0069 TMS570_RTI.COMPCTRL |= TMS570_RTI_COMPCTRL_COMPSEL1 |
0070 TMS570_RTI_COMPCTRL_COMPSEL2 |
0071 TMS570_RTI_COMPCTRL_COMPSEL3;
0072 TMS570_RTI.GCTRL |= TMS570_RTI_GCTRL_CNT1EN;
0073
0074 rtems_interrupt_entry_initialize(
0075 &entry_2,
0076 handler,
0077 NULL,
0078 "tm27"
0079 );
0080 (void) rtems_interrupt_entry_install(
0081 TMS570_IRQ_TIMER_2,
0082 RTEMS_INTERRUPT_SHARED,
0083 &entry_2
0084 );
0085
0086 rtems_interrupt_entry_initialize(
0087 &entry_3,
0088 handler,
0089 NULL,
0090 "tm27"
0091 );
0092 (void) rtems_interrupt_entry_install(
0093 TMS570_IRQ_TIMER_3,
0094 RTEMS_INTERRUPT_SHARED,
0095 &entry_3
0096 );
0097 }
0098
0099 static inline void Cause_tm27_intr(void)
0100 {
0101 TMS570_RTI.SETINTENA = TMS570_RTI_SETINTENA_SETINT3;
0102 }
0103
0104 static inline void Clear_tm27_intr(void)
0105 {
0106 TMS570_RTI.CLEARINTENA = TMS570_RTI_CLEARINTENA_CLEARINT2 |
0107 TMS570_RTI_CLEARINTENA_CLEARINT3;
0108 }
0109
0110 static inline void Lower_tm27_intr(void)
0111 {
0112 TMS570_RTI.SETINTENA = TMS570_RTI_SETINTENA_SETINT2;
0113 (void) _ARMV4_Status_irq_enable();
0114 }
0115
0116 static inline rtems_status_code _TM27_Raise_alternative(void)
0117 {
0118 TMS570_RTI.SETINTENA = TMS570_RTI_SETINTENA_SETINT1;
0119 return RTEMS_SUCCESSFUL;
0120 }
0121
0122 static inline rtems_status_code _TM27_Clear_alternative(void)
0123 {
0124 TMS570_RTI.CLEARINTENA = TMS570_RTI_CLEARINTENA_CLEARINT1;
0125 return RTEMS_SUCCESSFUL;
0126 }
0127
0128 #endif