|
| 1 | +# Kconfig.mcp2515 - MCP2515 CAN configuration options |
| 2 | + |
| 3 | +# |
| 4 | +# Copyright (c) 2018 Karsten Koenig |
| 5 | +# |
| 6 | +# SPDX-License-Identifier: Apache-2.0 |
| 7 | +# |
| 8 | + |
| 9 | +config CAN_MCP2515 |
| 10 | + bool "MCP2515 CAN Driver" |
| 11 | + depends on SPI |
| 12 | + help |
| 13 | + Enable MCP2515 CAN Driver |
| 14 | + |
| 15 | +if CAN_MCP2515 |
| 16 | + |
| 17 | +config CAN_MCP2515_NAME |
| 18 | + string "Driver name" |
| 19 | + default "MCP2515" |
| 20 | + |
| 21 | +config CAN_MCP2515_OSC_FREQ |
| 22 | + int "Oscillator frequency" |
| 23 | + default 8000000 |
| 24 | + help |
| 25 | + Specify the frequency of the oscillator connected to the MCP2515. |
| 26 | + |
| 27 | +config CAN_PROP_SEG |
| 28 | + int "Prop_Seg" |
| 29 | + default 2 |
| 30 | + range 1 8 |
| 31 | + help |
| 32 | + Time quantums of propagation segment (ISO 11898-1) |
| 33 | + |
| 34 | +config CAN_PHASE_SEG1 |
| 35 | + int "Phase_Seg1" |
| 36 | + default 7 |
| 37 | + range 1 8 |
| 38 | + help |
| 39 | + Time quantums of phase buffer 1 segment (ISO 11898-1) |
| 40 | + |
| 41 | +config CAN_PHASE_SEG2 |
| 42 | + int "Phase_Seg2" |
| 43 | + default 6 |
| 44 | + range 2 8 |
| 45 | + help |
| 46 | + Time quantums of phase buffer 2 segment (ISO 11898-1) |
| 47 | + |
| 48 | +config CAN_SJW |
| 49 | + int "SJW" |
| 50 | + default 1 |
| 51 | + range 1 4 |
| 52 | + help |
| 53 | + Resynchronization jump width (ISO 11898-1) |
| 54 | + |
| 55 | +config CAN_MCP2515_SPI_PORT_NAME |
| 56 | + string "SPI device where MCP2515 is connected" |
| 57 | + default "SPI_1" |
| 58 | + help |
| 59 | + Specify the device name of the SPI device to which MCP2515 is |
| 60 | + connected. |
| 61 | + |
| 62 | +config CAN_MCP2515_SPI_SLAVE |
| 63 | + int "SPI Slave Select where MCP2515 is connected" |
| 64 | + default 1 |
| 65 | + help |
| 66 | + Specify the slave select pin of the SPI to which MCP2515 is |
| 67 | + connected. |
| 68 | + |
| 69 | +config CAN_MCP2515_SPI_FREQ |
| 70 | + int "SPI frequency to use with MCP2515" |
| 71 | + default 1000000 |
| 72 | + help |
| 73 | + SPI frequency to use with MCP2515 |
| 74 | + |
| 75 | +config CAN_MCP2515_INT_PORT_NAME |
| 76 | + string "INT GPIO controller port name" |
| 77 | + default "GPIO_0" |
| 78 | + help |
| 79 | + GPIO port where INT is connected. |
| 80 | + |
| 81 | +config CAN_MCP2515_INT_PIN |
| 82 | + int "INT GPIO pin" |
| 83 | + default 19 |
| 84 | + help |
| 85 | + GPIO pin where INT is connected. |
| 86 | + |
| 87 | +config CAN_MCP2515_INT_THREAD_STACK_SIZE |
| 88 | + int "Stack size for interrupt handler" |
| 89 | + default 512 |
| 90 | + help |
| 91 | + Size of the stack used for internal thread which is ran for |
| 92 | + interrupt handling and incoming packets. |
| 93 | + |
| 94 | +config CAN_MCP2515_INT_THREAD_PRIO |
| 95 | + int "Priority for interrupt handler" |
| 96 | + default 2 |
| 97 | + help |
| 98 | + Priority level of the internal thread which is ran for |
| 99 | + interrupt handling and incoming packets. |
| 100 | + |
| 101 | +config CAN_MCP2515_GPIO_SPI_CS |
| 102 | + bool "Manage SPI CS through a GPIO pin" |
| 103 | + help |
| 104 | + This option is useful if one needs to manage SPI CS through a GPIO |
| 105 | + pin to by-pass the SPI controller's CS logic. |
| 106 | + |
| 107 | +if CAN_MCP2515_GPIO_SPI_CS |
| 108 | +config CAN_MCP2515_SPI_CS_PORT_NAME |
| 109 | + string "GPIO driver's name to use to drive SPI CS through" |
| 110 | + help |
| 111 | + This option is mandatory to set which GPIO controller to use in |
| 112 | + order to actually emulate the SPI CS. |
| 113 | + |
| 114 | +config CAN_MCP2515_SPI_CS_PIN |
| 115 | + int "GPIO PIN to use to drive SPI CS through" |
| 116 | + default 0 |
| 117 | + help |
| 118 | + This option is mandatory to set which GPIO pin to use in order |
| 119 | + to actually emulate the SPI CS. |
| 120 | + |
| 121 | +endif #CAN_MCP2515_GPIO_SPI_CS |
| 122 | + |
| 123 | +config CAN_MCP2515_MAX_FILTER |
| 124 | + int "Maximum number of concurrent active filters" |
| 125 | + default 5 |
| 126 | + range 1 32 |
| 127 | + help |
| 128 | + Defines the array size of the callback/msgq pointers. |
| 129 | + Must be at least the size of concurrent reads. |
| 130 | + |
| 131 | + |
| 132 | +config CAN_MCP2515_INIT_PRIORITY |
| 133 | + int "Init priority" |
| 134 | + default 80 |
| 135 | + help |
| 136 | + MCP2515 driver initialization priority, must be higher than SPI. |
| 137 | + |
| 138 | +endif # CAN_MCP2515 |
0 commit comments