Appendix B Digital I/O; B.1 About Digital I/O; How To Use Digital I/O - AXIOMTEK CEM521 User Manual

8th generation intel core i7/i5/i3 and celeron processors com express type 6 compact module
Hide thumbs Also See for CEM521:
Table of Contents

Advertisement

B.1 About Digital I/O

The onboard GPIO or digital I/O has 8 bits (DIO0~7). Each bit can be set to function as input or
output by software programming. In default, all pins are pulled high with +3.3V level (according
to main power). The BIOS default settings are 4 inputs and 4 outputs where all of these pins
are set to 1.
B.2 How to Use Digital I/O
/////////////////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <dos.h>
#define AXIOM_DIO_IN_OUT_ADDR
#define AXIOM_DIO_HIGH_LOW_ADDR
#define DIO_PIN1 BIT0 //correspondence to HW pin is GPI0
#define DIO_PIN2 BIT1 //correspondence to HW pin is GPI1
#define DIO_PIN3 BIT2 //correspondence to HW pin is GPI2
#define DIO_PIN4 BIT3 //correspondence to HW pin is GPI3
#define DIO_PIN5 BIT4 //correspondence to HW pin is GPO0
#define DIO_PIN6 BIT5 //correspondence to HW pin is GPO1
#define DIO_PIN7 BIT6 //correspondence to HW pin is GPO2
#define DIO_PIN8 BIT7 //correspondence to HW pin is GPO3
void main()
{
// BIT0-BIT3 is input,BIT4-BIT7 is output
unsigned char DIO_DefaultInOutSetting = 0x0F;
// BIT0-BIT3 is input so do not care,BIT4-BIT7 is High
unsigned char DIO_DefaultHighLowSetting = 0xF0;
clrscr();
// Set DIO input/output,1:input,0:output,BIT0-BIT3 is input,BIT4-BIT7 is output
outportb(AXIOM_DIO_IN_OUT_ADDR, DIO_DefaultInOutSetting);
printf("DIO input/output set to 0x%X \n", DIO_DefaultInOutSetting);
printf("BIT0-BIT3 is setting to input,BIT4-BIT7 is setting to output\n");
Digital I/O
CEM521 COM Express
Appendix B
Digital I/O
0xFA31
0xFA32
TM
Type 6 Module
57

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CEM521 and is the answer not in the manual?

Questions and answers

Table of Contents