DSerial Library

From NaWiki
Revision as of 23:39, 13 December 2006 by Natrium42 (talk | contribs) (UART)
Jump to: navigation, search

Description

libdserial allows to use DSerial in DS homebrews.

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

Functions

Configuration

<cpp> bool dseInit() </cpp>

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

<cpp> void dseBootloaderVersion(char * version) </cpp>

Returns version of the bootloader. version should be a 32 byte buffer.

<cpp> void dseFirmwareVersion(char * version) </cpp>

Returns version of the firmware. version should be a 32 byte buffer.

<cpp> bool dseUploadFirmware(char * data, unsigned int size) </cpp>

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

<cpp> bool dseBootFirmware() </cpp>

Boots firmware. Returns false if operation failed.

UART

<cpp> bool dseUartSetBaudrate(unsigned int baudrate) </cpp>

Sets UART baud rate. Returns false if operation failed.

<cpp> void dseUartSetReceiveHandler(int (*receiveHandler)(char * data, unsigned int size)) </cpp>

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

<cpp> void dseUartSetSendHandler(int (*sendHandler)(void)) </cpp>

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

<cpp> bool dseUartSendBuffer(char * data, unsigned int size, bool block = false) </cpp>

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.