001// Copyright (c) FIRST and other WPILib contributors. 002// Open Source Software; you can modify and/or share it under the terms of 003// the WPILib BSD license file in the root directory of this project. 004 005package org.wpilib.system; 006 007import org.wpilib.hardware.hal.PortsJNI; 008 009/** 010 * Stores most recent status information as well as containing utility functions for checking 011 * channels and error processing. 012 */ 013public final class SensorUtil { 014 /** Number of SmartIo Ports. */ 015 public static final int kSmartIoPorts = PortsJNI.getNumSmartIo(); 016 017 /** Number of solenoid channels per module. */ 018 public static final int NUM_CTRE_SOLENOID_CHANNELS = PortsJNI.getNumCTRESolenoidChannels(); 019 020 /** Number of power distribution channels per PDP. */ 021 public static final int NUM_CTRE_PDP_CHANNELS = PortsJNI.getNumCTREPDPChannels(); 022 023 /** Number of power distribution modules per PDP. */ 024 public static final int NUM_CTRE_PDP_MODULES = PortsJNI.getNumCTREPDPModules(); 025 026 /** Number of PCM Modules. */ 027 public static final int NUM_CTRE_PCM_MODULES = PortsJNI.getNumCTREPCMModules(); 028 029 /** Number of power distribution channels per PH. */ 030 public static final int NUM_REV_PH_CHANNELS = PortsJNI.getNumREVPHChannels(); 031 032 /** Number of PH modules. */ 033 public static final int NUM_REV_PH_MODULES = PortsJNI.getNumREVPHModules(); 034 035 /** 036 * Get the number of the default solenoid module. 037 * 038 * @return The number of the default solenoid module. 039 */ 040 public static int getDefaultCTREPCMModule() { 041 return 0; 042 } 043 044 /** 045 * Get the number of the default solenoid module. 046 * 047 * @return The number of the default solenoid module. 048 */ 049 public static int getDefaultREVPHModule() { 050 return 1; 051 } 052 053 private SensorUtil() {} 054}