API reference for the firmware

NOTE: this page is quite outdated. Read the source :)


Some even earlier assembly-written test code. Mostly obsolete now, we only use it to
  • set the PWL (backlight) to a moderate level
  • jump to the C code 'main' function


This function simply serves to execute some of the driver test functions.



Dump the clock related registers to the serial port

calypso_pll_set(uint16_t inp)

Set the DPLL of the Calypso chip to a given value, such as CALYPSO_PLL_87_MHZ

calypso_reset_get(enum calypso_rst)

Obtain the status of DSP, External and Watchdog reset lines

calypso_reset_set(enum calypso_rst, int active)

Enable or disalbe one of the three reset signals.


Code related to booting the DSP inside the Calypso DBB chip.


Dump the DSP Download Status and DSP API Version to the serial port


Release DSP from reset, download the bootcode and set API_NDB parameters


Driver for the I2C master controller in the Calypso DBB

i2c_init(int speed, int slaveadd)

Initialize the Calypso DBB I2C Master controller

WARNING: the parameters are currently unused. We use a static speed of 197kHz on the I2C bus

i2c_write(uint8_t chip, uint32_t addr, int alen, const uint8_t *buffer, int len)

Write to a I2C peripheral.
  • chip: I2C slave address
  • addr: The address inside the I2C slave
  • alen: length of the address field (we only support alen=1)
  • buffer: The data to be written to the slave
  • len: Length of the data to be written. We only support len <= 16!


A driver for the Calypso DBB SPI controller


Initialize the SPI controller

spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din)

Perform a SPI transfer.
  • dev_idx: The SPI slave device index (0..4), determine which chip select to use
  • bitlen: Length of the transfer in number of bits
  • dout: Pointer of to-be-transmitted data
  • din: Pointer to memory where received data is to be stored (can be NULL for tx-only transfer)


Driver for the Time Processing Unit (TPU), still under development


Driver for the TSP (Time Serial Port) of the TPU, still under development


Driver for the RF Frontend TRF6151, still under development


A very simple 8x8 pixel monochrome monospaced font


A driver for the Sitronix ST7558 dot-matrix LCD attached to a I2C bus


Initialize the LCD

void st7558_set_attr(unsigned long attr)

Set display attributes (currently only DISP_ATTR_INVERT)

void st7558_unset_attr(unsigned long attr)

Unset display attributes (currently only DISP_ATTR_INVERT)

void st7558_clrscr(void)

Clear the screen

void st7558_putchar(unsigned char c)

Display a single character using the 8x8 font

void st7558_puts(const char *s)

Display a string of characters using the 8x8 font


Driver for the Analog Baseband (ABB) TWL3025, attached to SPI (dev_idx=0).

void twl3025_init(void)

Initialize the driver.

void twl3025_reg_write(uint8_t reg, uint16_t data)

Write a TWL3025 register

uint16_t twl3025_reg_read(uint8_t reg)

Read a TWL3025 register

void twl3025_power_off(void)

Power-off the phone.