libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
cec.h
Go to the documentation of this file.
1/** @defgroup CEC_defines CEC Defines
2 *
3 * @brief <b>Defined Constants and Types for the STM32F0xx HDMI-CEC</b>
4 *
5 * @ingroup STM32F0xx_defines
6 *
7 * @version 1.0.0
8 *
9 * @date 11 July 2013
10 *
11 * LGPL License Terms @ref lgpl_license
12 */
13/*
14 * This file is part of the libopencm3 project.
15 *
16 * Copyright (C) 2013 Frantisek Burian <BuFran@seznam.cz>
17 *
18 * This library is free software: you can redistribute it and/or modify
19 * it under the terms of the GNU Lesser General Public License as published by
20 * the Free Software Foundation, either version 3 of the License, or
21 * (at your option) any later version.
22 *
23 * This library is distributed in the hope that it will be useful,
24 * but WITHOUT ANY WARRANTY; without even the implied warranty of
25 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 * GNU Lesser General Public License for more details.
27 *
28 * You should have received a copy of the GNU Lesser General Public License
29 * along with this library. If not, see <http://www.gnu.org/licenses/>.
30 */
31
32#ifndef LIBOPENCM3_CEC_H
33#define LIBOPENCM3_CEC_H
34/**@{*/
35
36/*****************************************************************************/
37/* Module definitions */
38/*****************************************************************************/
39
40#define CEC CEC_BASE
41
42/*****************************************************************************/
43/* Register definitions */
44/*****************************************************************************/
45
46#define CEC_CR MMIO32(CEC_BASE + 0x00)
47#define CEC_CFGR MMIO32(CEC_BASE + 0x04)
48#define CEC_TXDR MMIO32(CEC_BASE + 0x08)
49#define CEC_RXDR MMIO32(CEC_BASE + 0x0c)
50#define CEC_ISR MMIO32(CEC_BASE + 0x10)
51#define CEC_IER MMIO32(CEC_BASE + 0x14)
52
53/*****************************************************************************/
54/* Register values */
55/*****************************************************************************/
56
57/* CEC_CR Values ------------------------------------------------------------*/
58
59#define CEC_CR_TXEOM (1 << 2)
60#define CEC_CR_TXSOM (1 << 1)
61#define CEC_CR_CECEN (1 << 0)
62
63/* CEC_CFGR Values ----------------------------------------------------------*/
64
65#define CEC_CFGR_LSTN (1 << 31)
66
67#define CEC_CFGR_OAR_SHIFT 16
68#define CEC_CFGR_OAR (0x3FFF << CEC_CFGR_OAR_SHIFT)
69
70#define CEC_CFGR_SFTOPT (1 << 8)
71#define CEC_CFGR_BRDNOGEN (1 << 7)
72#define CEC_CFGR_LBPEGEN (1 << 6)
73#define CEC_CFGR_BREGEN (1 << 5)
74#define CEC_CFGR_BRESTP (1 << 4)
75#define CEC_CFGR_RXTOL (1 << 3)
76
77#define CEC_CFGR_SFT_SHIFT 0
78#define CEC_CFGR_SFT (7 >> CEC_CFGR_SFT_SHIFT)
79
80/* CEC_ISR Values -----------------------------------------------------------*/
81
82#define CEC_ISR_TXACKE (1 << 12)
83#define CEC_ISR_TXERR (1 << 11)
84#define CEC_ISR_TXUDR (1 << 10)
85#define CEC_ISR_TXEND (1 << 9)
86#define CEC_ISR_TXBR (1 << 8)
87#define CEC_ISR_ARBLST (1 << 7)
88#define CEC_ISR_RXACKE (1 << 6)
89#define CEC_ISR_LBPE (1 << 5)
90#define CEC_ISR_SBPE (1 << 4)
91#define CEC_ISR_BRE (1 << 3)
92#define CEC_ISR_RXOVR (1 << 2)
93#define CEC_ISR_RXEND (1 << 1)
94#define CEC_ISR_RXBR (1 << 0)
95
96/* CEC_IER Values -----------------------------------------------------------*/
97
98#define CEC_IER_TXACKIE (1 << 12)
99#define CEC_IER_TXERRIE (1 << 11)
100#define CEC_IER_TXUDRIE (1 << 10)
101#define CEC_IER_TXENDIE (1 << 9)
102#define CEC_IER_TXBRIE (1 << 8)
103#define CEC_IER_ARBLSTIE (1 << 7)
104#define CEC_IER_RXACKIE (1 << 6)
105#define CEC_IER_LBPEIE (1 << 5)
106#define CEC_IER_SBPEIE (1 << 4)
107#define CEC_IER_BREIE (1 << 3)
108#define CEC_IER_RXOVRIE (1 << 2)
109#define CEC_IER_RXENDIE (1 << 1)
110#define CEC_IER_RXBRIE (1 << 0)
111
112/*****************************************************************************/
113/* API definitions */
114/*****************************************************************************/
115
116/*****************************************************************************/
117/* API Functions */
118/*****************************************************************************/
119
121
123/**@}*/
124
125#endif
#define END_DECLS
Definition: common.h:34
#define BEGIN_DECLS
Definition: common.h:33