1 1.1 brad /* $NetBSD: scmdctl.h,v 1.1 2021/12/07 17:39:55 brad Exp $ */ 2 1.1 brad 3 1.1 brad /* 4 1.1 brad * Copyright (c) 2021 Brad Spencer <brad (at) anduin.eldar.org> 5 1.1 brad * 6 1.1 brad * Permission to use, copy, modify, and distribute this software for any 7 1.1 brad * purpose with or without fee is hereby granted, provided that the above 8 1.1 brad * copyright notice and this permission notice appear in all copies. 9 1.1 brad * 10 1.1 brad * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 11 1.1 brad * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 12 1.1 brad * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 13 1.1 brad * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 14 1.1 brad * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 15 1.1 brad * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16 1.1 brad * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17 1.1 brad */ 18 1.1 brad 19 1.1 brad #ifndef _SCMDCTL_H_ 20 1.1 brad #define _SCMDCTL_H_ 21 1.1 brad 22 1.1 brad #define SCMD_IDENTIFY 1 23 1.1 brad #define SCMD_DIAG 2 24 1.1 brad #define SCMD_MOTOR 3 25 1.1 brad #define SCMD_SUBMOTORGET 3000 26 1.1 brad #define SCMD_SUBMOTORSET 3001 27 1.1 brad #define SCMD_SUBMOTORINVERT 3002 28 1.1 brad #define SCMD_SUBMOTORBRIDGE 3003 29 1.1 brad #define SCMD_SUBMOTORDISABLE 3004 30 1.1 brad #define SCMD_SUBMOTORENABLE 3005 31 1.1 brad #define SCMD_READ 4 32 1.1 brad #define SCMD_WRITE 5 33 1.1 brad #define SCMD_RESTART 6 34 1.1 brad #define SCMD_ENUMERATE 7 35 1.1 brad #define SCMD_UPDATERATE 8 36 1.1 brad #define SCMD_SUBURGET 8000 37 1.1 brad #define SCMD_SUBURSET 8001 38 1.1 brad #define SCMD_SUBURFORCE 8002 39 1.1 brad #define SCMD_EBUS 9 40 1.1 brad #define SCMD_SUBEBUSGET 9000 41 1.1 brad #define SCMD_SUBEBUSSET 9001 42 1.1 brad #define SCMD_LOCK 10 43 1.1 brad #define SCMD_SUBLOCKGET 10000 44 1.1 brad #define SCMD_SUBLOCKLOCK 10001 45 1.1 brad #define SCMD_SUBLOCKUNLOCK 10002 46 1.1 brad #define SCMD_SPIREADONE 11 47 1.1 brad 48 1.1 brad #define SCMD_ENABLE 100 49 1.1 brad #define SCMD_DISABLE 101 50 1.1 brad 51 1.1 brad #define SCMD_ANY_MODULE 0xff 52 1.1 brad #define SCMD_ANY_MOTOR 'C' 53 1.1 brad #define SCMD_NO_MOTOR 0xff00 54 1.1 brad 55 1.1 brad #define SCMD_LOCAL_USER_LOCK 12000 56 1.1 brad #define SCMD_LOCAL_MASTER_LOCK 12001 57 1.1 brad #define SCMD_GLOBAL_USER_LOCK 12002 58 1.1 brad #define SCMD_GLOBAL_MASTER_LOCK 12003 59 1.1 brad #define SCMD_LOCK_LOCKED 0x00 60 1.1 brad #define SCMD_LOCK_UNLOCK 0x01 61 1.1 brad 62 1.1 brad #define UART_IS_PURE_UART 0 63 1.1 brad #define UART_IS_SPI_USERLAND 1 64 1.1 brad 65 1.1 brad struct scmdcmd { 66 1.1 brad const char *cmd; 67 1.1 brad const int id; 68 1.1 brad const char *helpargs; 69 1.1 brad }; 70 1.1 brad 71 1.1 brad #endif 72