Machine Command Examples; Set Pins 14 And 15 To Gpio Outputs; Set All Gpio Pins As Inputs And Readback; Read A/D Inputs - NetBurner SBL2e User Manual

Hide thumbs Also See for SBL2e:
Table of Contents

Advertisement

7.4 Machine Command Examples

7.4.1 Set Pins 14 and 15 to GPIO Outputs

MG6000
0
MR6000
0
MO6000
0
MO
0,0x6000
MO4000
0
MO
0,0x4000
M?
0,0x5BCC

7.4.2 Set All GPIO Pins as Inputs and Readback

MG7BCC
0
MR0000
0
M?
0,0x3BCC

7.4.3 Read A/D Inputs

MG03C0
0
MQ
// 0=success, A/D values of pins 7,8,9,10, all GPIO inputs as a 16-bit word
0, 0x4F38, 0x4910, 0x42A0, 0x4FE0, 0x3BCC
SBL2e Dual Serial-to-Ethernet User's Manual
Downloaded from
Elcodis.com
electronic components distributor
// Set pin configuration to GPIO mode for both pins
// Return value of 0 for success
// Set GPIO pin direction to output for both pins.
// Return value of 0 for success
// Set GPIO output pin value to 1 for both pins
// Return value of 0 for success
// Query all output pin values
// Success, driving outputs high on pins 14, 15
// Set pin 15 low, pin 14 high
// Success
// Query all output pin values
// Pin 15 low, pin 14 high
// Query all input and output pins
// Pin 15 low, pin 14 high, remaining pins report input value.
// Set pin configuration to GPIO mode for all GPIO capable pins
// Return value of 0 for success
// Set GPIO pin direction to input for all pins.
// Return value of 0 for success
// Read all GPIO input pin values
// Return value of 0 for success (note pins are floating inputs on dev. board)
// Set pin configuration to A/D primary function for all 4 A/D inputs
// Return value of 0 for success
// Read A/D inputs
Page 18

Advertisement

Table of Contents
loading

Related Products for NetBurner SBL2e

Table of Contents