Skip to content

Instantly share code, notes, and snippets.

@logxen
Last active August 29, 2015 13:56
Show Gist options
  • Save logxen/8792351 to your computer and use it in GitHub Desktop.
Save logxen/8792351 to your computer and use it in GitHub Desktop.
Smoothiepanel - Proposed simple comms
Command Description
# system functions
0x00 nop
0x01 read vid
0x02 read pid
0x03 read revision
0x04 read version
# lcd
0x10 lcd data write
0x11 lcd data read
0x12 lcd command write
0x13 lcd command read
0x14 lcd reset
0x18 lcd contrast write # not implemented
0x19 lcd contrast read # not implemented
# i2c
0x20 i2c write
0x21 i2c read
0x22 i2c start + address
0x23 i2c stop
# spi / sd
0x28 spi write
# wing1
0x40 wing1 write
0x41 wing1 read
0x42 wing1 set
0x43 wing1 clear
0x44 wing1 not
0x45 wing1 dir
0x46 wing1 masked write # not implemented
0x47 wing1 mask # not implemented
0x48 wing1_0 function
0x49 wing1_1 function
0x4A wing1_2 function
0x4B wing1_3 function
0x4C wing1_4 function
0x4D wing1_5 function
0x4E wing1_6 function
0x4F wing1_7 function
# wing2
0x50 wing2 write
0x51 wing2 read
0x52 wing2 set
0x53 wing2 clear
0x54 wing2 not
0x55 wing2 dir
0x56 wing2 masked write # not implemented
0x57 wing2 mask # not implemented
0x58 wing2_0 function
0x59 wing2_1 function
0x5A wing2_2 function
0x5B wing2_3 function
0x5C wing2_4 function
0x5D wing2_5 function
0x5E wing2_6 function
0x5F wing2_7 function
# ext pins
# DAC_SDA, DAC_SCL, SD_CD, SD_WP, SD_SSEL, SPI_SSEL, I2C_INT, ISP
0x60 ext write
0x61 ext read
0x62 ext set
0x63 ext clear
0x64 ext not
0x65 ext dir
0x66 ext masked write # not implemented
0x67 ext mask # not implemented
0x68 ext_0 function
0x69 ext_1 function
0x6A ext_2 function
0x6B ext_3 function
0x6C ext_4 function
0x6D ext_5 function
0x6E ext_6 function
0x6F ext_7 function
# adc pins
# available on wing1
0x70 adc0 read
0x71 adc1 read
0x72 adc2 read
0x73 adc3 read
0x74 adc4 read
0x75 adc5 read
0x76 adc6 read
0x77 adc7 read
# pwm pins
# certain pins are pwm capable: W2_5 W2_6 W2_7 W1_6 LCD_R LCD_G LCD_B
0x78 write pwm init reg (setting bits 6:0 enables that pwm pin until reset)
0x79 write pwm0
0x7A write pwm1
0x7B write pwm2
0x7C write pwm3
0x7D write pwm4
0x7E write pwm5
0x7F write pwm6
# other functions
# nunchuck
0x80 init nunchuck
0x81 read nunchuck type
0x82 read nunchuck data bytes 1 and 2
0x83 read nunchuck data bytes 3 and 4
0x84 read nunchuck data bytes 5 and 6
0x85 poll nunchuck
# quadrature encoder
# init bits: 7 channel a wing, 6:4 channel a pin, 3 channel b wing, 2:0 channel b pin
# write 1 on read to reset counter, write 0 to not reset counter
0x86 init encoder
0x87 read encoder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment