S65-Shield Software Package

Arduino Libraries

S65Display

void init(uint8_t clock_div)
Initialize the microcontroller periphery and the display.
  clock_div - SPI clock divider (2, 4, 8, 16, 32),  SPI clock = Main clock / clock_div

void setCursor(uint8_t x, uint8_t y)
Set cursor.
  x         - X postion
  y         - Y postion
  
void setArea(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1)
Set draw area.
  x0        - X postion of 1st point (left top)
  y0        - Y postion of 1st point (left top)
  x1        - X postion of 2nd point (right bottom)
  y1        - Y postion of 2nd point (right bottom)
  
void drawStart(void)
Start drawing.

void draw(uint16_t color)
Draw color.

void drawStop(void)
Stop drawing.

void clear(uint16_t color)
Clear the complete screen. 
  color     - screen color

void drawPixel(uint8_t x0, uint8_t y0, uint16_t color)
Draw a pixel.
  x0        - X postion of the pixel
  y0        - Y postion of the pixel
  color     - Color

void drawLine(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint16_t color)
Draw a line.
  x0        - X postion of 1st point
  y0        - Y postion of 1st point
  x1        - X postion of 2nd point
  y1        - Y postion of 2nd point
  color     - Color

void drawRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint16_t color)
Draw a rectangle edge.
  x0        - X postion of 1st point
  y0        - Y postion of 1st point
  x1        - X postion of 2nd point
  y1        - Y postion of 2nd point
  color     - Color
  
void fillRect(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint16_t color)
Draw a filled rectangle.
  x0        - X postion of 1st point
  y0        - Y postion of 1st point
  x1        - X postion of 2nd point
  y1        - Y postion of 2nd point
  color     - Color
  
void drawCircle(uint8_t x0, uint8_t y0, uint8_t radius, uint16_t color)
Draw a circle.
  x0        - X postion of middle point
  y0        - Y postion of middle point
  radius    - Radius
  color     - Color

uint8_t drawText(uint8_t x, uint8_t y, char *s, uint16_t color, uint16_t bg_color)
Draw a string from RAM. The return value is the X end postion of the text.

  x         - X postion (left top)
  y         - Y postion (left top)
  s         - Pointer to string (RAM)
  color     - Font color
  bg_color  - Background color

uint8_t drawTextPGM(uint8_t x, uint8_t y, PGM_P s, uint16_t color, uint16_t bg_color)
Draw a string from Flash. The return value is the X end postion of the text.
  x         - X postion (left top)
  y         - Y postion (left top)
  s         - Pointer to string (Flash)
  color     - Font color
  bg_color  - Background color
 
For colors you can use the RGB(red,green,blue) function.
Examples: clear(RGB(255,50,100))
          drawText(10, 10, "Hello world", RGB(0,0,255), RGB(255,50,100))
          drawTextPGM(10, 20, PSTR("Hello world"), RGB(0,255,0), RGB(255,50,100))

To rotate or mirror the display uncomment the defines S65_ROTATE or S65_MIRROR in /libraries/S65Display/font_8x12.h.

The text functions can draw characters from 0x20 to 0x7F.
But you can remove the FONT_END7F definition from /libraries/S65Display/font_8x12.h to support 0x20 to 0xFF.

RotaryEncoder

void init(void)
Initialize the microcontroller periphery.

void service(void)
This function has to be called every 1 millisecond (1000 Hz).

int8_t step(void)
Get the step of the rotary encoder: -1, 0, +1

int8_t sw(void)
Get the state of the switch: 0, SW_PRESSED, SW_PRESSEDLONG

SDcard

void init(uint8_t clock_div)
Initialize the microcontroller periphery.
  clock_div - SPI clock divider (2, 4, 8, 16, 32),  SPI clock = Main clock / clock_div

void service(void);
This function has to be called every 10 milliseconds (100 Hz).

uint8_t mount(void);
Initialize the memory card and mount it.
The return value is 0 if the mounting failed and 1 if card is mounted successfully.

void unmount(void);
Unmount the memory card.

See also the FatFS Docu, for more information about the file system functions (f_open(), f-opendir()...):
/libraries/SDcard/doc/00index_e.html or ELM-Chan FatFs website

WirelessTransceiver

Currently not implemented.

S65Shield

Examples for the libraries:
Demo1
Demo2
ImageDemo
MenuDemo
OpenFileDemo


Pin map

  Display          A3 17 - Reset
                   A2 16 - CS
                       4 - RS
                 MOSI 11 - Data
                  SCK 13 - Clk

  Rotary Encoder       5 - Switch
                       6 - PhA
                       7 - PhB

  microSD              8 - Power (low -> power on)
                       9 - CS
                 MISO 12 - MISO
                 MOSI 11 - MOSI
                  SCK 13 - SCK

  wireless         A0 14 - CS
                   A1 15 - CE
                 INT1  3 - DR1
                 MOSI 11 - Data
                  SCK 13 - Clk