mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
* Fixed cpplint.py [runtime/int] warnings * Fixed cpplint.py [readability/casting] warnings * Fixed cpplint.py [readability/namespace] warnings * Fixed cpplint.py [readability/braces] warnings * Fixed cpplint.py [whitespace/braces] warnings * Fixed cpplint.py [runtime/explicit] warnings * Fixed cpplint.py [runtime/printf] warnings * Fixed cpplint.py [readability/inheritance] warnings * Fixed cpplint.py [whitespace/tab] warnings * Fixed cpplint.py [build/storage_class] warnings * Fixed cpplint.py [readability/multiline_comment] warnings * Fixed cpplint.py [whitespace/semicolon] warnings * Fixed cpplint.py [readability/check] warnings * Fixed cpplint.py [runtime/arrays] warnings * Ran format.py
45 lines
1.5 KiB
C++
45 lines
1.5 KiB
C++
/*----------------------------------------------------------------------------*/
|
|
/* Copyright (c) FIRST 2016. All Rights Reserved. */
|
|
/* Open Source Software - may be modified and shared by FRC teams. The code */
|
|
/* must be accompanied by the FIRST BSD license file in the root directory of */
|
|
/* the project. */
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "ChipObject.h"
|
|
#include "HAL/Ports.h"
|
|
#include "HAL/cpp/priority_mutex.h"
|
|
#include "PortsInternal.h"
|
|
#include "handles/IndexedHandleResource.h"
|
|
|
|
namespace hal {
|
|
constexpr int32_t kTimebase = 40000000; ///< 40 MHz clock
|
|
constexpr int32_t kDefaultOversampleBits = 0;
|
|
constexpr int32_t kDefaultAverageBits = 7;
|
|
constexpr float kDefaultSampleRate = 50000.0;
|
|
static const uint32_t kAccumulatorChannels[] = {0, 1};
|
|
|
|
extern tAI* analogInputSystem;
|
|
extern tAO* analogOutputSystem;
|
|
extern priority_recursive_mutex analogRegisterWindowMutex;
|
|
|
|
struct AnalogPort {
|
|
uint8_t pin;
|
|
tAccumulator* accumulator;
|
|
};
|
|
|
|
extern IndexedHandleResource<HAL_AnalogInputHandle, hal::AnalogPort,
|
|
kNumAnalogInputs, HAL_HandleEnum::AnalogInput>
|
|
analogInputHandles;
|
|
|
|
uint32_t getAnalogNumActiveChannels(int32_t* status);
|
|
uint32_t getAnalogNumChannelsToActivate(int32_t* status);
|
|
void setAnalogNumChannelsToActivate(uint32_t channels);
|
|
void initializeAnalog(int32_t* status);
|
|
|
|
extern bool analogSystemInitialized;
|
|
} // namespace hal
|