blob: 6ae1c2ad6094e54c36d97974faa7495e078e5a31 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
/**
* Protocol is under GNU/GPL2!
* Author: Benedikt Sauter sauter@empronix.com, 2007-09-02
*
* BYTE command
* BYTE parameter
* BYTE length body <x>
* <x> BYTES body
*
* max body length = 60 bytes
*/
/**
* The first byte in the body of an response packet
* is always a value from the next table.
*/
#define RSP_OK 0x01
#define RSP_ERROR 0x02
#define RSP_UNKOWN_CMD 0x03
#define RSP_UNKOWN_PIN 0x04
#define RSP_UNKOWN_PORT 0x05
#define RSP_WRONG_PIN_CONFIG 0x06
#define RSP_IMPOSSIBLE_PIN_CONFIG 0x07
#define RSP_TIMEOUT 0x08
#define CMD_LATENCY_TIMER_SET 0x01
#define CMD_LATENCY_TIMER_GET 0x02
#define CMD_GET_HW_ID 0x03
#define CMD_EXTERNAL_DEVICE 0x06
#define CMD_IO_INIT_PORT 0x10
#define CMD_IO_INIT_PIN 0x11
#define CMD_IO_PORT_DIRECTION_IN 0x12
#define CMD_IO_PORT_DIRECTION_OUT 0x13
#define CMD_IO_PORT_DIRECTION_TRI 0x14
#define CMD_IO_PIN_DIRECTION_IN 0x15
#define CMD_IO_PIN_DIRECTION_OUT 0x16
#define CMD_IO_PIN_DIRECTION_TRI 0x17
#define CMD_IO_PORT_SET 0x18
#define CMD_IO_PORT_GET 0x19
#define CMD_IO_PIN_SET 0x1A
#define CMD_IO_PIN_GET 0x1B
#define CMD_ADC_INIT_PIN 0x20
#define CMD_ADC_GET 0x21
#define CMD_ADC_REF 0x22
#define CMD_I2C_INIT 0x30
#define CMD_I2C_DEINIT 0x31
#define CMD_I2C_SET_BITRATE 0x32
#define CMD_I2C_SEND 0x34
#define CMD_I2C_RECV 0x35
#define CMD_I2C_SEND_START 0x36
#define CMD_I2C_SEND_STOP 0x37
#define CMD_SPI_INIT 0x40
#define CMD_SPI_DEINIT 0x41
#define CMD_SPI_SPEED 0x42
#define CMD_SPI_SEND 0x43
#define CMD_SPI_RECV 0x44
#define CMD_SPI_SEND_AND_RECV 0x45
#define CMD_PWM_INIT_PIN 0x50
#define CMD_PWM_DEINIT_PIN 0x51
#define CMD_PWM_SPEED 0x52
#define CMD_PWM_VALUE 0x53
#define CMD_UART_INIT 0x60
#define CMD_UART_DEINIT 0x61
#define CMD_UART_BAUDRATE 0x62
#define CMD_UART_STOPBITS 0x63
#define CMD_UART_DATABITS 0x64
#define CMD_UART_PARITY 0x65
#define CMD_UART_RECV 0x67
#define CMD_UART_SEND 0x68
#define PARAM_ADC_AREF 0x01
#define PARAM_ADC_AVCC 0x02
#define PARAM_ADC_INTERNAL 0x03
/* microwire eeprom */
#define CMD_EXTERNAL_93C46 0x01
#define CMD_93C46_INIT 0x01
#define CMD_93C46_DEINIT 0x02
#define CMD_93C46_READ 0x03
#define CMD_93C46_WRITE 0x04
|