Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| ctboard:peripherals:dipsw [2016/02/09 11:45] – feur | ctboard:peripherals:dipsw [2026/06/25 14:53] (current) – [Programming Example] scbj | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== DIPSW ====== | ====== DIPSW ====== | ||
| - | On the CT Board are 32 DIP switches | + | The CT Board features |
| If a DIP switch is in the position " | If a DIP switch is in the position " | ||
| - | > {{ctboard_mode_1.svg? | + | > {{ctboard:ctboard_mode_1.svg? |
| - | > Supported modes: **1**, **2**, **3** | + | > Supported |
| + | \\ | ||
| ===== Registers ===== | ===== Registers ===== | ||
| - | The Registers | + | The registers |
| - | {{ctboard_dipsw_reg.svg}} | + | \\ {{ctboard_dipsw_reg.svg}} |
| ===== Diagram ===== | ===== Diagram ===== | ||
| \\ {{: | \\ {{: | ||
| + | |||
| + | ===== Programming Example ===== | ||
| + | |||
| + | The code snippets below show how to use the DIPSW. | ||
| + | |||
| + | <code c> | ||
| + | #include " | ||
| + | |||
| + | uint8_t data_byte = CT_DIPSW-> | ||
| + | uint16_t data_hword = CT_DIPSW-> | ||
| + | uint32_t data_word = CT_DIPSW-> | ||
| + | </ | ||
| + | \\ | ||
| + | |||
| + | <code text> | ||
| + | .equ ADDR_DIPSW, | ||
| + | | ||
| + | ldr | ||
| + | ldrb r1, [r0, #0] // Read byte from S7..0. | ||
| + | ldrh r1, [r0, #2] // Read half word from S31..16. | ||
| + | ldr | ||
| + | </ | ||
| + | \\ | ||