Protocol

From NaWiki

Jump to: navigation, search

Contents

Description

This is the protocol used for SPI communication between DS and DSerial.

Tables

Standard Write Packet

Type Description
uint8 selector with highest order bit set
uint8 size of data (max 32) to DSerial
array data to DSerial

Standard Read Packet

Type Description
uint8 selector with highest order bit cleared
uint8 size of data (max 32) from DSerial
array data from DSerial

Selectors

Selector Define Description
0x00 none reserved
0x01 SELECT_INTERRUPT reads or writes Interrupt Status register
0x02 SELECT_FLASH writes or reads to flash
0x03 SELECT_FLASH_ERASE erases a 512 byte page in flash
0x04 SELECT_BOOT_FIRMWARE boots firmware at offset 0x0800 in flash
0x05 SELECT_BOOT_LOADER boots bootloader at offset 0x0000 in flash
0x10 SELECT_UART_BAUD sets or reads UART baudrate
0x11 SELECT_UART_BUFFER reads or writes UART data
0x9F SELECT_CHECK checks whether DSerial is inserted (see Detecting DSerial)

Interrupt Status

Bit Description
0 Bootloader
1 UART Sent
2 UART Received
3 I/O
4 ADC
5 PWM
6 USB
7 reserved
Personal tools