DSerial Library

From NaWiki

Jump to: navigation, search

Contents

Description

libdserial allows to use DSerial in DS homebrews.

Note: The following sections are subject to change in the near future.

Functions

Configuration

bool dseInit()

Initializes DSerial. Returns false if DSerial wasn't detected.

bool dseUploadFirmware(char * data, unsigned int size)

Uploads raw firmware data into DSerial. data should be a proper Firmware Image with a CRC. Returns false if firmware upload failed.

bool dseBoot()

Boots firmware if we're in bootloader. Boots bootloader if we're in firmware. Returns false if operation failed.

UART

bool dseUartSetBaudrate(unsigned int baudrate)

Sets UART baud rate. Returns false if operation failed.

void dseUartSetReceiveHandler(void (*receiveHandler)(char * data, unsigned int size))

Sets UART receive handler. Handler gets called when data has arrived. Set to NULL to stop.

void dseUartSetSendHandler(int (*sendHandler)(void))

Sets UART send handler. Handler gets called when data send is completed. Set to NULL to stop.

bool dseUartSendBuffer(char * data, unsigned int size, bool block = false)

Sends data on the UART port. size is maximum 32. Returns false if something went wrong.

Tilt

To be written.

I/O

To be written.

ADC

To be written.

PWM

To be written.

USB Device

To be written.

Misc

To be written.

Personal tools