FirmwareApiReference » History » Revision 2
Revision 1 (laforge, 02/19/2016 10:48 PM) → Revision 2/3 (laforge, 02/19/2016 10:49 PM)
h2. == API reference for the firmware == NOTE: *this '''this page is quite outdated. Read the source :)* h3. :)''' === hello_world.S === 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 h3. === main,c === This function simply serves to execute some of the driver test functions. h3. === calypso_clock.c h4. === ==== calypso_clk_dump(void) ==== Dump the clock related registers to the serial port h4. ==== calypso_pll_set(uint16_t inp) ==== Set the DPLL of the Calypso chip to a given value, such as CALYPSO_PLL_87_MHZ h4. ==== calypso_reset_get(enum calypso_rst) ==== Obtain the status of DSP, External and Watchdog reset lines h4. ==== calypso_reset_set(enum calypso_rst, int active) ==== Enable or disalbe one of the three reset signals. h3. === calypso_dsp.c === Code related to booting the DSP inside the Calypso DBB chip. h4. ==== dump_dsp_version(void) ==== Dump the DSP Download Status and DSP API Version to the serial port h4. ==== dsp_power_on(void) ==== Release DSP from reset, download the bootcode and set API_NDB parameters h3. === calypso_i2c.c === Driver for the I2C master controller in the Calypso DBB h4. ==== i2c_init(int speed, int slaveadd) ==== Initialize the Calypso DBB I2C Master controller *WARNING: '''WARNING: the parameters are currently unused. We use a static speed of 197kHz on the I2C bus* h4. 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! h3. === calypso_spi.c === A driver for the Calypso DBB SPI controller h4. ==== spi_init(void) ==== Initialize the SPI controller h4. ==== 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) h3. === calypso_tpu.c === Driver for the Time Processing Unit (TPU), still under development h3. === calypso_tsp.c === Driver for the TSP (Time Serial Port) of the TPU, still under development h3. === trf6151.c === Driver for the RF Frontend [[TRF6151]], [wiki:TRF6151], still under development h3. === font_8x8.c === A very simple 8x8 pixel monochrome monospaced font h3. === st7558.c === A driver for the Sitronix [[ST7558]] [wiki:ST7558] dot-matrix LCD attached to a I2C bus h4. ==== st7558_init(void) ==== Initialize the LCD h4. ==== void st7558_set_attr(unsigned long attr) ==== Set display attributes (currently only DISP_ATTR_INVERT) h4. ==== void st7558_unset_attr(unsigned long attr) ==== Unset display attributes (currently only DISP_ATTR_INVERT) h4. ==== void st7558_clrscr(void) ==== Clear the screen h4. ==== void st7558_putchar(unsigned char c) ==== Display a single character using the 8x8 font h4. ==== void st7558_puts(const char *s) ==== Display a string of characters using the 8x8 font h3. === twl3025.c === Driver for the Analog Baseband (ABB) [[TWL3025]], [wiki:TWL3025], attached to SPI (dev_idx=0). h4. ==== void twl3025_init(void) ==== Initialize the driver. h4. ==== void twl3025_reg_write(uint8_t reg, uint16_t data) ==== Write a TWL3025 register h4. ==== uint16_t twl3025_reg_read(uint8_t reg) ==== Read a TWL3025 register h4. ==== void twl3025_power_off(void) ==== Power-off the phone.