removed hexa and renumbered neopixel commands

master
Ondřej Hruška 7 years ago
parent b63ca927af
commit 7a4a909d11
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 10
      UNIT_DI.md
  2. 10
      UNIT_DO.md
  3. 8
      UNIT_I2C.md
  4. 14
      UNIT_NEOPIXEL.md
  5. 10
      UNIT_PWMDIM.md
  6. 10
      UNIT_SIPO.md
  7. 4
      UNIT_SPI.md
  8. 14
      UNIT_TOUCH.md
  9. 12
      UNIT_USART.md

@ -7,13 +7,13 @@ Pins are described using the packed format (see [UNIT_DO.md](UNIT_DO.md))
## Commands ## Commands
### READ (0x00) ### READ (0)
Read all pins. Read all pins.
*Response:* *Response:*
- u16 - pin states (packed) - u16 - pin states (packed)
### ARM_SINGLE (0x01) ### ARM_SINGLE (1)
Arm a pin or pins for a change detection. Arm a pin or pins for a change detection.
The active edge is defined in the unit settings. The active edge is defined in the unit settings.
The pins are dis-armed again after a detected event. The pins are dis-armed again after a detected event.
@ -21,14 +21,14 @@ The pins are dis-armed again after a detected event.
*Request:* *Request:*
- u16 - pins to arm (packed) - u16 - pins to arm (packed)
### ARM_AUTO (0x02) ### ARM_AUTO (2)
Arm a pin or pins for a change detection with automatic re-arm. Arm a pin or pins for a change detection with automatic re-arm.
The active edge is defined in the unit settings. The active edge is defined in the unit settings.
*Request:* *Request:*
- u16 - pins to arm (packed) - u16 - pins to arm (packed)
### DISARM (0x03) ### DISARM (3)
Disable change detection on the selected pins. Disable change detection on the selected pins.
*Request:* *Request:*
@ -36,7 +36,7 @@ Disable change detection on the selected pins.
## Events ## Events
### PIN_CHANGE (0x00) ### PIN_CHANGE (0)
External interrupt, pin change(s) detected. External interrupt, pin change(s) detected.
Reports which pins caused the event (can be multiple), and the entire unit's input captured right after the event. Reports which pins caused the event (can be multiple), and the entire unit's input captured right after the event.

@ -11,31 +11,31 @@ the block of pins easier, e.g. when using them to drive a parallel bus. For sing
## Commands ## Commands
### WRITE (0x00) ### WRITE (0)
Write a value to all defined pins. Write a value to all defined pins.
*Request:* *Request:*
- u16 - new value (packed) - u16 - new value (packed)
### SET (0x01) ### SET (1)
Set pins high Set pins high
*Request:* *Request:*
- u16 - pins to set high (packed) - u16 - pins to set high (packed)
### CLEAR (0x02) ### CLEAR (2)
Set pins low Set pins low
*Request:* *Request:*
- u16 - pins to set low (packed) - u16 - pins to set low (packed)
### TOGGLE (0x03) ### TOGGLE (3)
Toggle selected pins (high - low) Toggle selected pins (high - low)
*Request:* *Request:*
- u16 - pins to toggle (packed) - u16 - pins to toggle (packed)
### PULSE (0x04) ### PULSE (4)
Send a pulse. Send a pulse.
The start will be aligned to 1 us or 1 ms (based on pulse length) of the internal timebase to ensure the highest length precision. This alignment reduces jitter in the pulse duration. A jitter of the pulse start time is less significant, as there's already some unpredictable delay caused by the USB connection and the PC OS scheduler. The start will be aligned to 1 us or 1 ms (based on pulse length) of the internal timebase to ensure the highest length precision. This alignment reduces jitter in the pulse duration. A jitter of the pulse start time is less significant, as there's already some unpredictable delay caused by the USB connection and the PC OS scheduler.

@ -2,13 +2,13 @@
## Commands ## Commands
### WRITE (0x00) ### WRITE (0)
*Request:* *Request:*
- u16 - slave address - u16 - slave address
- u8[] - bytes to write - u8[] - bytes to write
### READ (0x01) ### READ (1)
*Request:* *Request:*
- u16 - slave address - u16 - slave address
@ -17,7 +17,7 @@
*Response:* *Response:*
- u8[] - received bytes - u8[] - received bytes
### WRITE_REG (0x02) ### WRITE_REG (2)
Write a register; first writes the register number, then (in the same transaction) Write a register; first writes the register number, then (in the same transaction)
the data. If the device supports it, can write multiple registers at once. the data. If the device supports it, can write multiple registers at once.
@ -27,7 +27,7 @@ the data. If the device supports it, can write multiple registers at once.
- u8 - register number - u8 - register number
- u8[] - bytes to write - u8[] - bytes to write
### READ_REG (0x03) ### READ_REG (3)
Read a register value. First writes the register number, then reads a number of bytes. Read a register value. First writes the register number, then reads a number of bytes.
For devices implementing auto-increment, the register width field can be used to read For devices implementing auto-increment, the register width field can be used to read

