How to access CANbus/GPIO by Mercury 100 utility

From Ambedded
Revision as of 16:04, 5 May 2015 by Desmond (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Contents


The Mercury 100 has tool to send/receive canbus message and control GPIO ,
you can download this utility source code from this url:
ftp://your_account:your_password@ambedded.com/mercury-100/source/libahal.tar.gz

Mercury 100 pins mode

On the Mercury the external GPIOs correspond to the following pins

Pin ID function Remark
1 Input Low active
2 Input Low active
3 Input Low active
4 Input Low active
5 Output Open Drain Type(DC 24V max/ 5A max)
6 Output Open Drain Type(DC 24V max/ 5A max)
7 Output Open Drain Type(DC 24V max/ 5A max)
8 Output Open Drain Type(DC 24V max/ 5A max)

Accessing GPIOs

SYNOPSIS hal gpio [OPTION]...
  -r num1
Read GPIO status.
  -w num1 level
Set GPIO output status, num1 is GPIO number,and level 1 for high level,0 for low level.

Accessing Canbus

SYNOPSIS
hal can [OPTION]...
The options is like below
  -s num1 num2
Set canbus capability , if num1 = 1,and num2 =500 mean set bitrate 500kbit,and num1 =2,and num2=100 ,mean set current ID to 100.
  -r
Read message from canbus
  -w ID DATA
Write message to canbus,ID is your target machine ID,and DATA is your message .

Personal tools
Namespaces

Variants
Actions
Navigation
Tools