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:44] – [Registers] 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: |
- | + | ||
- | The code snippet bellow shows how to use the HEXSW. | + | |
- | + | ||
- | <code c> | + | |
- | #include " | + | |
- | + | ||
- | uint8_t data = CT_HEXSW; | + | |
- | </ | + | |
\\ | \\ | ||
===== Registers ===== | ===== Registers ===== | ||
- | The Registers | + | **Caveat:** Register bits [7:4] are read as ' |
+ | |||
+ | The register is read only. | ||
\\ {{ctboard_hexsw_reg.svg}} \\ \\ | \\ {{ctboard_hexsw_reg.svg}} \\ \\ | ||
Line 24: | Line 18: | ||
\\ {{: | \\ {{: | ||
+ | |||
+ | ===== 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. | ||
+ | </ | ||
+ | \\ | ||
+ |