RD Controls Design Note 65.0<P> <b> User Interface to the ACP LAM Interface</b>

RD Controls Design Note 65.0

User Interface to the ACP LAM Interface

Brian J. Kramper

Fri Mar 29 09:05:11 CST 1996

Introduction

There is a need for services which provide a path between tasks in the ACP and events occurring asynchronously in the rest of the CAMAC crate. It would also be beneficial if these services could also provide a means for the tasks to execute a short piece of code immediately following the event. Each module in a CAMAC crate has the possibility of asserting its LAM line. These LAM lines are connected to three Am9519As which, when properly programmed, can generate an interrupt. By establishing a mapping between a task in the ACP and an interrupt line on one of the three Am9519As, we can provide this path.

ACP LAM Service Routines

A connection between a task and a specific LAM is established with the connect_to_lam subroutine. Only one task may connect to a LAM at any one time. The calling task's identifier is obtained by using the VRTX32 sc_tinquiry function. Even though a task has established a connection with a LAM, it must still enable the interrupt for that particular LAM before it will be activated. This is accomplished with the enable_lam subroutine. All LAM interrupts are disabled at initialization, and the individual LAM interrupt is disabled upon entry to the interrupt service routine. No LAM interrupt is enabled until specifically requested by the task which has already established a connection with the LAM. The connection is terminated and the LAM interrupt disabled with the disconnect_from_lam subroutine.

Request Connection To LAM

connect_to_lam

status = connect_to_lam( lam_number, function, p1, p2 )

Request to establish a connection between the specified lam and the requesting task. The requesting task specifies the entry point of a section of code to be executed at interrupt level with two pointer-sized arguments which will be passed to the user code. This allows the user to do a number of operations, e.g., to be able to place an entry on one of the user task's queues with a specific message.

lam_number Longword value in range 1 to 24 indicating lam to establish connection to. function Pointer-sized entry point of user task code to be executed at interrupt level. p1,p2 Pointer-sized parameters available to the user task code. status

OK success ER_LNA lam entry not available ER_OUT lam number out of range

Disconnect From LAM

disconnect_from_lam

status = disconnect_from_lam( lam_number )

Cancel the previously defined connection between the calling task and this lam.

lam_number Longword value in range 1 to 24 indicating lam to disconnect from. status

OK success ER_NXC non-existent connection ER_OUT lam number out of range

Enable Interrupt From LAM

enable_lam

status = enable_lam( lam_number )

Enable interrupt for specified lam. The calling task must have already established a connection to the specified lam by a previous connect_to_lam.

lam_number Longword value in range 1 to 24 indicating lam for which interrupts are to be enabled. status

OK success ER_NXC task has not established connection ER_OUT lam number out of range

Security, Privacy, Legal

rwest@fsus04.fnal.gov