ROHS EmETXe-i9652 User Manual page 78

Table of Contents

Advertisement

C Language Code
/*-----
Include Header Area -----*/
#include "math.h"
#include "stdio.h"
#include "dos.h"
/*-----
routing, sub-routing -----*/
void main(int argc, char *argv[])
{
int SMB_PORT_AD = 0x400;
int SMB_DEVICE_ADD = 0x6e;
int i,j;
/*
Index x0, GPIO1x Output pin control, Set all pin as output
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x10,0xff);
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x20,0xff);
delay(10);
/*
Index x1, GPIO1x Output Data value, all low */
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x11,0x00);
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x21,0x00);
delay(3000);
/*
Index x1, GPIO1x Output Data value, all high */
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x11,0xff);
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x21,0xff);
delay(3000);
/*
printf("Digital I/O pin 7,5,3,1 ouput high ...\n"); */
/*
Index x1, GPIO1x Output Data value
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x11,0xAA);
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x21,0xAA);
delay(3000);
/*
printf("Digital I/O pin 6,4,2,0 ouput high ...\n"); */
/*
Index 11, GPIO1x Output Data value
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x11,0x55);
SMB_Byte_WRITE(SMB_PORT_AD,SMB_DEVICE_ADD,0x21,0x55);
delay(1500);
/*75111R's Add=6eh */
*/
*/
- 74 -
Appendix
*/

Advertisement

Table of Contents
loading

Table of Contents