Home | History | Annotate | Line # | Download | only in scmdctl
      1  1.1  brad /*	$NetBSD: common.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 _COMMON_H_
     20  1.1  brad #define _COMMON_H_
     21  1.1  brad 
     22  1.1  brad #include "responses.h"
     23  1.1  brad 
     24  1.1  brad struct function_block {
     25  1.1  brad 	int	(*func_clear)(int, bool);
     26  1.1  brad 	int	(*func_phy_read)(int, bool, int, uint8_t, uint8_t, uint8_t *);
     27  1.1  brad 	int	(*func_phy_write)(int, bool, int, uint8_t, uint8_t);
     28  1.1  brad };
     29  1.1  brad 
     30  1.1  brad EXTERN int decode_motor_level(int);
     31  1.1  brad EXTERN int common_clear(struct function_block *, int, bool);
     32  1.1  brad EXTERN int common_identify(struct function_block *, int, bool, int, struct scmd_identify_response *);
     33  1.1  brad EXTERN int common_diag(struct function_block *, int, bool, int, struct scmd_diag_response *);
     34  1.1  brad EXTERN int common_get_motor(struct function_block *, int, bool, int, struct scmd_motor_response *);
     35  1.1  brad EXTERN int common_set_motor(struct function_block *, int, bool, int, char, int8_t);
     36  1.1  brad EXTERN int common_invert_motor(struct function_block *, int, bool, int, char);
     37  1.1  brad EXTERN int common_bridge_motor(struct function_block *, int, bool, int);
     38  1.1  brad EXTERN int common_enable_disable(struct function_block *, int, bool, int);
     39  1.1  brad EXTERN int common_control_1(struct function_block *, int, bool, int);
     40  1.1  brad EXTERN int common_get_update_rate(struct function_block *, int, bool, uint8_t *);
     41  1.1  brad EXTERN int common_set_update_rate(struct function_block *, int, bool, uint8_t);
     42  1.1  brad EXTERN int common_force_update(struct function_block *, int, bool);
     43  1.1  brad EXTERN int common_get_ebus_speed(struct function_block *, int, bool, uint8_t *);
     44  1.1  brad EXTERN int common_set_ebus_speed(struct function_block *, int, bool, uint8_t);
     45  1.1  brad EXTERN int common_get_lock_state(struct function_block *, int, bool, int, uint8_t *);
     46  1.1  brad EXTERN int common_set_lock_state(struct function_block *, int, bool, int, uint8_t);
     47  1.1  brad 
     48  1.1  brad #endif
     49