FirmwareApiReference » History » Version 1
laforge, 02/19/2016 10:48 PM
add old api reference
1 | 1 | laforge | == API reference for the firmware == |
---|---|---|---|
2 | |||
3 | NOTE: '''this page is quite outdated. Read the source :)''' |
||
4 | |||
5 | |||
6 | === hello_world.S === |
||
7 | |||
8 | Some even earlier assembly-written test code. Mostly obsolete now, we only use it to |
||
9 | * set the PWL (backlight) to a moderate level |
||
10 | * jump to the C code 'main' function |
||
11 | |||
12 | === main,c === |
||
13 | |||
14 | This function simply serves to execute some of the driver test functions. |
||
15 | |||
16 | === calypso_clock.c === |
||
17 | |||
18 | ==== calypso_clk_dump(void) ==== |
||
19 | Dump the clock related registers to the serial port |
||
20 | |||
21 | ==== calypso_pll_set(uint16_t inp) ==== |
||
22 | Set the DPLL of the Calypso chip to a given value, such as CALYPSO_PLL_87_MHZ |
||
23 | |||
24 | ==== calypso_reset_get(enum calypso_rst) ==== |
||
25 | Obtain the status of DSP, External and Watchdog reset lines |
||
26 | |||
27 | ==== calypso_reset_set(enum calypso_rst, int active) ==== |
||
28 | Enable or disalbe one of the three reset signals. |
||
29 | |||
30 | === calypso_dsp.c === |
||
31 | Code related to booting the DSP inside the Calypso DBB chip. |
||
32 | |||
33 | ==== dump_dsp_version(void) ==== |
||
34 | Dump the DSP Download Status and DSP API Version to the serial port |
||
35 | |||
36 | ==== dsp_power_on(void) ==== |
||
37 | Release DSP from reset, download the bootcode and set API_NDB parameters |
||
38 | |||
39 | === calypso_i2c.c === |
||
40 | Driver for the I2C master controller in the Calypso DBB |
||
41 | |||
42 | ==== i2c_init(int speed, int slaveadd) ==== |
||
43 | Initialize the Calypso DBB I2C Master controller |
||
44 | |||
45 | '''WARNING: the parameters are currently unused. We use a static speed of 197kHz on the I2C bus''' |
||
46 | |||
47 | ==== i2c_write(uint8_t chip, uint32_t addr, int alen, const uint8_t *buffer, int len) ==== |
||
48 | Write to a I2C peripheral. |
||
49 | * chip: I2C slave address |
||
50 | * addr: The address inside the I2C slave |
||
51 | * alen: length of the address field (we only support alen=1) |
||
52 | * buffer: The data to be written to the slave |
||
53 | * len: Length of the data to be written. We only support len <= 16! |
||
54 | |||
55 | === calypso_spi.c === |
||
56 | A driver for the Calypso DBB SPI controller |
||
57 | |||
58 | ==== spi_init(void) ==== |
||
59 | Initialize the SPI controller |
||
60 | |||
61 | ==== spi_xfer(uint8_t dev_idx, uint8_t bitlen, const void *dout, void *din) ==== |
||
62 | Perform a SPI transfer. |
||
63 | * dev_idx: The SPI slave device index (0..4), determine which chip select to use |
||
64 | * bitlen: Length of the transfer in number of bits |
||
65 | * dout: Pointer of to-be-transmitted data |
||
66 | * din: Pointer to memory where received data is to be stored (can be NULL for tx-only transfer) |
||
67 | |||
68 | === calypso_tpu.c === |
||
69 | Driver for the Time Processing Unit (TPU), still under development |
||
70 | |||
71 | === calypso_tsp.c === |
||
72 | Driver for the TSP (Time Serial Port) of the TPU, still under development |
||
73 | |||
74 | === trf6151.c === |
||
75 | Driver for the RF Frontend [wiki:TRF6151], still under development |
||
76 | |||
77 | === font_8x8.c === |
||
78 | A very simple 8x8 pixel monochrome monospaced font |
||
79 | |||
80 | === st7558.c === |
||
81 | A driver for the Sitronix [wiki:ST7558] dot-matrix LCD attached to a I2C bus |
||
82 | |||
83 | ==== st7558_init(void) ==== |
||
84 | Initialize the LCD |
||
85 | |||
86 | ==== void st7558_set_attr(unsigned long attr) ==== |
||
87 | Set display attributes (currently only DISP_ATTR_INVERT) |
||
88 | |||
89 | ==== void st7558_unset_attr(unsigned long attr) ==== |
||
90 | Unset display attributes (currently only DISP_ATTR_INVERT) |
||
91 | |||
92 | ==== void st7558_clrscr(void) ==== |
||
93 | Clear the screen |
||
94 | |||
95 | ==== void st7558_putchar(unsigned char c) ==== |
||
96 | Display a single character using the 8x8 font |
||
97 | |||
98 | ==== void st7558_puts(const char *s) ==== |
||
99 | Display a string of characters using the 8x8 font |
||
100 | |||
101 | === twl3025.c === |
||
102 | Driver for the Analog Baseband (ABB) [wiki:TWL3025], attached to SPI (dev_idx=0). |
||
103 | |||
104 | ==== void twl3025_init(void) ==== |
||
105 | Initialize the driver. |
||
106 | |||
107 | ==== void twl3025_reg_write(uint8_t reg, uint16_t data) ==== |
||
108 | Write a TWL3025 register |
||
109 | |||
110 | ==== uint16_t twl3025_reg_read(uint8_t reg) ==== |
||
111 | Read a TWL3025 register |
||
112 | |||
113 | ==== void twl3025_power_off(void) ==== |
||
114 | Power-off the phone. |