CANopen Slave Documentation
Version 6.16.04
Loading...
Searching...
No Matches
cos401do.h File Reference

Detailed Description

This module implements the variables and callback functions for the object dictionary from CiA 401 (digital outputs). The module adds the following objects to the object dictionary:

Index Description Function / Variable Configuration Symbol
6200h Write output 8-bit Cos401_Idx6200() COS_DS401_DO
6202h Change polarity output 8-bit Cos401_Idx6202() COS_DS401_DO
6206h Error mode output 8-bit Cos401_Idx6206() COS_DS401_DO
6207h Error value output 8-bit Cos401_Idx6207() COS_DS401_DO
+ Include dependency graph for cos401do.h:

Functions

void Cos401_DO_Error (uint8_t ubEnableV)
 
uint8_t Cos401_DO_Set (uint8_t ubGroupV, uint8_t ubValueV)
 

Function Documentation

◆ Cos401_DO_Error()

void Cos401_DO_Error ( uint8_t  ubEnableV)
Parameters
[in]ubEnableVset / reset error condition

This function sets / resets the digital output module error condition. Passing a 0 to ubEnableV resets the error condition, passing a 1 to ubEnableV sets the error condition. If the error condition is set, the outputs are set according to the objects 6206h and 6207h.

◆ Cos401_DO_Set()

uint8_t Cos401_DO_Set ( uint8_t  ubGroupV,
uint8_t  ubValueV 
)
Parameters
[in]ubGroupVoutput group number
[in]ubValueVdigital output value
Returns
actual output driver state

This function sets the parameter ubValueV for the output group defined by ubGroupV to the output port pins. The first group of 8 digital outputs starts at index 0 (i.e. sub-index - 1 of object 6200h).

This function is called by the protocol stack for access to digital output pins.

Example

uint8_t Cos401_DO_Set(uint8_t ubGroupV, uint8_t ubValueV)
{
//------------------------------------------------------------------------------
// set digital outputs on target hardware here
//
return 0;
}
uint8_t Cos401_DO_Set(uint8_t ubGroupV, uint8_t ubValueV)