mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
[hal] Add CAN Bus Map (#8765)
We will want a better API for higher level devices that expect to be on motioncore, but for ones that are not expected to be, it'll be really nice to have an API that can let us map the motioncore can bus to its HAL index.
This commit is contained in:
45
hal/src/main/native/include/wpi/hal/CANBusMap.h
Normal file
45
hal/src/main/native/include/wpi/hal/CANBusMap.h
Normal file
@@ -0,0 +1,45 @@
|
||||
// Copyright (c) FIRST and other WPILib contributors.
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "wpi/hal/Types.h"
|
||||
|
||||
/**
|
||||
* @defgroup hal_canapi CAN BUS Mapping Enums
|
||||
* @ingroup hal_capi
|
||||
* @{
|
||||
*/
|
||||
|
||||
HAL_ENUM(HAL_CANBusMap) {
|
||||
HAL_CAN_BUS_S0 = 0,
|
||||
HAL_CAN_BUS_S1 = 1,
|
||||
HAL_CAN_BUS_S2 = 2,
|
||||
HAL_CAN_BUS_S3 = 3,
|
||||
HAL_CAN_BUS_S4 = 4,
|
||||
HAL_CAN_BUS_D0 = 5,
|
||||
HAL_CAN_BUS_D1 = 6,
|
||||
HAL_CAN_BUS_D2 = 7,
|
||||
HAL_CAN_BUS_D3 = 8,
|
||||
HAL_CAN_BUS_D4 = 9,
|
||||
HAL_CAN_BUS_D5 = 10,
|
||||
HAL_CAN_BUS_D6 = 11,
|
||||
HAL_CAN_BUS_D7 = 12,
|
||||
HAL_CAN_BUS_D8 = 13,
|
||||
HAL_CAN_BUS_D9 = 14,
|
||||
HAL_CAN_BUS_D10 = 15,
|
||||
HAL_CAN_BUS_D11 = 16,
|
||||
HAL_CAN_BUS_D12 = 17,
|
||||
HAL_CAN_BUS_D13 = 18,
|
||||
HAL_CAN_BUS_D14 = 19,
|
||||
HAL_CAN_BUS_D15 = 20,
|
||||
HAL_CAN_BUS_D16 = 21,
|
||||
HAL_CAN_BUS_D17 = 22,
|
||||
HAL_CAN_BUS_D18 = 23,
|
||||
HAL_CAN_BUS_D19 = 24,
|
||||
};
|
||||
|
||||
/** @} */
|
||||
Reference in New Issue
Block a user