1.\" $NetBSD: mcp48x1dac.4,v 1.2 2015/08/23 20:07:16 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 Radoslaw Kujawa. 8.\" This code is derived from software contributed to The NetBSD Foundation 9.\" by Frank Wille. 10.\" 11.\" Redistribution and use in source and binary forms, with or without 12.\" modification, are permitted provided that the following conditions 13.\" are met: 14.\" 1. Redistributions of source code must retain the above copyright 15.\" notice, this list of conditions and the following disclaimer. 16.\" 2. Redistributions in binary form must reproduce the above copyright 17.\" notice, this list of conditions and the following disclaimer in the 18.\" documentation and/or other materials provided with the distribution. 19.\" 20.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 21.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 22.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 23.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 24.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 30.\" POSSIBILITY OF SUCH DAMAGE. 31.\" 32.Dd August 23, 2015 33.Dt MCP48X1DAC 4 34.Os 35.Sh NAME 36.Nm mcp48x1dac 37.Nd Microchip 48x1 digital to analog converter 38.Sh SYNOPSIS 39.Cd "mcp48x1dac* at spi? slave ? flags N" 40.Sh DESCRIPTION 41The 42.Nm 43driver supports the MCP48x1 family of digital to analog converters. 44The digital 45values to be converted to analog signal are passed through the 46.Xr sysctl 8 47node. 48.Pp 49The driver reports the current voltage output on the chip's DAC channel 50through the 51.Xr envsys 4 52API. 53It calculates these values assuming that internal 2.048V reference voltage 54.Li ( Vref ) 55is used. 56.Pp 57The following table shows the supported chips. 58The type of the chip can be selected with the 59.Ar flags 60argument in the config file. 61.Bl -column "Designation" "Resolution" "flags" -offset indent 62.It Sy "Designation" Ta Sy "Resolution" Ta Sy "flags" 63.It Li "MCP4801" Ta "8 bits" Ta "0" 64.It Li "MCP4811" Ta "10 bits" Ta "1" 65.It Li "MCP4821" Ta "12 bits" Ta "2" 66.El 67.Sh SYSCTL VARIABLES 68The following 69.Xr sysctl 3 70variables are provided: 71.Bl -tag -width indent 72.It machdep.mcp48x1dac0.data 73Defines digital data to be converted into analog signal. 74This value is interpreted literally and sent to the DAC without any conversion. 75Refer to the chip datasheet for more information. 76.It machdep.mcp48x1dac0.gain 77When set to 1 it enables 2x output gain on the DAC channel. 78The default value is 0. 79.El 80.Sh SEE ALSO 81.Xr envsys 4 , 82.Xr spi 4 , 83.Xr sysctl 8 84.Rs 85.%T MCP4801/4811/4821 8/10/12-Bit Voltage Output Digital-to-Analog Converter \ 86with Internal VREF and SPI Interface Data Sheet 87.Re 88.Sh HISTORY 89The 90.Nm 91driver first appeared in 92.Nx 7.0 . 93.Sh AUTHORS 94.An -nosplit 95The 96.Nm 97driver was written by 98.An Radoslaw Kujawa . 99.Pp 100This man page is based on 101.Xr mcp3kadc 4 102page by 103.An Frank Wille . 104.Sh BUGS 105There are bugs. 106