Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| ctboard:peripherals:hexsw [2016/02/25 12:36] – [Programming Example] feur | ctboard:peripherals:hexsw [2022/12/23 11:01] (current) – ruan | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| The HEX switch on the CT Board can switch through 16 different states (4 bit). \\ \\ | The HEX switch on the CT Board can switch through 16 different states (4 bit). \\ \\ | ||
| - | > {{ctboard: | + | > {{ctboard: | 
| - | > Supported [[ctboard: | + | > Supported [[ctboard: | 
| \\ | \\ | ||
| + | |||
| + | ===== Registers ===== | ||
| + | |||
| + | **Caveat:** Register bits [7:4] are read as ' | ||
| + | |||
| + | The register is read only. | ||
| + | |||
| + | \\ {{ctboard_hexsw_reg.svg}} \\ \\ | ||
| + | |||
| + | ===== Diagram ===== | ||
| + | |||
| + | \\ {{: | ||
| ===== Programming Example ===== | ===== Programming Example ===== | ||
| - | The code snippet bellow shows how to use the HEXSW. | + | The code snippets below show how to use the HEXSW. | 
| <code c> | <code c> | ||
| Line 19: | Line 31: | ||
| <code asm> | <code asm> | ||
| - | ADDR_BUTTON | + | ADDR_HEXSW | 
|  |  | ||
| - | LDR r0, =ADDR_BUTTON | + | LDR r0, =ADDR_HEXSW | 
| LDRB r1, [r0, #0] ; Read HEXSW into the lower nibble of a byte. | LDRB r1, [r0, #0] ; Read HEXSW into the lower nibble of a byte. | ||
| </ | </ | ||
| \\ | \\ | ||
| - | ===== Registers ===== | ||
| - | |||
| - | The Registers are read only. | ||
| - | |||
| - | \\ {{ctboard_hexsw_reg.svg}} \\ \\ | ||
| - | |||
| - | ===== Diagram ===== | ||
| - | |||
| - | \\ {{: | ||