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