forked from mohr/ArduinoIO
added informative comments
This commit is contained in:
parent
651ae6ed44
commit
976c15c9b6
@ -2,6 +2,7 @@
|
|||||||
#define ARDUINOCONFIG_H_
|
#define ARDUINOCONFIG_H_
|
||||||
|
|
||||||
static const uint8_t COMMAND_TRANSFER_SPI = 1;
|
static const uint8_t COMMAND_TRANSFER_SPI = 1;
|
||||||
|
static const uint8_t COMMAND_TRANSFER_I2C = 2;
|
||||||
|
|
||||||
// Can be set to one for additional programming information from the primary
|
// Can be set to one for additional programming information from the primary
|
||||||
// serial port which is usually also used to flash the Arduino
|
// serial port which is usually also used to flash the Arduino
|
||||||
@ -9,7 +10,7 @@ static const uint8_t COMMAND_TRANSFER_SPI = 1;
|
|||||||
// serial communication logic
|
// serial communication logic
|
||||||
#define PROGRAMMING_OUTPUT 1
|
#define PROGRAMMING_OUTPUT 1
|
||||||
|
|
||||||
#define BAUD_RATE 115200
|
#define BAUD_RATE 9600
|
||||||
#define SERIAL_RX_BUFFER_SIZE 256
|
#define SERIAL_RX_BUFFER_SIZE 256
|
||||||
#define RING_BUFFER_SIZE 100
|
#define RING_BUFFER_SIZE 100
|
||||||
#define MAX_PACKET_LENGTH 100
|
#define MAX_PACKET_LENGTH 100
|
||||||
|
@ -126,6 +126,7 @@ void transferSPI(uint8_t address, uint8_t *data, size_t datalen) {
|
|||||||
// requires the slave select to be driven low.
|
// requires the slave select to be driven low.
|
||||||
CS_PORT = ~address;
|
CS_PORT = ~address;
|
||||||
SPI.transfer(data, datalen);
|
SPI.transfer(data, datalen);
|
||||||
|
// some MGM stuff. This delay might not be needed for other devices.
|
||||||
delay(100);
|
delay(100);
|
||||||
// Pull the slave select high again.
|
// Pull the slave select high again.
|
||||||
CS_PORT = 0xff;
|
CS_PORT = 0xff;
|
||||||
|
Loading…
Reference in New Issue
Block a user