Added more objects to BDK port, and connected AI to ADC7, and BI0..BI4 to PINB0..PINB4. Fixed up some other objects and object API (header files).

This commit is contained in:
skarg
2009-06-18 03:58:54 +00:00
parent 6e6cdf2bc0
commit e70dd3c7ba
18 changed files with 814 additions and 29 deletions
+19 -3
View File
@@ -39,6 +39,8 @@
#error Modify the Analog_Input_Name to handle multiple digits
#endif
static uint8_t Present_Value[MAX_ANALOG_INPUTS];
/* These three arrays are used by the ReadPropertyMultiple handler */
static const int Analog_Input_Properties_Required[] = {
PROP_OBJECT_IDENTIFIER,
@@ -76,7 +78,11 @@ void Analog_Input_Property_Lists(
return;
}
static uint8_t Present_Value[MAX_ANALOG_INPUTS];
void Analog_Input_Init(
void)
{
return;
}
/* we simply have 0-n object instances. Yours might be */
/* more complex, and then you need validate that the */
@@ -117,17 +123,27 @@ char *Analog_Input_Name(
return NULL;
}
static float Analog_Input_Present_Value(
float Analog_Input_Present_Value(
uint32_t object_instance)
{
float value = 0.0;
if (object_instance < MAX_ANALOG_INPUTS)
if (object_instance < MAX_ANALOG_INPUTS) {
value = Present_Value[object_instance];
}
return value;
}
void Analog_Input_Present_Value_Set(
uint32_t object_instance,
float value)
{
if (object_instance < MAX_ANALOG_INPUTS) {
Present_Value[object_instance] = value;
}
}
/* return apdu length, or -1 on error */
/* assumption - object has already exists */
int Analog_Input_Encode_Property_APDU(