source: rtems/bsps/powerpc/include/mpc83xx/gtm.h

Last change on this file was bcef89f2, checked in by Sebastian Huber <sebastian.huber@…>, on 05/19/23 at 06:18:25

Update company name

The embedded brains GmbH & Co. KG is the legal successor of embedded
brains GmbH.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/* SPDX-License-Identifier: BSD-2-Clause */
2
3/**
4 * @file
5 *
6 * @brief Header file for timer functions.
7 */
8
9/*
10 * Copyright (c) 2008 embedded brains GmbH & Co. KG
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 *    notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 *    notice, this list of conditions and the following disclaimer in the
18 *    documentation and/or other materials provided with the distribution.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef LIBBSP_POWERPC_MPC83XX_TIMER_H
34#define LIBBSP_POWERPC_MPC83XX_TIMER_H
35
36#include <stdint.h>
37#include <stdbool.h>
38
39#include <rtems.h>
40
41#define MPC83XX_GTM_NUMBER 8
42
43#define MPC83XX_GTM_CLOCK_CASCADED 0x0000
44#define MPC83XX_GTM_CLOCK_SYSTEM 0x0002
45#define MPC83XX_GTM_CLOCK_SYSTEM_SLOW 0x0004
46#define MPC83XX_GTM_CLOCK_EXTERN 0x0006
47
48rtems_status_code mpc83xx_gtm_initialize( int timer, int clock);
49
50rtems_status_code mpc83xx_gtm_enable_restart( int timer, bool enable);
51
52rtems_status_code mpc83xx_gtm_set_clock( int timer, int clock);
53
54rtems_status_code mpc83xx_gtm_get_clock( int timer, int *clock);
55
56rtems_status_code mpc83xx_gtm_start( int timer);
57
58rtems_status_code mpc83xx_gtm_stop( int timer);
59
60rtems_status_code mpc83xx_gtm_set_value( int timer, uint16_t value);
61
62rtems_status_code mpc83xx_gtm_get_value( int timer, uint16_t *value);
63
64rtems_status_code mpc83xx_gtm_set_reference( int timer, uint16_t reference);
65
66rtems_status_code mpc83xx_gtm_get_reference( int timer, uint16_t *reference);
67
68rtems_status_code mpc83xx_gtm_set_prescale( int timer, uint8_t prescale);
69
70rtems_status_code mpc83xx_gtm_get_prescale( int timer, uint8_t *prescale);
71
72rtems_status_code mpc83xx_gtm_interrupt_get_vector( int timer, rtems_vector_number *vector);
73
74rtems_status_code mpc83xx_gtm_interrupt_enable( int timer);
75
76rtems_status_code mpc83xx_gtm_interrupt_disable( int timer);
77
78rtems_status_code mpc83xx_gtm_interrupt_clear( int timer);
79
80#endif /* LIBBSP_POWERPC_MPC83XX_TIMER_H */
Note: See TracBrowser for help on using the repository browser.