beautypg.com

1 mapi_dioconfig(), Dio configuration ( future release ), Mapi_dioconfig() – Maxim Integrated 78M6612 M-API Library User Manual

Page 35

background image

UG_6612_036

78M6612 M-API Library User Guide

Rev. 1.00

35

4.7 DIO Configuration (future release)

4.7.1 MAPI_DIOConfig()

Purpose

Configure the DIOs to be a specific function. Note: DIO 1 – 8 are part of 80515
USER0 SFR (0x80). DIO8-15 are part of 80515 USER1 SFR (0x90). And
DIO16-21 are part of 80515 USER2 SFR (0xA0). These are all bit-addressable
SFR. An application shall call this API either right before or right after calling
MAPI_Init() to setup all the signals properly. Each member of the Signals_t
structure shall be assigned the appropriate DIO pin as defined in the enum type
DIO_NO. The library is built with specific default assignments as follows: ActiveB
= DIO20, FaultB = DIO21, ReadyB = DIO11, Relay1 = DIO7, Relay2 = DIO19.
When unsure, it’s best to call this API with a Get Operation (OP=1) to get current
settings prior to changing any DIO assignments.

Synopsis

void MAPI_DIOConfig (struct Signals_t *Signals, uint8_t OP)

Where:

//all possible DIO signals
struct Signals_t {

uint8_t ActiveB;

uint8_t Alarm;

uint8_t FaultB;

uint8_t ReadyB;

uint8_t Relay1;

uint8_t Relay2;

uint8_t SAG_sign;

uint8_t WPulse;

uint8_t RFU;

//Customer’s specific –delete?

uint8_t RFU;

//Customer’s specific –delete?

uint8_t RFU;

//Customer’s specific –delete?

uint8_t RFU;

//Customer’s specific –delete?

uint8_t RFU;

//Customer’s specific –delete?

uint8_t Unused1;

uint8_t Unused2;

uint8_t Unused3;

};

enum DIO_NO { DIO0=0x00, DIO1, DIO2, DIO3, DIO4, DIO5, DIO6, DIO7,

DIO8, DIO9, DIO10, DIO11, DIO12, DIO13, DIO14, DIO15,

DIO16, DIO17, DIO18, DIO19, DIO20, DIO21, DIO22, DIO23};

Parameters

OP - Input parameter

Get (1) or Set DIO assignments.


Signals

- Input parameter (OP = 1)/ Output parameter (OP = 0)

When OP = 1, return the current DIO pin assignments.
When OP = 0, set all DIO pin assignment according to the value assigned to
Signals..

Return Codes None.

Note: care must be taken when assigning the same DIO to be used for different functions as
there is no checking in the library for any conflict that may arise. For example, DIO6 may be used
to drive a LED and to be used as part of the I2C function. The library does NOT check for this
conflict of usage.