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/11 07:26] – 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 ===== | ===== Registers ===== | ||
| - | The Registers | + | **Caveat:** Register bits [7:4] are read as ' | 
| - | {{ctboard_hexsw_reg.svg}} | + | The register is read only. | 
| + | |||
| + | \\ {{ctboard_hexsw_reg.svg}} | ||
| ===== Diagram ===== | ===== Diagram ===== | ||
| \\ {{: | \\ {{: | ||
| + | |||
| + | ===== Programming Example ===== | ||
| + | |||
| + | The code snippets below show how to use the HEXSW. | ||
| + | |||
| + | <code c> | ||
| + | #include " | ||
| + | |||
| + | uint8_t data = CT_HEXSW; | ||
| + | </ | ||
| + | \\ | ||
| + | |||
| + | <code asm> | ||
| + | ADDR_HEXSW | ||
| + |  | ||
| + | LDR r0, =ADDR_HEXSW | ||
| + | LDRB r1, [r0, #0] ; Read HEXSW into the lower nibble of a byte. | ||
| + | </ | ||
| + | \\ | ||
| + | |||