![]() |
Cortex configuration macros and prototypes. More...
Go to the source code of this file.
Data Structures | |
| struct | _vexDigiCfg |
| Structure holding information to configure a single digital pin. More... | |
| struct | _vexMotorCfg |
| Structure holding information to configure a single motor. More... | |
Macros | |
| #define | DIG_CONFIG_SIZE(x) sizeof( x ) / sizeof( vexDigiCfg ) |
| Macro to calculate the number of entries in digital config. More... | |
| #define | MOT_CONFIG_SIZE(x) sizeof( x ) / sizeof( vexMotorCfg ) |
| Macro to calculate the number of entries in motor config. More... | |
Typedefs | |
| typedef struct _vexDigiCfg | vexDigiCfg |
| Structure holding information to configure a single digital pin. More... | |
| typedef struct _vexMotorCfg | vexMotorCfg |
| Structure holding information to configure a single motor. More... | |
Enumerations | |
| enum | tVexSensorType { kVexSensorNone = 0, kVexSensorDigitalInput, kVexSensorDigitalOutput, kVexSensorQuadEncoder, kVexSensorSonarCm, kVexSensorSonarInch, kVexSensorIME, kVexSensorPotentiometer, kVexSensorInterrupt } |
| Sensor types for cortex configuration. More... | |
| enum | tVexDigitalConfig { kVexConfigInput = kVexDigitalInput, kVexConfigOutput = kVexDigitalOutput, kVexConfigQuadEnc1 = 10, kVexConfigQuadEnc2, kVexConfigSonarOut, kVexConfigSonarIn, kVexConfigInterrupt } |
| A digital pin can be of the following type. More... | |
Functions | |
| void | vexDigitalConfigure (vexDigiCfg *cfg, int16_t cfg_num) |
| Configure digital ports. More... | |
| void | vexMotorConfigure (vexMotorCfg *cfg, int16_t cfg_num) |
| Configure motors based on a configuration structure. More... | |
| tVexSensorType | vexDigitalTypeGet (tVexDigitalPin pin) |
| Get the sensor type given pin number. More... | |
| char * | vexDigitalTypeGetName (tVexDigitalPin pin) |
| Get the sensor name given pin number. More... | |
| uint16_t | vexDigitalChannelGet (tVexDigitalPin pin) |
| Get the sensor channel given pin number. More... | |
| uint16_t | vexDigitalCfgGet (tVexDigitalPin pin) |
| Get the sensor config given pin number. More... | |
Cortex configuration macros and prototypes.
| #define DIG_CONFIG_SIZE | ( | x) | sizeof( x ) / sizeof( vexDigiCfg ) |
Macro to calculate the number of entries in digital config.
| #define MOT_CONFIG_SIZE | ( | x) | sizeof( x ) / sizeof( vexMotorCfg ) |
Macro to calculate the number of entries in motor config.
| typedef struct _vexDigiCfg vexDigiCfg |
Structure holding information to configure a single digital pin.
| typedef struct _vexMotorCfg vexMotorCfg |
Structure holding information to configure a single motor.
| enum tVexSensorType |
| enum tVexDigitalConfig |
A digital pin can be of the following type.
Although a digital IO pin can in reality only be configured as either an input or output, they can also have additional functionality depending on the intended function, for example, a quad encoder uses two digital pins, both are inputs but we also define them as QuadEnc1 or QuadEnc2
| Enumerator | |
|---|---|
| kVexConfigInput | |
| kVexConfigOutput | |
| kVexConfigQuadEnc1 | |
| kVexConfigQuadEnc2 | |
| kVexConfigSonarOut | |
| kVexConfigSonarIn | |
| kVexConfigInterrupt | |
| void vexDigitalConfigure | ( | vexDigiCfg * | cfg, |
| int16_t | cfg_num | ||
| ) |
Configure digital ports.
| [in] | cfg | pointer to vexDigiCfg structure |
| [in] | cfg_num | number of entries in the cfg structure |
Configure digital ports based on a configuration structure
| void vexMotorConfigure | ( | vexMotorCfg * | cfg, |
| int16_t | cfg_num | ||
| ) |
Configure motors based on a configuration structure.
Configure motors based on a configuration structure. This is primarily to link a motor with a position sensor such as an IME
| tVexSensorType vexDigitalTypeGet | ( | tVexDigitalPin | pin) |
Get the sensor type given pin number.
| [in] | pin | The pin number |
| char* vexDigitalTypeGetName | ( | tVexDigitalPin | pin) |
Get the sensor name given pin number.
| [in] | pin | The pin number |
| uint16_t vexDigitalChannelGet | ( | tVexDigitalPin | pin) |
Get the sensor channel given pin number.
| [in] | pin | The pin number |
| uint16_t vexDigitalCfgGet | ( | tVexDigitalPin | pin) |
Get the sensor config given pin number.
| [in] | pin | The pin number |
The configuration is sensor dependent, eg. sonar output or input