rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
mcuconf.h
Go to the documentation of this file.
1/*
2 ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15*/
16
17#ifndef _MCUCONF_H_
18#define _MCUCONF_H_
19
20/*
21 * HAL driver system settings.
22 */
23
24/* Select the MCU clocking mode below by enabling the appropriate block. */
25#define CYPRESS_PLL_FREQ 192000000UL // 192MHz
26#define CYPRESS_CLK 8000000U // 8MHz
27
28#define CYPRESS_SYSCLK_FREQUENCY CYPRESS_PLL_FREQ
29#define CYPRESS_PCLK1_FREQENCY (CYPRESS_PLL_FREQ / (1 << (APBC1_PSR_Val & 3))) // 48 MHz
30
31/*
32 * GPIO driver system settings.
33 */
34// Use this with PAL_MODE_ALTERNATE(x)
35#define PAL_MODE_ALTERNATIVE_GPIO 0x0
36#define PAL_MODE_ALTERNATIVE_ANALOG 0x1
37#define PAL_MODE_ALTERNATIVE_SPI 0x2
38#define PAL_MODE_ALTERNATIVE_I2C 0x3
39#define PAL_MODE_ALTERNATIVE_UART 0x4
40#define PAL_MODE_ALTERNATIVE_CAN 0x5
41#define PAL_MODE_ALTERNATIVE_EXTINT 0x6
42
43/*
44 * UART driver system settings.
45 */
46#define CYPRESS_UART_USE_UART1 FALSE/*TRUE*/
47#define CYPRESS_UART_USE_UART2 FALSE/*TRUE*/
48
49/*
50 * GPT/PIT driver system settings.
51 */
52#define CYPRESS_GPT_USE_BT0_BT1 TRUE
53#define CYPRESS_GPT_USE_BT2_BT3 TRUE
54#define CYPRESS_GPT_USE_BT4_BT5 FALSE
55#define CYPRESS_GPT_USE_BT6_BT7 FALSE
56
57/*
58 * PWM/FTM driver system settings.
59 */
60#define CYPRESS_PWM_USE_FTM0 FALSE
61#define CYPRESS_PWM_USE_FTM1 FALSE
62#define CYPRESS_PWM_USE_FTM2 FALSE
63#define CYPRESS_PWM_USE_FTM3 FALSE
64
65/*
66 * SPI driver system settings.
67 */
68#define CYPRESS_SPI_USE_SPI0 TRUE
69#define CYPRESS_SPI_SPI0_CHANNEL CSIO6
70#define CYPRESS_SPI_USE_SPI1 TRUE
71#define CYPRESS_SPI_SPI1_CHANNEL CSIO7
72
73/*
74 * ADC driver system settings.
75 */
76#define CYPRESS_ADC_USE_ADC0 TRUE
77#define CYPRESS_ADC_USE_ADC1 TRUE
78#define CYPRESS_ADC_USE_ADC2 TRUE
79
80/*
81 * CAN driver system settings.
82 */
83#define CYPRESS_CAN_USE_CAN0 TRUE
84#define CYPRESS_CAN_USE_CAN1 FALSE
85
86#endif /* _MCUCONF_H_ */