-
Notifications
You must be signed in to change notification settings - Fork 7
FetchCommands
“An Artificially Intelligent System would be much taller." - Anonymous Product Developer
Commands are read from left to right. In this direction they also read from general to specific. In the example:
gpio:clear:porth:pin2
The most general part of the command is the gpio.
If we think about a command as a sentence, gpio would be the object and the rest of the sentence would be a story about the gpio.
We can also think about constructing commands as traversing a hierarchy from general to specific. For instance from a prompt we have these choices:
Picking the GPIO choice opens up all the choices for GPIO type commands.
We can build a command to configure portb pin3 as an output with a pullup by traversing increasingly specific commands...until we can go no farther.
- Reset the state of the pins to defaults.
- Print help about the commands available.
- Toggles an LED heartbeat display on the device.
- Currently uses four (4) LEDs as demonstration
- Discussion needed
- Should new commands be added to assign HB pins?
LED | PIN |
---|---|
LED1 | PH2 |
LED2 | PH3 |
LED3 | PI8 |
LED4 | PI10 |
- Print the version of the firmware installed.
Usage, please see example above.
Get the current value of the pin {0,1} from the input buffer.
Set the value of the pin {0,1}. This will write the output buffer to HIGH (0b1).
Clear the output buffer -- That is a LOW (0b0) will be written to the output buffer.
Report how pin is assigned.
Configure the buffer. Output, input and gain settings.
Configure the ADC1 peripheral.
Start a conversion. (see oneshot and continuous)
Stop a conversion. (see oneshot and continuous)
Set a profile for the peripheral. Profiles include:
-
default:
- One pin sampled (ADC1 IN13) for 56 cycles x 10 samples. Average reported.
-
PA: 16 Channels - All available channels for Waveshare (This includes Temp, VBAT, VRefInt).
Channel | Pin | Cycles | Samples | Report |
---|---|---|---|---|
IN0 | gpioA pin0 | 56 | 1 | average |
IN1 | gpioA pin1 | 56 | 1 | average |
IN2 | gpioA pin2 | 56 | 1 | average |
IN3 | gpioA pin3 | 56 | 1 | average |
IN4 | gpioA pin4 | 56 | 1 | average |
IN5 | gpioA pin5 | 56 | 1 | average |
IN6 | gpioA pin6 | 56 | 1 | average |
IN7 | gpioA pin7 | 56 | 1 | average |
IN8 | gpioB pin0 | 56 | 1 | average |
IN10 | gpioC pin0 | 56 | 1 | average |
IN13 | gpioC pin3 | 56 | 1 | average |
IN14 | gpioC pin4 | 56 | 1 | average |
IN15 | gpioC pin5 | 56 | 1 | average |
IN16 | Temp | 56 | 1 | C |
IN17 | VRefInt | 56 | 1 | average |
IN18 | VBattery | 56 | 1 | average |
adc:conf_adc1:profile:pa
adc:conf_adc1:oneshot
adc:start
U32:time:36255
U32:adc:1439340,730135,416185,140875,132825,350175,309120,522445,473340,341320,1395870,787290,1408750,24,1205890,1669570
adc:start
U32:time:36456
U32:adc:1439340,827540,460460,148120,131215,355810,331660,530495,490245,363860,1396675,848470,1407945,24,1206695,1670375
adc:conf_adc1:profile:default
adc:conf_adc1:oneshot
adc:start
U32:time:37058
U32:adc:1420825
- PB: TBD
Profiles simplify configuration of complex peripherals like the ADC. It also helps to consistently configure a base setting.
Profiles contain information for:
- Reference Voltage (on Vref+ pin) relative to VSS.
- Input Pin(s) for conversion.
- Analog GPIO mode for conversion pins.
- Scan settings for multiple pins and DMA modes.
- Data output format after conversion.
- For instance: Data may be delivered in raw or converted forms
The idea of profiles is still under active development Thu 31 July 2014 16:35:48 (PDT).
Complete one conversion of input pin(s) and return the result.
Begin a new conversion as soon as previous conversion has completed and the output has been delivered to the serial connection.
Reset the ADC to the default profile.
Available profiles to be documented ... Thu 31 July 2014 16:38:12 (PDT)
mV - Value in millivolts of Vref+. This is set by external circuitry and used to convert raw values to voltages.
DAC Channel connection are shared with ADC.
Channel | Pin |
---|---|
CH1 | gpioA pin4 |
CH2 | gpioA pin5 |
- Start a DAC conversion (enable outputs).
- Stop the DAC conversion.
- Stop the DAC conversion and release the assigned pins to their default mode.
- Reset the DAC to default values and vref_mv.
- Set the vref_mv.
- Configure Channel 1 of the DAC
- Configure Channel 2 of the DAC
- Minimum setting is 0, negative values will fail.
- Maximum setting is vref_mv, a setting greater than this will be output vref_mv.
- Not yet available Thu 31 July 2014 16:40:49 (PDT)
- Not yet available Thu 31 July 2014 16:40:49 (PDT)