1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/doc/fw_commands.txt Tue Jan 29 22:31:52 2008 +0100
1.3 @@ -0,0 +1,89 @@
1.4 +--- Protocol Descrition ---
1.5 +
1.6 +[------------------ HEADER ------------------] [- DATA -]
1.7 +[SYNC] [COMMAND] [LENGTH_UPPER] [LENGTH_LOWER] ([DATA])
1.8 +
1.9 +
1.10 +--- HEADER ---
1.11 +-- Sync --
1.12 +Commands send from the Host to the Unit start with 0xAA.
1.13 +Commands from the unit, to the Host Computer start with 0x55.
1.14 +
1.15 +-- Length --
1.16 +Warning: A complete Packet _must_ be smaller than 64 Bytes. This is a Firmware limit!
1.17 +Therefore, LENGTH_UPPER is always zero.
1.18 +LENGTH_LOWER ist the number of Data bytes, following the header. The Firmware will scrap the complete package, if length is not correct.
1.19 +
1.20 +--- Commands ---
1.21 +Currently the following commands are implemented:
1.22 +
1.23 +-- Commands used by the unit --
1.24 +In most cases, these are replys to host initiated commands. Only CMD_SYS_IR is used 'standalone'.
1.25 +
1.26 +- CMD_SYS_SYNC (0x00)-
1.27 + * not used.
1.28 +
1.29 +- CMD_SYS_ACK (0x01) -
1.30 + * Acknowledge command.
1.31 + * Can contain data
1.32 +
1.33 +- CMD_SYS_NACK (0x02) -
1.34 + * Not Acknowledge
1.35 + * Never contains data
1.36 +
1.37 +- CMD_SYS_NIMP (0xFF) -
1.38 + * Issued commands is not implemented.
1.39 + * Never contains data
1.40 +
1.41 +- CMD_SYS_IR (0x10) -
1.42 + * A Infrared or Key-Event has occured
1.43 + * 2 data Bytes: RC5-Address & RC5-Command
1.44 +
1.45 +-- Host initiated commands --
1.46 +- CMD_DISP_CLEAR_SCREEN (0x10) -
1.47 + * Required data: None
1.48 + * Clears Display Data-RAM from 0x0000 to 0x1000
1.49 +
1.50 +- CMD_DISP_SET_ROW_DATA (0x14) -
1.51 + * Required data: at least 3 data Bytes: ADDR_LOWER, ADDR_UPPER, DISPLAY_DATA[]
1.52 + * sets the Display Ram starting from address (ADDR_UPPER << 2 + ADDR_LOWER) to DISPLAY_DATA[].
1.53 + * most usefull if one ore more complete rows are written.
1.54 +
1.55 +- CMD_DISP_SET_ADDRESS (0x16) -
1.56 + * Required data: 2 data Bytes: ADDR_LOWER, ADDR_UPPER
1.57 + * Sets the Display Ram Address to (ADDR_UPPER << 2 + ADDR_LOWER)
1.58 +
1.59 +- CMD_READ_CLOCK (0x40) -
1.60 + * Required data: None
1.61 + * Returns 10Bytes of Data, corresponding to the pcf8583 ram from 0x00 to 0x0F.
1.62 +
1.63 +- CMD_WRITE_CLOCK (0x41) -
1.64 + * Required data: 10Bytes: CLOCK_DATA[]
1.65 + * Writes CLOCK_DATA to the pcf8583 from address 0x00 to 0x0F.
1.66 +
1.67 +- CMD_SET_PWM1 (0x45) -
1.68 + * Required data: 1 Byte (DutyCycle)
1.69 + * Loads PWM1 DutyCycle Register
1.70 +
1.71 +- CMD_SET_PWM2 (0x46) -
1.72 + * Required data: 1 Byte (DutyCycle)
1.73 + * Loads PWM2 DutyCycle Register
1.74 +
1.75 +- CMD_SET_MODE_MANAGED (0x70) -
1.76 + * Required data: None
1.77 + * Enters 'managed mode': now the display wont be updated, ir&key events will be send
1.78 +
1.79 +- CMD_SET_MODE_UNMANAGED (0x71) -
1.80 + * Required data: None
1.81 + * Enters 'unmanaged mode': now the display wont be updated, ir&key events will be send
1.82 +
1.83 +- CMD_BOOT (0x80) -
1.84 + * Required data: None
1.85 + * Enters Bootload mode. NO ACK is send!
1.86 +
1.87 +--- Examples ---
1.88 +0xAA 0x10 0x00 0x00 -> Clears the Display
1.89 +0xAA 0x45 0x00 0x01 0x80 -> Sets PWM1 to 50% DC
1.90 +0xAA 0x14 0x00 0x03 0x00 0x08 0x42 -> Writes a small 'b' to the upper left display corner
1.91 +0xAA 0x80 0x00 0x00 -> Enters Bootloader mode
1.92 +0xAA 0x40 0x00 0x00 -> Returns 10Bytes Clock Data
1.93 \ No newline at end of file