@ -7,45 +7,45 @@ Five color data encodings are available for user convenience.
## Commands ## Commands
### CLEAR (0x00) ### CLEAR (0)
Set all pixels to black. This is also automatically executed on start-up to clear the strip. Set all pixels to black. This is also automatically executed on start-up to clear the strip.
### LOAD (0x01) ### LOAD (1)
Load packed RGB data to the strip. Load packed RGB data to the strip.
*Payload:* *Payload:*
- a byte array `(R,G,B)` x length - a byte array `(R,G,B)` x length
### LOAD_U32_ZRGB (0x08) ### LOAD_U32_ZRGB (4)
Load 32-bit `0x00RRGGBB` words encoded in big-endian as `(0,R,G,B)`. Load 32-bit `0x00RRGGBB` words encoded in big-endian as `(0,R,G,B)`.
*Payload:* *Payload:*
- a byte array `(0,R,G,B)` x length - a byte array `(0,R,G,B)` x length
### LOAD_U32_ZBGR (0x09) ### LOAD_U32_ZBGR (5)
Load 32-bit `0x00BBGGRR` words encoded in big-endian as `(0,B,G,R)`. Load 32-bit `0x00BBGGRR` words encoded in big-endian as `(0,B,G,R)`.
*Payload:* *Payload:*
- a byte array `(0,B,G,R)` x length - a byte array `(0,B,G,R)` x length
### LOAD_U32_RGBZ (0x0A) ### LOAD_U32_RGBZ (6)
Load 32-bit `0x00BBGGRR` words encoded in little-endian as `(R,G,B,0)`. Load 32-bit `0x00BBGGRR` words encoded in little-endian as `(R,G,B,0)`.
*Payload:* *Payload:*
- a byte array `(R,G,B,0)` x length - a byte array `(R,G,B,0)` x length
### LOAD_U32_BGRZ (0x09) ### LOAD_U32_BGRZ (7)
Load 32-bit `0x00RRGGBB` words encoded in little-endian as `(B,G,R,0)`. Load 32-bit `0x00RRGGBB` words encoded in little-endian as `(B,G,R,0)`.
*Payload:* *Payload:*
- a byte array `(B,G,R,0)` x length - a byte array `(B,G,R,0)` x length
### GET_LEN (0x04) ### GET_LEN (10)
Read the neopixel strip length as configured in the settings. Read the neopixel strip length as configured in the settings.
*Response:* *Response:*

@ -1,19 +1,19 @@
# PWMDIM # PWMDIM
This unit provides an up to 4-channel PWM output with shared frequency and independent duty cycles. Only one instance can be created due to using a This unit provides an up to 4-channel PWM output with shared frequency and independent duty cycles. Only one instance can be created due to using a
hardware timer. hardware timer.
## Commands ## Commands
### SET_FREQUENCY (0x00) ### SET_FREQUENCY (0)
Set the PWM frequency Set the PWM frequency
*Request:* *Request:*
- u32 - frequency in Hz - u32 - frequency in Hz
### SET_DUTY (0x01) ### SET_DUTY (1)
Set the duty cycle of one or more channels Set the duty cycle of one or more channels
@ -22,11 +22,11 @@ Set the duty cycle of one or more channels
- u8 - channel number 0-3 - u8 - channel number 0-3
- u16 - duty cycle 0-1000 - u16 - duty cycle 0-1000
### STOP (0x02) ### STOP (2)
Stop the hardware timer. Outputs enter low level. Has no effect if stopped. Stop the hardware timer. Outputs enter low level. Has no effect if stopped.
### START (0x03) ### START (3)
Start the timer. Has no effect if running. Start the timer. Has no effect if running.

@ -13,7 +13,7 @@ The `DIRECT_*` commands are mostly meant for debugging purposes when trying to c
## Commands ## Commands
### WRITE (0x00) ### WRITE (0)
Sends data to the shift registers. Sends data to the shift registers.
@ -28,22 +28,22 @@ control or extra LEDs.
- (u8 array) x num_outputs - (u8 array) x num_outputs
- must be a multiple of the outputs count (if 1, simply the output data) - must be a multiple of the outputs count (if 1, simply the output data)
### DIRECT_DATA (0x01) ### DIRECT_DATA (1)
Direct write to the data pins, without any pulse. Direct write to the data pins, without any pulse.
*Request:* *Request:*
- u16 - data to output, packed - u16 - data to output, packed
### DIRECT_CLEAR (0x02) ### DIRECT_CLEAR (2)
Pulse the *Clear* output. Pulse the *Clear* output.
### DIRECT_SHIFT (0x03) ### DIRECT_SHIFT (3)
Pulse the *Shift* output. Pulse the *Shift* output.
### DIRECT_STORE (0x04) ### DIRECT_STORE (4)
Pulse the *Store* output. Pulse the *Store* output.

@ -10,7 +10,7 @@ connected through protection resistors to prevent a short circuit on signal coll
## Commands ## Commands
### QUERY (0x00) ### QUERY (0)
Write and read some bytes. Write and read some bytes.
@ -29,7 +29,7 @@ bytes equal to the number of written bytes.
*Response:* *Response:*
- u8[] - received bytes - u8[] - received bytes
### MULTICAST (0x01) ### MULTICAST (1)
*Request:* *Request:*
- u16 - slaves (packed) - u16 - slaves (packed)

@ -1,6 +1,6 @@
# TOUCH # TOUCH
Access to the hardware touch sensing controller. Access to the hardware touch sensing controller.
Can be used to create capacitive touch interfaces or for rough capacitance measurement (e.g. water level in a bottle, or proximity sensing). Can be used to create capacitive touch interfaces or for rough capacitance measurement (e.g. water level in a bottle, or proximity sensing).
Button mode is implemented for simple threshold checking with hystheresis. Button mode is implemented for simple threshold checking with hystheresis.
@ -8,7 +8,7 @@ Button mode is implemented for simple threshold checking with hystheresis.
## Commands ## Commands
### READ (0x00) ### READ (0)
Read the raw touch pad values (lower indicates higher capacitance). Read the raw touch pad values (lower indicates higher capacitance).
Values are ordered by group and channel. Values are ordered by group and channel.
@ -16,19 +16,19 @@ Values are ordered by group and channel.
*Response:* *Response:*
- u16[] - values - u16[] - values
### SET_BIN_THR (0x01) ### SET_BIN_THR (1)
Set button mode thresholds. Value 0 = button mode disabled fro the pad. Set button mode thresholds. Value 0 = button mode disabled fro the pad.
*Request:* *Request:*
- u16[] - thresholds - u16[] - thresholds
### DISABLE_ALL_REPORTS (0x02) ### DISABLE_ALL_REPORTS (2)
Set thresholds to 0, disabling the button mode for all pads. Set thresholds to 0, disabling the button mode for all pads.
### SET_DEBOUNCE_TIME (0x03) ### SET_DEBOUNCE_TIME (3)
Set debounce time for the button mode (replaces the value from unit settings) Set debounce time for the button mode (replaces the value from unit settings)
@ -36,7 +36,7 @@ Set debounce time for the button mode (replaces the value from unit settings)
- u16 - debounce time milliseconds - u16 - debounce time milliseconds
### SET_HYSTERESIS (0x04) ### SET_HYSTERESIS (4)
Set hysteresis (replaces the default value from settings) Set hysteresis (replaces the default value from settings)
@ -48,7 +48,7 @@ drops)
- u16 - hystheresis - u16 - hystheresis
### GET_CH_COUNT (0x0A) ### GET_CH_COUNT (10)
Get the number of enabled channels Get the number of enabled channels

@ -3,15 +3,15 @@
This unit provides access to the hardware USART peripheral. It is capable of This unit provides access to the hardware USART peripheral. It is capable of
driving RS485 transceivers. driving RS485 transceivers.
The unit uses asynchronous reception and transmission using DMA to support The unit uses asynchronous reception and transmission using DMA to support
low baud rates without lagging the whole platform. Reception is double-buffered low baud rates without lagging the whole platform. Reception is double-buffered
and sent in buffer-sized chunks. The remainder is sent when a timeout from and sent in buffer-sized chunks. The remainder is sent when a timeout from
the last received byte is reached. the last received byte is reached.
## Commands ## Commands
### WRITE (0x00) ### WRITE (0)
Add data to the Tx buffer. Sending is asynchronous, but the command may wait Add data to the Tx buffer. Sending is asynchronous, but the command may wait
for free space in the DMA buffer. for free space in the DMA buffer.
@ -19,7 +19,7 @@ for free space in the DMA buffer.
*Request:* *Request:*
- u8[] - bytes to write - u8[] - bytes to write
### WRITE_SYNC (0x01) ### WRITE_SYNC (1)
Add data to the Tx buffer and wait for the transmission to complete. Add data to the Tx buffer and wait for the transmission to complete.
@ -28,7 +28,7 @@ Add data to the Tx buffer and wait for the transmission to complete.
## Events ## Events
### DATA_RECEIVED (0x00) ### DATA_RECEIVED (0)
Data was received on the serial port. Data was received on the serial port.

Loading…
Cancel
Save