# Crate arduboy_rust

source ·
Expand description

This is the arduboy_rust crate To get started import the prelude to your project.

Import the module:

    use arduboy_rust::prelude::*;

#### Disable C++ libraries

Inside the root directory is a file named `import_config.h`

You can disable C++ libraries in the `import_config.h` file. Just comment the unused library definition out.

Be careful with disabling libraries because:

- The only error you get is something like this if you try to use a function that relies on the library you disabled.

    game.90c69b91e57f285-cgu.0:(.text.loop+0x290): undefined reference to `sound_tone'

- the benefit of disabling will be important in the feature when I add support for the ArduboyG library etc.

To get an idea, the ArduboyTones Library needs additional 2-3% of the flash memory.

Here is the link to the GitHub Repo

## Modules

- arduboy2
  This is the Module to interact in a save way with the Arduboy2 C++ library.
- arduboy_tone
  This is the Module to interact in a save way with the ArduboyTones C++ library.
- arduino
  This is the Module to interact in a save way with the Arduino C++ library.
- c
  Clib functions you can use on the Arduboy
- hardware
  This is the Module to interact in a save way with the Arduboy hardware.
- heapless
  `static` friendly data structures that don’t require dynamic memory allocation
- prelude
  This is the important one to use this library effective in your project
- sprites
  This is the module to interact in a save way with the Sprites C++ library.

## Macros

- f
  This is the way to go if you want print some random text
- get_sprite_addr
  Create a `const` raw pointer to a sprite as u8, without creating an intermediate reference.
- get_string_addr
  Create a `const` raw pointer to a [u8;_] that saves text, without creating an intermediate reference.
- get_tones_addr
  Create a `const` raw pointer to a sprite as u16, without creating an intermediate reference.
- progmem
  Create a space for Progmem variable

## Structs

- Arduboy2
  This is the struct to interact in a save way with the Arduboy2 C++ library.
- ArduboyTones
  This is the struct to interact in a save way with the ArduboyTones C++ library.
- EEPROM
  This is the struct to store and read structs objects to/from eeprom memory.
- EEPROMBYTE
  Use this struct to store and read single bytes to/from eeprom memory.

## Enums

- Color
  This item is to chose between Black or White

## Constants

- FONT_SIZE
  The standard font size of the arduboy
- HEIGHT
  The standard height of the arduboy
- WIDTH
  The standard width of the arduboy