B.1 Digital I/O sample code:
/*---------------------------------------------------------------------------
*
*
*
*
*
Copyright (c) 2020-21 Axiomtek Corporation
*
*
*
*
*
*
*
*
*
*
*
*
*----------------------------------------------------------------------------*/
#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
#define DIO_PIN2 BIT1
#define DIO_PIN3 BIT2
#define DIO_PIN4 BIT3
#define DIO_PIN5 BIT4
#define DIO_PIN6 BIT5
#define DIO_PIN7 BIT6
#define DIO_PIN8 BIT7
void main()
{
unsigned char
BIT7 is output
unsigned char
do not care,BIT4-BIT7 is High
clrscr();
outportb(AXIOM_DIO_IN_OUT_ADDR, DIO_DefaultInOutSetting); // Set DIO
input/output,1:input,0:output,BIT0-BIT3 is input,BIT4-BIT7 is output
Digital I/O
$Workfile:
AxiomDIO.cpp $
This program contains proprietary and confidential information.
All rights reserved except as may be permitted by prior
written consent.
Content:
Date
----------
----------
//corespondce to HW pin is GPI0
//corespondce to HW pin is GPI1
//corespondce to HW pin is GPI2
//corespondce to HW pin is GPI3
//corespondce to HW pin is GPO0
//corespondce to HW pin is GPO1
//corespondce to HW pin is GPO2
//corespondce to HW pin is GPO3
DIO_DefaultInOutSetting = 0x0F; // BIT0-BIT3 is input,BIT4-
DIO_DefaultHighLowSetting = 0xF0;// BIT0-BIT3 is input so
CEM320 COM Express
Appendix B
R E V I S I O N
H I S T O R Y
Who
-----------------
0xFA31
0xFA32
TM
Type 10 Mini Module
Digital I/O
Change
57
Need help?
Do you have a question about the CEM320 and is the answer not in the manual?