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 edu.wpi.first.hal; 006 007/** 008 * Ports HAL JNI functions. 009 * 010 * @see "hal/Ports.h" 011 */ 012public class PortsJNI extends JNIWrapper { 013 /** 014 * Gets the number of can buses in the current system. 015 * 016 * @return the number of can buses 017 * @see "HAL_GetNumCanBuses" 018 */ 019 public static native int getNumCanBuses(); 020 021 /** 022 * Gets the number of analog inputs in the current system. 023 * 024 * @return the number of analog inputs 025 * @see "HAL_GetNumAnalogInputs" 026 */ 027 public static native int getNumAnalogInputs(); 028 029 /** 030 * Gets the number of counters in the current system. 031 * 032 * @return the number of counters 033 * @see "HAL_GetNumCounters" 034 */ 035 public static native int getNumCounters(); 036 037 /** 038 * Gets the number of digital channels in the current system. 039 * 040 * @return the number of digital channels 041 * @see "HAL_GetNumDigitalChannels" 042 */ 043 public static native int getNumDigitalChannels(); 044 045 /** 046 * Gets the number of PWM channels in the current system. 047 * 048 * @return the number of PWM channels 049 * @see "HAL_GetNumPWMChannels" 050 */ 051 public static native int getNumPWMChannels(); 052 053 /** 054 * Gets the number of digital IO PWM outputs in the current system. 055 * 056 * @return the number of digital IO PWM outputs 057 * @see "HAL_GetNumDigitalPWMOutputs" 058 */ 059 public static native int getNumDigitalPWMOutputs(); 060 061 /** 062 * Gets the number of quadrature encoders in the current system. 063 * 064 * @return the number of quadrature encoders 065 * @see "HAL_GetNumEncoders" 066 */ 067 public static native int getNumEncoders(); 068 069 /** 070 * Gets the number of interrupts in the current system. 071 * 072 * @return the number of interrupts 073 * @see "HAL_GetNumInterrupts" 074 */ 075 public static native int getNumInterrupts(); 076 077 /** 078 * Gets the number of PCM modules in the current system. 079 * 080 * @return the number of PCM modules 081 * @see "HAL_GetNumCTREPCMModules" 082 */ 083 public static native int getNumCTREPCMModules(); 084 085 /** 086 * Gets the number of solenoid channels in the current system. 087 * 088 * @return the number of solenoid channels 089 * @see "HAL_GetNumCTRESolenoidChannels" 090 */ 091 public static native int getNumCTRESolenoidChannels(); 092 093 /** 094 * Gets the number of PDP modules in the current system. 095 * 096 * @return the number of PDP modules 097 * @see "HAL_GetNumCTREPDPModules" 098 */ 099 public static native int getNumCTREPDPModules(); 100 101 /** 102 * Gets the number of PDP channels in the current system. 103 * 104 * @return the number of PDP channels 105 * @see "HAL_GetNumCTREPDPChannels" 106 */ 107 public static native int getNumCTREPDPChannels(); 108 109 /** 110 * Gets the number of PDH modules in the current system. 111 * 112 * @return the number of PDH modules 113 * @see "HAL_GetNumREVPDHModules" 114 */ 115 public static native int getNumREVPDHModules(); 116 117 /** 118 * Gets the number of PDH channels in the current system. 119 * 120 * @return the number of PDH channels 121 * @see "HAL_GetNumREVPDHChannels" 122 */ 123 public static native int getNumREVPDHChannels(); 124 125 /** 126 * Gets the number of PH modules in the current system. 127 * 128 * @return the number of PH modules 129 * @see "HAL_GetNumREVPHModules" 130 */ 131 public static native int getNumREVPHModules(); 132 133 /** 134 * Gets the number of PH channels in the current system. 135 * 136 * @return the number of PH channels 137 * @see "HAL_GetNumREVPHChannels" 138 */ 139 public static native int getNumREVPHChannels(); 140 141 /** Utility class. */ 142 private PortsJNI() {} 143}