CANopen Slave Documentation
Version 6.16.04
|
This module implements the variables and callback functions for the object dictionary from CiA 401 (digital inputs). The module adds the following objects to the object dictionary:
Index | Description | Function / Variable | Configuration Symbol |
---|---|---|---|
6000h | Read input 8-bit | Cos401_Idx6000() | COS_DS401_DI |
6002h | Change polarity input 8-bit | Cos401_Idx6002() | COS_DS401_DI |
6005h | Global interrupt enable | Cos401_Idx6005() | COS_DS401_DI |
6006h | Interrupt mask any change 8-bit | Cos401_Idx6006() | COS_DS401_DI |
6007h | Interrupt mask Low-to-High | Cos401_Idx6007() | COS_DS401_DI |
6008h | Interrupt mask High-to-Low | Cos401_Idx6008() | COS_DS401_DI |
Functions | |
uint8_t | Cos401_DI_PdoSend (uint8_t ubGroupV) |
uint8_t | Cos401_DI_Read (uint8_t ubGroupV) |
void | Cos401_DI_Set (uint8_t ubGroupV, uint8_t ubValueV) |
uint8_t Cos401_DI_PdoSend | ( | uint8_t | ubGroupV | ) |
ubGroupV | input group number |
The functions returns 1 if a PDO transmission is requested, otherwise 0.
uint8_t Cos401_DI_Read | ( | uint8_t | ubGroupV | ) |
[in] | ubGroupV | input group number |
This function returns the actual state of a digital input block defined by ubGroupV and sends a PDO if the state has changed. The parameter ubGroupV defines the zero based group number.
void Cos401_DI_Set | ( | uint8_t | ubGroupV, |
uint8_t | ubValueV | ||
) |
[in] | ubGroupV | input group number |
[in] | ubValueV | digital input value |
This function sets the actual value of the input ports. The parameter ubGroupV denotes the group number. The first group of 8 digital inputs starts at index 0 (i.e. sub-index - 1 of object 6000h). This function needs to be called from the application code (e.g. interrupt handler, main loop) in order to setup the value for the digital inputs.
Example