CTRE Phoenix C++ 5.33.1
CANifier_CCI.h
Go to the documentation of this file.
1/* Copyright (C) Cross The Road Electronics 2024 */
2#pragma once
3
6#include <set>
7#include <cstddef>
8
9namespace CANifier_CCI{
12 QUAD_B = 1,
13 QUAD_A = 2,
14 LIMR = 3,
15 LIMF = 4,
16 SDA = 5,
17 SCL = 6,
18 SPI_CS = 7,
22 };
23}
24
25extern "C"{
26 CCIEXPORT void *c_CANifier_Create1(int deviceNumber);
29 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetDescription(void *handle, char * toFill, int toFillByteSz, size_t * numBytesFilled);
30 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetLEDOutput(void *handle, uint32_t dutyCycle, uint32_t ledChannel);
31 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetGeneralOutputs(void *handle, uint32_t outputsBits, uint32_t isOutputBits);
32 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetGeneralOutput(void *handle, uint32_t outputPin, bool outputValue, bool outputEnable);
33 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetPWMOutput(void *handle, uint32_t pwmChannel, uint32_t dutyCycle);
34 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_EnablePWMOutput(void *handle, uint32_t pwmChannel, bool bEnable);
35 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetGeneralInputs(void *handle, bool allPins[], uint32_t capacity);
36 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetGeneralInput(void *handle, uint32_t inputPin, bool * measuredInput);
37 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetPWMInput(void *handle, uint32_t pwmChannel, double dutyCycleAndPeriod [2]);
39 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetBusVoltage(void *handle, double * batteryVoltage);
47 bool clearPositionOnLimitF, int timeoutMs);
49 bool clearPositionOnLimitR, int timeoutMs);
51 bool clearPositionOnQuadIdx, int timeoutMs);
52 CCIEXPORT void c_CANifier_SetLastError(void *handle, int error);
53 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigSetParameter(void *handle, int param, double value, uint8_t subValue, int ordinal, int timeoutMs);
54 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigGetParameter(void *handle, int param, double *value, int ordinal, int timeoutMs);
55 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigGetParameter_6(void *handle, int32_t param, int32_t valueToSend, int32_t * valueRecieved, uint8_t * subValue, int32_t ordinal, int32_t timeoutMs);
56 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigSetCustomParam(void *handle, int newValue, int paramIndex, int timeoutMs);
57 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigGetCustomParam(void *handle, int *readValue, int paramIndex, int timoutMs);
64 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetStatusFramePeriod(void *handle, int frame, uint8_t periodMs, int timeoutMs);
65 CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetStatusFramePeriod(void *handle, int frame, int *periodMs, int timeoutMs);
67}
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetGeneralInput(void *handle, uint32_t inputPin, bool *measuredInput)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetDescription(void *handle, char *toFill, int toFillByteSz, size_t *numBytesFilled)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigGetParameter(void *handle, int param, double *value, int ordinal, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigGetCustomParam(void *handle, int *readValue, int paramIndex, int timoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetQuadraturePosition(void *handle, int pos, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetStickyFaults(void *handle, int *param)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetGeneralOutput(void *handle, uint32_t outputPin, bool outputValue, bool outputEnable)
CCIEXPORT void * c_CANifier_Create1(int deviceNumber)
CCIEXPORT void c_CANifier_SetLastError(void *handle, int error)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetStatusFramePeriod(void *handle, int frame, uint8_t periodMs, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetBusVoltage(void *handle, double *batteryVoltage)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetQuadratureSensor(void *handle, int *pos, int *vel)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetGeneralInputs(void *handle, bool allPins[], uint32_t capacity)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetQuadratureVelocity(void *handle, int *vel)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_Destroy(void *handle)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigSetParameter(void *handle, int param, double value, uint8_t subValue, int ordinal, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigClearPositionOnQuadIdx(void *handle, bool clearPositionOnQuadIdx, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigVelocityMeasurementPeriod(void *handle, int period, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_HasResetOccurred(void *handle, bool *hasReset)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetLastError(void *handle)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigVelocityMeasurementWindow(void *handle, int window, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetPWMOutput(void *handle, uint32_t pwmChannel, uint32_t dutyCycle)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetPWMInput(void *handle, uint32_t pwmChannel, double dutyCycleAndPeriod[2])
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetGeneralOutputs(void *handle, uint32_t outputsBits, uint32_t isOutputBits)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetFirmwareVersion(void *handle, int *firmwareVers)
CCIEXPORT void c_CANifier_DestroyAll()
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigClearPositionOnLimitR(void *handle, bool clearPositionOnLimitR, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ClearStickyFaults(void *handle, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_EnablePWMOutput(void *handle, uint32_t pwmChannel, bool bEnable)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigGetParameter_6(void *handle, int32_t param, int32_t valueToSend, int32_t *valueRecieved, uint8_t *subValue, int32_t ordinal, int32_t timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetFaults(void *handle, int *param)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetLEDOutput(void *handle, uint32_t dutyCycle, uint32_t ledChannel)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetStatusFramePeriod(void *handle, int frame, int *periodMs, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_SetControlFramePeriod(void *handle, int frame, int periodMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigClearPositionOnLimitF(void *handle, bool clearPositionOnLimitF, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_GetQuadraturePosition(void *handle, int *pos)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigSetCustomParam(void *handle, int newValue, int paramIndex, int timeoutMs)
CCIEXPORT ctre::phoenix::ErrorCode c_CANifier_ConfigFactoryDefault(void *handle, int timeoutMs)
#define CCIEXPORT
Definition: CCI.h:10
Definition: CANifier_CCI.h:9
GeneralPin
Definition: CANifier_CCI.h:10
@ SCL
Definition: CANifier_CCI.h:17
@ QUAD_IDX
Definition: CANifier_CCI.h:11
@ SPI_MOSI_PWM1P
Definition: CANifier_CCI.h:20
@ QUAD_A
Definition: CANifier_CCI.h:13
@ SPI_MISO_PWM2P
Definition: CANifier_CCI.h:19
@ QUAD_B
Definition: CANifier_CCI.h:12
@ LIMF
Definition: CANifier_CCI.h:15
@ SPI_CS
Definition: CANifier_CCI.h:18
@ LIMR
Definition: CANifier_CCI.h:14
@ SDA
Definition: CANifier_CCI.h:16
@ SPI_CLK_PWM0P
Definition: CANifier_CCI.h:21
ErrorCode
Definition: ErrorCode.h:13