|
| 1 | +# Copyright (c) 2024 Syslinbit SCOP SAS |
| 2 | +# SPDX-License-Identifier: Apache-2.0 |
| 3 | + |
| 4 | +config ADC_MCP356XR |
| 5 | + bool "MCP3561R/2R/4R driver" |
| 6 | + default y |
| 7 | + depends on DT_HAS_MICROCHIP_MCP356XR_ENABLED |
| 8 | + select SPI |
| 9 | + select ADC_CONFIGURABLE_INPUTS |
| 10 | + help |
| 11 | + Enable MCP3561R/2R/4R ADC driver. |
| 12 | + |
| 13 | +if ADC_MCP356XR |
| 14 | + |
| 15 | +config ADC_MCP356XR_THREAD_STACK_SIZE |
| 16 | + int "Stack size for the ADC thread" |
| 17 | + default 512 |
| 18 | + help |
| 19 | + Size of the stack used for the internal ADC thread. |
| 20 | + |
| 21 | +config ADC_MCP356XR_THREAD_PRIORITY |
| 22 | + int "Priority for the ADC thread" |
| 23 | + default 0 |
| 24 | + help |
| 25 | + Priority level for the internal ADC thread. |
| 26 | + |
| 27 | +config ADC_MCP356XR_ADC_CHANNEL_COUNT |
| 28 | + int "Number of ADC channels" |
| 29 | + range 1 32 |
| 30 | + default 1 |
| 31 | + help |
| 32 | + Number of ADC channels the driver must support. Each channel |
| 33 | + requires 3 bytes of RAM to store the ADC settings to be used |
| 34 | + for this channel. |
| 35 | + |
| 36 | +config ADC_MCP356XR_USE_READ_CRC |
| 37 | + bool "Use CRC to check data received from the ADC" |
| 38 | + default y |
| 39 | + help |
| 40 | + Enables the use of CRC on read communications to check integrity |
| 41 | + of received data from the ADC. |
| 42 | + |
| 43 | +config ADC_MCP356XR_POLL |
| 44 | + bool "Poll the ADC instead of using the IRQ pin" |
| 45 | + help |
| 46 | + Regularly poll the ADC to retrieve status flags instead of |
| 47 | + waiting for the ADC triggered IRQ. Useful in case the IRQ |
| 48 | + pin of the ADC is not wired. |
| 49 | + |
| 50 | +if ADC_MCP356XR_POLL |
| 51 | +config ADC_MCP356XR_POLLING_PERIOD_MS |
| 52 | + int "Time to wait between two ADC polling in milliseconds" |
| 53 | + default 1 |
| 54 | + help |
| 55 | + Time the driver's internal acquisition thread will wait |
| 56 | + between two ADC polling (in milliseconds). |
| 57 | + |
| 58 | +endif #ADC_MCP356XR_POLL |
| 59 | + |
| 60 | +endif # ADC_MCP356XR |
0 commit comments