1.\" $NetBSD: scmd.4,v 1.2 2022/01/01 09:53:32 msaitoh Exp $ 2.\" 3.\" Copyright (c) 2021 Brad Spencer <brad@anduin.eldar.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd January 1, 2022 18.Dt SCMD 4 19.Os 20.Sh NAME 21.Nm scmd 22.Nd Common driver for the Sparkfun Serial Controlled Motor Driver 23.Sh SYNOPSIS 24.Cd "scmd* at iic? ..." 25.Cd "scmd* at spi? ..." 26.Sh DESCRIPTION 27The 28.Nm 29driver provides the common framework to the Sparkfun SCMD board. 30The SCMD board is a Cypress core ARM SOC in front of a DRV8835 motor driver chip. 31There are a number of ways to talk to the board and 32.Xr scmdi2c 4 33and 34.Xr scmdspi 4 35should be consulted for the I2C and SPI frontend drivers. 36The board is fully documented in the datasheet for at Sparkfun. 37.Pp 38The board provides a register address space of 126 registers which control the various 39behaviors of the motors attached to the board. 40Each SCMD board can handle two motors, 41and up to 16 SCMD boards may be chained together allowing for 34 motors to be controlled 42from a single master instance. 43The secondary boards are accessed by set of view port registers 44from the main board. The 45.Xr scmd 4 46driver and its associated frontends flatten the main SCMD board and all chained boards into 47a linear register space that can be opened, seeked, read from and written to like any other 48file or device without having to worry about the view port. 49.Pp 50A command line utility 51.Xr scmdctl 1 52is provided that allows convient command line commands for most of the functions provided by the 53SCMD board. 54.Sh SYSCTL VARIABLES 55The following 56.Xr sysctl 3 57variables are provided: 58.Bl -tag -width indent 59.It Li hw.scmd0.debug 60If the driver is compiled with 61.Dv SCMD_DEBUG , 62this node will appear and can be used to set the debugging level. 63.El 64.Sh FILES 65.Bl -tag -width /dev/rcaXXXXX -compact 66.It Pa /dev/scmd Ns Ar u 67character device allowing access to the register space of a main 68.Ar u , 69SCMD device 70.Sh SEE ALSO 71.Xr iic 4 , 72.Xr spi 4 , 73.Xr scmdi2c 4 , 74.Xr scmdspi 4 , 75.Xr scmdctl 1 , 76.Xr sysctl 8 77.Sh HISTORY 78The 79.Nm 80driver first appeared in 81.Nx 10.0 . 82.Sh AUTHORS 83.An -nosplit 84The 85.Nm 86driver was written by 87.An Brad Spencer Aq Mt brad@anduin.eldar.org . 88