Loading...
Searching...
No Matches
mcp2515_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2016 OTA keys S.A.
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23#include "can/device.h"
24#include "candev_mcp2515.h"
25
26#include "board.h"
27
32#ifndef MCP2515_PARAM_SPI
33#define MCP2515_PARAM_SPI SPI_DEV(0)
34#endif
35
36#ifndef MCP2515_PARAM_SPI_MODE
37#define MCP2515_PARAM_SPI_MODE SPI_MODE_0
38#endif
39
40#ifndef MCP2515_PARAM_SPI_CLK
41#define MCP2515_PARAM_SPI_CLK SPI_CLK_10MHZ
42#endif
43
44#ifndef MCP2515_PARAM_CS
45#define MCP2515_PARAM_CS GPIO_PIN(1, 9)
46#endif
47
48#ifndef MCP2515_PARAM_RST
49#define MCP2515_PARAM_RST GPIO_UNDEF
50#endif
51
52#ifndef MCP2515_PARAM_INT
53#define MCP2515_PARAM_INT GPIO_PIN(1, 8)
54#endif
55
56#ifndef MCP2515_PARAM_CLK
57#define MCP2515_PARAM_CLK (8000000ul)
58
59#endif
60
61#define MCP2515_DEFAULT_CONFIG \
62{ \
63 .spi = MCP2515_PARAM_SPI, \
64 .spi_mode = MCP2515_PARAM_SPI_MODE, \
65 .spi_clk =MCP2515_PARAM_SPI_CLK, \
66 .cs_pin = MCP2515_PARAM_CS, \
67 .rst_pin = MCP2515_PARAM_RST, \
68 .int_pin = MCP2515_PARAM_INT, \
69 .clk = MCP2515_PARAM_CLK, \
70}
72
77 MCP2515_DEFAULT_CONFIG
78};
79
84 {
85 .name = "can_mcp2515_0",
86 },
87};
88
89#ifdef __cplusplus
90}
91#endif
92
Definition of the implementation of the CAN controller driver.
struct candev_mcp2515_conf candev_mcp2515_conf_t
MCP2515 configuration descriptor.
static const candev_params_t candev_mcp2515_params[]
set candev parameters
MCP2515 configuration descriptor.
Definitions of CAN device interface.
struct candev_params candev_params_t
Parameters to initialize a candev.