Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

.\" $NetBSD: scmd.4,v 1.2 2022/01/01 09:53:32 msaitoh Exp $
.\"
.\" Copyright (c) 2021 Brad Spencer <brad@anduin.eldar.org>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd January 1, 2022
.Dt SCMD 4
.Os
.Sh NAME
.Nm scmd
.Nd Common driver for the Sparkfun Serial Controlled Motor Driver
.Sh SYNOPSIS
.Cd "scmd* at iic? ..."
.Cd "scmd* at spi? ..."
.Sh DESCRIPTION
The
.Nm
driver provides the common framework to the Sparkfun SCMD board.
The SCMD board is a Cypress core ARM SOC in front of a DRV8835 motor driver chip.
There are a number of ways to talk to the board and
.Xr scmdi2c 4
and
.Xr scmdspi 4
should be consulted for the I2C and SPI frontend drivers.
The board is fully documented in the datasheet for at Sparkfun.
.Pp
The board provides a register address space of 126 registers which control the various
behaviors of the motors attached to the board.
Each SCMD board can handle two motors,
and up to 16 SCMD boards may be chained together allowing for 34 motors to be controlled
from a single master instance.
The secondary boards are accessed by set of view port registers
from the main board.  The
.Xr scmd 4
driver and its associated frontends flatten the main SCMD board and all chained boards into
a linear register space that can be opened, seeked, read from and written to like any other
file or device without having to worry about the view port.
.Pp
A command line utility
.Xr scmdctl 1
is provided that allows convient command line commands for most of the functions provided by the
SCMD board.
.Sh SYSCTL VARIABLES
The following
.Xr sysctl 3
variables are provided:
.Bl -tag -width indent
.It Li hw.scmd0.debug
If the driver is compiled with
.Dv SCMD_DEBUG ,
this node will appear and can be used to set the debugging level.
.El
.Sh FILES
.Bl -tag -width /dev/rcaXXXXX -compact
.It Pa /dev/scmd Ns Ar u
character device allowing access to the register space of a main
.Ar u ,
SCMD device
.Sh SEE ALSO
.Xr iic 4 ,
.Xr spi 4 ,
.Xr scmdi2c 4 ,
.Xr scmdspi 4 ,
.Xr scmdctl 1 ,
.Xr sysctl 8
.Sh HISTORY
The
.Nm
driver first appeared in
.Nx 10.0 .
.Sh AUTHORS
.An -nosplit
The
.Nm
driver was written by
.An Brad Spencer Aq Mt brad@anduin.eldar.org .