This is an old revision of the document!


DIPSW

On the CT Board are 32 DIP switches mounted. They are arranged in 4 groups of 8 DIP switches.
If a DIP switch is in the position “high” (see diagram below) it provides a logical “1”.

Please make sure the CT Board is in the correct mode.
Supported modes: 1, 2, 3


The code snippet bellow shows how to use the DIPSW.

#include "reg_ctboard.h"
 
uint8_t data_byte = CT_DIPSW->BYTE.S7_0;       /* Read byte from S7..0. */
uint16_t data_hword = CT_DIPSW->HWORD.S31_16;  /* Read half word from S31..16. */
uint32_t data_word = CT_DIPSW->WORD;           /* Read all DIPSW at once into a word. */


ADDR_DIPSW      EQU      0x60000200
 
                LDR      r0, =ADDR_DIPSW
                LDRB     r1, [r0, #0]          ; Read byte from S7..0.
                LDRH     r1, [r0, #2]          ; Read half word from S31..16.
                LDR      r1, [r0, #0]          ; Read all DIPSW at once into a word.


The Registers are read only.







  • ctboard/peripherals/dipsw.1456403899.txt.gz
  • Last modified: 2016/02/25 12:38
  • by feur