1.\" $NetBSD: mcp3kadc.4,v 1.2 2015/08/19 09:57:41 wiz Exp $ 2.\" 3.\" Copyright (c) 2015 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Frank Wille. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd August 18, 2015 31.Dt MCP3KADC 4 32.Os 33.Sh NAME 34.Nm mcp3kadc 35.Nd Microchip 3x0x SAR analog to digital converter 36.Sh SYNOPSIS 37.Cd "mcp3kadc* at spi? slave ? flags N" 38.Sh DESCRIPTION 39The 40.Nm 41driver reports the current voltage on the chip's ADC channels through the 42.Xr envsys 4 43API. 44The driver calculates these values according to the currently selected 45reference voltage 46.Li ( Vref ) . 47It can be changed through the 48.Xr sysctl 8 49node 50.Li hw.mcp3kadc0.vref . 51.Pp 52The following table shows the supported chips. 53The type of the chip can be selected with the 54.Ar flags 55argument in the config file. 56.Bl -column "Designation" "Resolution" "Input Channels" "flags" -offset indent 57.It Sy "Designation" Ta Sy "Resolution" Ta Sy "Input Channels" Ta Sy "flags" 58.It Li "MCP3001" Ta "10 bits" Ta "1" Ta "0" 59.It Li "MCP3002" Ta "10 bits" Ta "2" Ta "1" 60.It Li "MCP3004" Ta "10 bits" Ta "4" Ta "2" 61.It Li "MCP3008" Ta "10 bits" Ta "8" Ta "3" 62.It Li "MCP3201" Ta "12 bits" Ta "1" Ta "4" 63.It Li "MCP3202" Ta "12 bits" Ta "2" Ta "5" 64.It Li "MCP3204" Ta "12 bits" Ta "4" Ta "6" 65.It Li "MCP3208" Ta "12 bits" Ta "8" Ta "7" 66.It Li "MCP3301" Ta "13 bits" Ta "1" Ta "8" 67.It Li "MCP3302" Ta "13 bits" Ta "4" Ta "9" 68.It Li "MCP3304" Ta "13 bits" Ta "8" Ta "10" 69.El 70.Sh SYSCTL VARIABLES 71The following 72.Xr sysctl 3 73variables are provided: 74.Bl -tag -width indent 75.It hw.mcp3kadc0.vref 76Defines the reference voltage on the chip's 77.Li Vref 78pin in millivolts (mV). 79It defaults to the ADC's maximum output value + 1 80in millivolts (e.g., 4096 for a 12-bit ADC). 81.El 82.Sh SEE ALSO 83.Xr envsys 4 , 84.Xr spi 4 , 85.Xr sysctl 8 86.Sh HISTORY 87The 88.Nm 89driver first appeared in 90.Nx 8.0 . 91.Sh AUTHORS 92The 93.Nm 94driver was written by 95.An Frank Wille . 96