7 #ifndef __MSP430WARE_SAPH_H__ 8 #define __MSP430WARE_SAPH_H__ 10 #include "inc/hw_memmap.h" 12 #ifdef __MSP430_HAS_SAPH__ 31 #define SAPH_PHY_CHANNEL_COUNT 2 33 typedef struct _phy_param {
73 typedef struct _phy_bias {
78 uint16_t biasSwitch[SAPH_PHY_CHANNEL_COUNT];
115 typedef struct _ppg_count
138 typedef struct _ppg_config
163 typedef struct _asq_config
209 typedef struct _asq_ping_config
219 typedef struct _mcnf_config
248 #define SAPH_DATA_ERROR_INTERRUPT DATAERR 249 #define SAPH_TIMEMARK_F_TIMEOUT_INTERRUPT TMFTO 250 #define SAPH_ACQUISITION_SEQUENCER_DONE_INTERRUPT SEQDN 251 #define SAPH_PING_TRANSMIT_DONE_INTERRUPT PNGDN 259 #define SAPH_PHY_CHANNEL_1 0 260 #define SAPH_PHY_CHANNEL_2 1 268 #define SAPH_PHY_OUTPUT_HIGH CH0OUT_1 269 #define SAPH_PHY_OUTPUT_LOW CH0OUT_0 277 #define SAPH_PHY_OUTPUT_ENABLE CH0OE_1 278 #define SAPH_PHY_OUTPUT_DISABLE CH0OE_0 286 #define SAPH_PHY_FULLPULL_ENABLE CH0FP_1 287 #define SAPH_PHY_FULLPULL_DISABLE CH0FP_0 295 #define SAPH_PHY_TERMINATION_ENABLE CH0TERM_1 296 #define SAPH_PHY_TERMINATION_DISABLE CH0TERM_0 304 #define SAPH_PHY_OUTPUT_GENERAL_PURPOSE PCH0SEL_0 305 #define SAPH_PHY_OUTPUT_PULSEGENERATOR_SINGLE_DRIVE PCH0SEL_1 306 #define SAPH_PHY_OUTPUT_PULSEGENERATOR_DIFFERENTIAL_DRIVE PCH0SEL_2 314 #define SAPH_PHY_DUMMYLOAD_ENABLE DUMEN_1 315 #define SAPH_PHY_DUMMYLOAD_DISABLE DUMEN_0 323 #define SAPH_PHY_SOURCE_CONTROLLED_BY_REGISTER MUXCTL_0 324 #define SAPH_PHY_SOURCE_CONTROLLED_BY_ASQ MUXCTL_1 332 #define SAPH_PHY_INPUT_CHANNEL_0 MUXSEL__CH0IN 333 #define SAPH_PHY_INPUT_CHANNEL_1 MUXSEL__CH1IN 341 #define SAPH_PHY_BIAS_SWITCH_OPEN CH0EBSW_0 342 #define SAPH_PHY_BIAS_SWITCH_CLOSED CH0EBSW_1 350 #define SAPH_PHY_PGA_BIAS_GROUNDED PGABIAS_0 351 #define SAPH_PHY_PGA_BIAS_LOW_VALUE PGABIAS_1 352 #define SAPH_PHY_PGA_BIAS_NOMINAL_VALUE PGABIAS_2 353 #define SAPH_PHY_PGA_BIAS_HIGH_VALUE PGABIAS_3 361 #define SAPH_PHY_EXCITATION_BIAS_GROUNDED EXCBIAS_0 362 #define SAPH_PHY_EXCITATION_BIAS_LOW_VALUE EXCBIAS_1 363 #define SAPH_PHY_EXCITATION_BIAS_NOMINAL_VALUE EXCBIAS_2 364 #define SAPH_PHY_EXCITATION_BIAS_HIGH_VALUE EXCBIAS_3 372 #define SAPH_PHY_MULTIPLEXER_CHARGEPUMP_ENABLE CPDA_1 373 #define SAPH_PHY_MULTIPLEXER_CHARGEPUMP_DISABLE CPDA_0 381 #define SAPH_PHY_LEAKAGE_COMPENSATION_ENABLE LILC_1 382 #define SAPH_PHY_LEAKAGE_COMPENSATION_DISABLE LILC_0 390 #define SAPH_PHY_PGA_BIAS_SWITCH_OPEN PGABSW_0 391 #define SAPH_PHY_PGA_BIAS_SWITCH_CLOSED PGABSW_1 399 #define SAPH_PHY_BIAS_SWITCH_CONTROLLED_BY_REGISTER ASQBSC_0 400 #define SAPH_PHY_BIAS_SWITCH_CONTROLLED_BY_ASQ ASQBSC_1 408 #define SAPH_PPG_HIGH_IMPEDANCE_ON_PAUSE_HIGH PHIZ_1 409 #define SAPH_PPG_HIGH_IMPEDANCE_ON_PAUSE_LOW PHIZ_0 417 #define SAPH_PPG_PAUSE_LEVEL_HIGH PLEV_1 418 #define SAPH_PPG_PAUSE_LEVEL_LOW PLEV_0 426 #define SAPH_PPG_PAUSE_POLARITY_HIGH PPOL_0 427 #define SAPH_PPG_PAUSE_POLARITY_LOW PPOL_1 435 #define SAPH_PPG_PRESCALER_ENABLE PSCEN_1 436 #define SAPH_PPG_PRESCALER_DISABLE PSCEN_0 444 #define SAPH_PPG_TRIGGER_SOURCE_SOFTWARE TRSEL_0 445 #define SAPH_PPG_TRIGGER_SOURCE_ASQ TRSEL_1 446 #define SAPH_PPG_TRIGGER_SOURCE_TIMER TRSEL_2 454 #define SAPH_PPG_CHANNEL_0 PPGCHSEL_0 455 #define SAPH_PPG_CHANNEL_1 PPGCHSEL_1 463 #define SAPH_PPG_PORT_CHARGED_BY_PPG PGSEL_0 464 #define SAPH_PPG_PORT_CHARGED_BY_ASEQ PGSEL_1 472 #define SAPH_ASQ_ABORT_ON_ERROR_ENABLE ERABRT_1 473 #define SAPH_ASQ_ABORT_ON_ERROR_DISABLE ERABRT_0 481 #define SAPH_ASQ_TRIGGER_SOURCE_SOFTWARE TRIGSEL__SWTRIG 482 #define SAPH_ASQ_TRIGGER_SOURCE_P_SEQUENCER TRIGSEL__PSQ 483 #define SAPH_ASQ_TRIGGER_SOURCE_TIMER TRIGSEL__TIMER 491 #define SAPH_ASQ_CHANNEL_0 ASQCHSEL_0 492 #define SAPH_ASQ_CHANNEL_1 ASQCHSEL_1 500 #define SAPH_ASQ_DIFFERENT_CHANNEL CHOWN_0 501 #define SAPH_ASQ_IDENTICAL_CHANNEL CHOWN_1 509 #define SAPH_ASQ_STANDBY_INDICATION_POWEROFF STDBY__PWROFF 510 #define SAPH_ASQ_STANDBY_INDICATION_STANDBY STDBY__STDBY 518 #define SAPH_ASQ_END_OF_SEQUENCE_OFF_DISABLE ESOFF_0 519 #define SAPH_ASQ_END_OF_SEQUENCE_OFF_ENABLE ESOFF_1 527 #define SAPH_ASQ_EARLY_RECEIVE_BIAS_BY_TIMEMARK_C EARLYRB_0 528 #define SAPH_ASQ_EARLY_RECEIVE_BIAS_BY_TIMEMARK_A EARLYRB_1 536 #define SAPH_ASQ_TOGGLE_CHANNEL_ENABLE CHTOG_1 537 #define SAPH_ASQ_TOGGLE_CHANNEL_DISABLE CHTOG_0 545 #define SAPH_LOW_POWER_BIAS_MODE_DISABLE LPBE_0 546 #define SAPH_LOW_POWER_BIAS_MODE_ENABLE LPBE_1 554 #define SAPH_CHARGE_PUMP_ON_SDHS_ASQ_REQUESTS_ONLY CPEO_0 555 #define SAPH_CHARGE_PUMP_ON_ALWAYS CPEO_1 563 #define SAPH_MCNF_500_OHMS_RXBIAS_450_OHMS_TXBIAS BIMP_0 564 #define SAPH_MCNF_900_OHMS_RXBIAS_850_OHMS_TXBIAS BIMP_1 565 #define SAPH_MCNF_1500_OHMS_RXBIAS_1450_OHMS_TXBIAS BIMP_2 566 #define SAPH_MCNF_2950_OHMS_RXBIAS_2900_OHMS_TXBIAS BIMP_3 607 extern void SAPH_lock(uint16_t baseAddress);
735 uint16_t enableDummyLoad, uint16_t sourceControl, uint16_t inputChannel);
950 uint16_t prescalerStartValue);
1087 #endif // __MSP430WARE_SAPH_H__ uint8_t SAPH_getASQPingCounter(uint16_t baseAddress)
Gets ping counter of acquisition sequencer.
Definition: saph.c:162
uint16_t abortOnError
Definition: saph.h:170
uint16_t enableChannelToggle
Definition: saph.h:206
uint16_t polarity
Sets ASQ ping counter for polarity.
Definition: saph.h:212
void SAPH_configurePPGCount(uint16_t baseAddress, SAPH_configPPGCountParam *config)
Configures pulse generator count.
Definition: saph.c:103
uint16_t lowPowerBiasMode
Definition: saph.h:225
uint16_t biasSwitchASQ
Definition: saph.h:112
uint16_t enableFullPull
Definition: saph.h:53
void SAPH_triggerPPG(uint16_t baseAddress)
Triggers pulse generator.
Definition: saph.c:131
void SAPH_clearInterrupt(uint16_t baseAddress, uint8_t mask)
Clears SAPH interrupts.
Definition: saph.c:31
uint16_t biasExcitation
Definition: saph.h:92
void SAPH_clearASQTimer(uint16_t baseAddress)
Clears acquisition timer.
Definition: saph.c:195
uint16_t endOfSequence
Definition: saph.h:196
void SAPH_disableLowPowerBiasMode(uint16_t baseAddress)
Disables low power bias operation mode.
Definition: saph.c:217
void SAPH_triggerASQ(uint16_t baseAddress)
Triggers acquisition sequencer.
Definition: saph.c:152
void SAPH_unlock(uint16_t baseAddress)
Unlocks certain SAPH registers.
Definition: saph.c:21
uint16_t channelSelect
Definition: saph.h:155
void SAPH_configurePHYMultiplexer(uint16_t baseAddress, uint16_t enableDummyLoad, uint16_t sourceControl, uint16_t inputChannel)
Configures physical interface multiplexer.
Definition: saph.c:81
void SAPH_configurePHYBias(uint16_t baseAddress, SAPH_configPHYBiasParam *config)
Configures physical interface bias.
Definition: saph.c:88
void SAPH_enableLowPowerBiasMode(uint16_t baseAddress)
Enables low power bias operation mode.
Definition: saph.c:212
void SAPH_configurePPG(uint16_t baseAddress, SAPH_configPPGParam *config)
Configures pulse generator.
Definition: saph.c:123
void SAPH_configureASQTimeBase(uint16_t baseAddress, uint16_t prescalerStartValue)
Configures acquisition sequencer time base parameters.
Definition: saph.c:179
uint8_t SAPH_getInterruptStatus(uint16_t baseAddress, uint8_t mask)
Gets the current SAPH interrupt status.
Definition: saph.c:46
void SAPH_configureMode(uint16_t baseAddress, SAPH_configModeParam *config)
Configures certain mode configuration parameters.
Definition: saph.c:200
void SAPH_configureASQPing(uint16_t baseAddress, SAPH_configASQPingParam *config)
Configures acquisition sequencer ping parameters.
Definition: saph.c:167
uint16_t chargePump
Definition: saph.h:230
uint16_t enableChargePump
Definition: saph.h:97
void SAPH_startASQTimer(uint16_t baseAddress)
Starts acquisition timer.
Definition: saph.c:185
void SAPH_setPPGLowPeriod(uint16_t baseAddress, uint16_t period)
Sets pulse generator low period.
Definition: saph.c:111
uint16_t channelSelect
Definition: saph.h:181
uint16_t portSelect
Definition: saph.h:160
uint16_t biasSwitchPGA
Definition: saph.h:107
uint16_t outputFunction
Definition: saph.h:64
uint16_t pauseLevel
Sets ASQ ping counter for pause level.
Definition: saph.h:214
uint16_t stopPauseCount
Sets the stop pulse count.
Definition: saph.h:133
uint16_t triggerSource
Definition: saph.h:150
void SAPH_enableChargePumpAlways(uint16_t baseAddress)
Keeps charge pump of the input multiplexer always on.
Definition: saph.c:222
void SAPH_stopASQTimer(uint16_t baseAddress)
Stops acquisition timer.
Definition: saph.c:190
uint16_t terminationTrim
Is the channel termination trim pattern.
Definition: saph.h:70
void SAPH_setPPGHighPeriod(uint16_t baseAddress, uint16_t period)
Sets pulse generator high period.
Definition: saph.c:117
uint16_t channel
Definition: saph.h:38
uint16_t pullDownTrim
Is the channel pull down trim pattern.
Definition: saph.h:68
void SAPH_configureASQ(uint16_t baseAddress, SAPH_configASQParam *config)
Configures acquisition sequencer.
Definition: saph.c:141
uint16_t standByIndication
Definition: saph.h:191
void SAPH_enableChargePumpOnAcquisitionOnly(uint16_t baseAddress)
Charge pump of input multiplexer is only turned on by data acquisition.
Definition: saph.c:227
uint16_t biasImpedance
Definition: saph.h:237
uint16_t highImpedance
Definition: saph.h:121
uint16_t pausePolarity
Definition: saph.h:131
uint16_t enableOutput
Definition: saph.h:48
uint16_t biasPGA
Definition: saph.h:85
uint16_t outputValue
Definition: saph.h:43
uint16_t triggerSource
Definition: saph.h:176
void SAPH_stopASQ(uint16_t baseAddress)
Stops acquisition sequencer.
Definition: saph.c:157
uint16_t excitationPulseCount
Sets the excitation pulse count.
Definition: saph.h:135
uint16_t earlyReceiveBias
Definition: saph.h:201
void SAPH_setBiasGeneratorImpedance(uint16_t baseAddress, uint16_t biasImpedance)
Sets impedance of the buffers for RxBias and TxBias.
Definition: saph.c:232
void SAPH_enableInterrupt(uint16_t baseAddress, uint8_t mask)
Enables SAPH interrupts.
Definition: saph.c:36
uint16_t enableTermination
Definition: saph.h:58
void SAPH_configurePHY(uint16_t baseAddress, SAPH_configPHYParam *config)
Configures physical interface output and trim values.
Definition: saph.c:51
uint16_t pauseHighImpedance
Sets ASQ ping counter for high impedance.
Definition: saph.h:216
void SAPH_lock(uint16_t baseAddress)
Locks certain SAPH registers.
Definition: saph.c:26
void SAPH_disableInterrupt(uint16_t baseAddress, uint8_t mask)
Disables selected SAPH interrupt sources.
Definition: saph.c:41
void SAPH_stopPPG(uint16_t baseAddress)
Stops pulse generator.
Definition: saph.c:136
uint16_t pullUpTrim
Is the channel pull up trim pattern.
Definition: saph.h:66
uint16_t enableLeakageCompensation
Definition: saph.h:102
uint16_t pauseLevel
Definition: saph.h:126
uint16_t enablePrescaler
Definition: saph.h:144
uint16_t sideOfChannel
Definition: saph.h:186