VMX-pi C++ HAL Library for Raspberry Pi
VMX-pi Robotics Controller & Vision/Motion Processor
VMXChannel.h
Go to the documentation of this file.
1 /* ============================================
2 VMX-pi HAL source code is placed under the MIT license
3 Copyright (c) 2017 Kauai Labs
4 Permission is hereby granted, free of charge, to any person obtaining a copy
5 of this software and associated documentation files (the "Software"), to deal
6 in the Software without restriction, including without limitation the rights
7 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 copies of the Software, and to permit persons to whom the Software is
9 furnished to do so, subject to the following conditions:
10 The above copyright notice and this permission notice shall be included in
11 all copies or substantial portions of the Software.
12 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
14 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
15 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
16 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
17 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
18 THE SOFTWARE.
19 ===============================================
20 */
21 
22 #ifndef VMXCHANNEL_H_
23 #define VMXCHANNEL_H_
24 
27 #include <stdint.h>
28 
29 /* Each VMXChannel has zero or more of the following Capabilities */
30 /* Some of these Capabilities are dynamic, and may be changed via
31  * jumper (e.g., VMX PWM/DigInput jumper). However, their state at the
32  * beginning of the application will not change during the lifetime of the
33  * application.
34  *
35  * When VMXChannel Capabilities refer to Shared Resources, there is no
36  * guarantee that at any instant a VMXChannel can be configured with this,
37  * as VMXChannels must be routed to resources w/sufficient availability
38  * in order for the VMXChannel capability to be active.
39  */
40 
42 typedef enum {
43  INVALID = 0,
47  FlexDIO = 1,
49  AnalogIn = 2,
54  HiCurrDIO = 3,
59  CommDIO = 4,
60  CommI2C = 5
62 
64 typedef enum {
65  None = 0x00000000,
67  DigitalInput = 0x00000001,
69  DigitalOutput = 0x00000002,
71  PWMGeneratorOutput = 0x00000004,
73  PWMGeneratorOutput2 = 0x00000008,
75  PWMCaptureInput = 0x00000010,
77  EncoderAInput = 0x00000020,
79  EncoderBInput = 0x00000040,
81  AccumulatorInput = 0x00000080,
83  AnalogTriggerInput = 0x00000100,
85  InterruptInput = 0x00000200,
87  UART_TX = 0x00000400,
89  UART_RX = 0x00000800,
91  SPI_CLK = 0x00001000,
93  SPI_MISO = 0x00002000,
95  SPI_MOSI = 0x00004000,
97  SPI_CS = 0x00008000,
99  I2C_SDA = 0x00010000,
101  I2C_SCL = 0x00020000,
103 
105 typedef uint8_t VMXChannelIndex;
106 
109 
110 #endif /* VMXCHANNEL_H_ */
The VMX Channel can be routed to a DigitalIO resource in output mode.
Definition: VMXChannel.h:69
The VMX Channel can be routed to an Encoder resource&#39;s B (second) port.
Definition: VMXChannel.h:79
The VMX Channel can be routed to a I2C resource&#39;s SCL port.
Definition: VMXChannel.h:101
The VMX Channel can be routed to a SPI resource&#39;s MISO port.
Definition: VMXChannel.h:93
The VMX Channel can be routed to a PWM Generator resource&#39;s second port.
Definition: VMXChannel.h:73
The VMX Channel can be routed to a SPI resource&#39;s CLK port.
Definition: VMXChannel.h:91
The VMX Channel can be routed to a DigitalIO resource in input mode.
Definition: VMXChannel.h:67
The VMX Channel can be routed to an Encoder resource&#39;s A (first) port.
Definition: VMXChannel.h:77
The VMX Channel can be routed to a PWM Capture resource.
Definition: VMXChannel.h:75
The VMX Channel can be routed to a I2C resource&#39;s SDA port.
Definition: VMXChannel.h:99
uint8_t VMXChannelIndex
Type representing the 0-based index of a VMX Channel.
Definition: VMXChannel.h:105
AnalogIn Channels are dedicated as inputs to AnalogAccumulator and AnalogTrigger resources.
Definition: VMXChannel.h:49
The VMX Channel can be routed to a UART resource&#39;s TX port.
Definition: VMXChannel.h:87
The VMX Channel can be routed to an Analog Trigger resource.
Definition: VMXChannel.h:83
The VMX Channel can be routed to an Accumulator resource.
Definition: VMXChannel.h:81
HiCurrDIO Channels can all be configured as either input or output.
Definition: VMXChannel.h:54
The VMX Channel can be routed to a SPI resource&#39;s MOSI port.
Definition: VMXChannel.h:95
CommDIO Channels are fixed as either inputs or outputs; they can be used with the UART...
Definition: VMXChannel.h:59
The VMX Channel can be routed to a PWM Generator resource&#39;s first port.
Definition: VMXChannel.h:71
The VMX Channel can be routed to an Interrupt resource.
Definition: VMXChannel.h:85
VMXChannelCapability
Enumeration of VMX Channel Capabilities.
Definition: VMXChannel.h:64
VMXChannelType
Enumeration of VMX Channel types.
Definition: VMXChannel.h:42
const VMXChannelIndex INVALID_VMX_CHANNEL_INDEX
Constant representing an invalid VMXChannelIndex.
Definition: VMXChannel.h:108
The VMX Channel can be routed to a SPI resource&#39;s CS port.
Definition: VMXChannel.h:97
FlexDIO Channels can be configured as input or output, and can also be used with VMX-pi Encoder...
Definition: VMXChannel.h:47
The VMX Channel can be routed to a UART resource&#39;s RX port.
Definition: VMXChannel.h:89