Hello,
i would like and example in 'C' code to use :
1.pin 5 Dout (output) with HW_SetDOUT ?
2.pin 6 Din (input) with HW_GetDIN ?
on PCAN-RS232?
Regards
Dout and Din pins on PCAN-RS-232
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Dout and Din pins on PCAN-RS-232
please see Header file on product Disk
Here a simple code part how to use it:
#read the input:
#set the output:
We will create a #define for the DIO in the next release of the Firmware to keep it more simple!
Code: Select all
//! @brief
//! Read digital inputs. Each bit will represent a digital pin.
//! Not available on PCAN-Router Pro
//!
//! @param buffer Buffer for DIN-value
//!
//! @return one error of HW_ERR_...
HWStatus_t HW_GetDIN ( u32_t *buffer);
//! @brief
//! Set digital outputs. Each bit will represent a digital pin.
//! Only available on PCAN-RS-232.
//!
//! @param buffer Buffer for DOUT-value
//!
//! @return one error of HW_ERR_...
HWStatus_t HW_SetDOUT ( u32_t *buffer);
#read the input:
Code: Select all
HW_GetDIN (&inbuf);
if ((inbuf&1) == 1) // Din1 = hi ? -- means PIN 6 of Module
{...}
Code: Select all
outbuf = 1;
HW_SetDOUT (&outbuf); // Dout-1, low-active: 0=open, 1=GND !!! -- means PIN 5 of Module
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
- PEAK-Support
- Sales & Support
- Posts: 1646
- Joined: Fri 10. Sep 2010, 19:34
Re: Dout and Din pins on PCAN-RS-232
We now have add a sample projekt for the Digital I/O to the product information.
Please see sample 8 on the Product DVD in the section Develop - Microcontroller hardware - PCAN-RS232 - Examples.
main.c
Please see sample 8 on the Product DVD in the section Develop - Microcontroller hardware - PCAN-RS232 - Examples.
main.c
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------