RTEMS 6.1-rc6
Loading...
Searching...
No Matches
slicetimer.h
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/*
4 * RTEMS generic MPC5200 BSP.
5 *
6 * This file declares functions to use the slice timer module.
7 */
8
9/*
10 * Copyright (c) 2005 embedded brains GmbH & Co. KG
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 * POSSIBILITY OF SUCH DAMAGE.
32 */
33
34#ifndef __SLICETIMER_H__
35#define __SLICETIMER_H__
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#define SLT0 0
42#define SLT1 1
43
44#define SLT0_INT_FREQUENCY 10000
45#define SLT1_INT_FREQUENCY 0
46
47#define SLT_CNTRL_RW (1 << 26)
48#define SLT_CNTRL_INTEN (1 << 25)
49#define SLT_CNTRL_TIMEN (1 << 24)
50
51#define SLT_TSR_ST (1 << 24)
52
53#define SLT_TSR_COUNT(freq) ((freq) ? ((IPB_CLOCK)/(freq)) : (0xFFFFFF))
54
57 void *
58 );
59
60#define SLTIME_DRIVER_TABLE_ENTRY \
61 { slt_initialize, NULL, NULL, \
62 NULL, NULL, NULL }
63
64void mpc5200_slt_isr(uint32_t);
65rtems_isr mpc5200_slt0_isr(rtems_irq_hdl_param);
66rtems_isr mpc5200_slt1_isr(rtems_irq_hdl_param);
67void mpc5200_init_slt(uint32_t);
68void mpc5200_set_slt_count(uint32_t);
69void mpc5200_enable_slt_int(uint32_t);
70void mpc5200_disable_slt_int(uint32_t);
71uint32_t mpc5200_check_slt_status(uint32_t);
72/*void sltOn(const rtems_irq_connect_data *);
73void sltOff(const rtems_irq_connect_data *);
74int sltIsOn(const rtems_irq_connect_data *);*/
75void Install_slt(rtems_device_minor_number);
76
77#ifdef __cplusplus
78}
79#endif
80
81#endif /* __SLICETIMER_H__ */
uint32_t rtems_device_major_number
This integer type represents the major number of devices.
Definition: io.h:103
uint32_t rtems_device_minor_number
This integer type represents the minor number of devices.
Definition: io.h:115
ISR_Handler rtems_isr
This type defines the return type of interrupt service routines.
Definition: intr.h:123
rtems_status_code
This enumeration provides status codes for directives of the Classic API.
Definition: status.h:85