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 10:47] – 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> | ||
| #include " | #include " | ||
| - | uint8_t data = CT_HEXSW; | + | uint8_t data = CT_HEXSW; | 
| </ | </ | ||
| \\ | \\ | ||
| - | ===== Registers ===== | + | <code asm> | 
| + | ADDR_HEXSW | ||
| + | |||
| + | LDR r0, =ADDR_HEXSW | ||
| + | LDRB r1, [r0, #0] ; Read HEXSW into the lower nibble of a byte. | ||
| + | </ | ||
| + | \\ | ||
| - | The Registers are read only. | ||
| - | |||
| - | \\ {{ctboard_hexsw_reg.svg}} \\ \\ | ||
| - | |||
| - | ===== Diagram ===== | ||
| - | |||
| - | \\ {{: | ||