This is an old revision of the document!


GPIO

The CT Board offers on the 4 general purpouse ports the following functions:

  • 4 general purpouse I/O ports
    • 32 memory mapped output pins
    • 32 memory mapped input pins
  • 2 general purpouse I/O ports, directly connected to MCUs Port A and B
  • External interface to SRAM bus.

Each of the 4 GPIO ports contains 8 ouput and 8 input pins. The ports are not as fast as the integrated GPIO ports of the microcontroller.

Please make sure the CT Board is in the correct mode.
Supported mode: 1

The code snippet bellow shows how to use the GPIO.

#include "reg_ctboard.h"
 
uint8_t data_byte = CT_GPIO->IN.BYTE.P1;              /* Read byte from P1. */
uint16_t data_hword = CT_GPIO->IN.HWORD.P2_1;         /* Read half word from P1 and P2. */
uint32_t data_word = CT_GPIO->IN.WORD;                /* Read word from all ports (P1..4). */
 
CT_GPIO->OUT.BYTE.P3 = (uint8_t) data_byte;           /* Write byte of data to P3. */
CT_GPIO->OUT.HWORD.P4_3 = (uint16_t) data_halfword;   /* Write halfword of data to P3..4 */
CT_GPIO->OUT.WORD = (uint32_t) data_word;             /* Write data to all ports (P1..4). */


Input




Output

The Registers are read / write.







These two ports are directly connected to the GPIO ports A and B on the microcontroller.
All functions of theese GPIO ports are available.

This functionality is independent of the CT Board mode.
Supported modes: Available in all modes.
Only pins 0..11 are connected to P5 / P6! The other 4 pins are used for 5V, 3.3V and GND.




  • ctboard/peripherals/gpio.1456397040.txt.gz
  • Last modified: 2016/02/25 10:44
  • by feur