#include <cspiamp.h>


Public Member Functions | |
| CSPIAmp () | |
| void | setChanelGain (CMachine::ubit8 channel, CMachine::ubit8 gain) |
| set channel and gain | |
| void | setChannel (CMachine::ubit8 channel) |
| select channel. | |
| void | setGain (CMachine::ubit8 gain) |
| set gain. | |
| virtual | ~CSPIAmp () |
Private Member Functions | |
| void | functionEnter () |
| void | functionExit () |
Definition at line 35 of file cspiamp.h.
| PikeAero::CSPIAmp::CSPIAmp | ( | ) |
| PikeAero::CSPIAmp::~CSPIAmp | ( | ) | [virtual] |
| void PikeAero::CSPIAmp::functionEnter | ( | ) | [private] |
Activate chip select
disable 25LC1024 CS
enable MCP6S28 CS
Definition at line 37 of file cspiamp.cpp.
References PikeAero::CSPI::disableChipSelect(), PikeAero::CSPI::disableRXInterrupts(), PikeAero::CSPI::disableTXInterrupts(), PikeAero::CSPI::enableChipSelect(), GPIO_PIN_2, and GPIO_PIN_3.
Referenced by setChanelGain(), setChannel(), and setGain().
00038 { 00039 disableRXInterrupts(); 00040 disableTXInterrupts(); 00041 00042 /** Activate chip select */ 00043 disableChipSelect( GPIO_PIN_2 ); /** disable 25LC1024 CS */ 00044 enableChipSelect( GPIO_PIN_3 ); /** enable MCP6S28 CS */ 00045 }


| void PikeAero::CSPIAmp::functionExit | ( | ) | [private] |
Deactivate chip select
disable MCP6S28 CS
Definition at line 47 of file cspiamp.cpp.
References PikeAero::CSPI::disableChipSelect(), and GPIO_PIN_3.
Referenced by setChanelGain(), setChannel(), and setGain().
00048 { 00049 /** Deactivate chip select */ 00050 disableChipSelect( GPIO_PIN_3 ); /** disable MCP6S28 CS */ 00051 }


| void PikeAero::CSPIAmp::setChanelGain | ( | CMachine::ubit8 | channel, | |
| CMachine::ubit8 | gain | |||
| ) |
set channel and gain
address the channel register
select the channel
address the gain register
set the channel gain
Definition at line 56 of file cspiamp.cpp.
References PikeAero::CSPI::clearReceiver(), functionEnter(), functionExit(), PikeAero::CMachine::mutexBSPI2(), and PikeAero::CSPI::tx().
00057 { 00058 CMutexLock mutexLock( CMachine::mutexBSPI2() ); 00059 functionEnter(); 00060 00061 tx( 0x41 ); /** address the channel register */ 00062 tx( channel & 0x07 ); /** select the channel */ 00063 00064 tx( 0x40 ); /** address the gain register */ 00065 tx( gain & 0x07 ); /** set the channel gain */ 00066 00067 clearReceiver(); 00068 functionExit(); 00069 }

| void PikeAero::CSPIAmp::setChannel | ( | CMachine::ubit8 | channel | ) |
select channel.
address the channel register
select the channel
Definition at line 74 of file cspiamp.cpp.
References PikeAero::CSPI::clearReceiver(), functionEnter(), functionExit(), PikeAero::CMachine::mutexBSPI2(), and PikeAero::CSPI::tx().
00075 { 00076 CMutexLock mutexLock( CMachine::mutexBSPI2() ); 00077 functionEnter(); 00078 00079 tx( 0x41 ); /** address the channel register */ 00080 tx( channel & 0x07 ); /** select the channel */ 00081 00082 clearReceiver(); 00083 functionExit(); 00084 }

| void PikeAero::CSPIAmp::setGain | ( | CMachine::ubit8 | gain | ) |
set gain.
address gain register
set the channel gain
Definition at line 89 of file cspiamp.cpp.
References PikeAero::CSPI::clearReceiver(), functionEnter(), functionExit(), PikeAero::CMachine::mutexBSPI2(), and PikeAero::CSPI::tx().
00090 { 00091 CMutexLock mutexLock( CMachine::mutexBSPI2() ); 00092 functionEnter(); 00093 00094 tx( 0x40 ); /** address gain register */ 00095 tx( gain & 0x07 ); /** set the channel gain */ 00096 00097 clearReceiver(); 00098 functionExit(); 00099 }

1.5.8