53 #include <ti/drivers/SPI.h> 54 #include <ti/drivers/GPIO.h> 57 #include "ti_drivers_config.h" 96 #define nDRDY_PORT (GPIO_PORTK_BASE) 97 #define nDRDY_PIN (GPIO_PIN_7) 98 #define nDRDY_INT (INT_GPIOK) 99 #define nCS_PORT (GPIO_PORTQ_BASE) 100 #define nCS_PIN (GPIO_PIN_1) 101 #define nRESET_PORT (GPIO_PORTM_BASE) 102 #define nRESET_PIN (GPIO_PIN_7) 103 #define START_PORT (GPIO_PORTH_BASE) 104 #define START_PIN (GPIO_PIN_1) 111 void delay_ms(
const uint32_t delay_time_ms);
112 void delay_us(
const uint32_t delay_time_us);
118 void setCS(
bool state );
142 #define HIGH ((bool) true) 145 #define LOW ((bool) false) bool InitADCPeripherals(SPI_Handle *spiHdl)
InitADCPeripherals() Initialize MCU peripherals and pins to interface with ADC.
Definition: hal.c:272
void setRESET(bool state)
setRESET() Sets the state of the MCU ADC_RESET GPIO pin
Definition: hal.c:329
This header file contains all register map definitions for the ADS124S08 device family.
void InitGPIO(void)
InitGPIO() Configures the MCU's GPIO pins that interface with the ADC.
Definition: hal.c:179
bool getSTART(void)
getSTART() Returns the state of the MCU's ADC_START GPIO pin
Definition: hal.c:367
void setCS(bool state)
setCS() Sets the state of the "/CS" GPIO pin
Definition: hal.c:530
void spiSendReceiveArrays(SPI_Handle spiHdl, uint8_t DataTx[], uint8_t DataRx[], uint8_t byteLength)
spiSendReceiveArrays() Sends SPI commands to ADC and returns a response in array format ...
Definition: hal.c:604
bool getRESET(void)
getRESET() Returns the state of the MCU's ADC_RESET GPIO pin
Definition: hal.c:311
bool waitForDRDYHtoL(uint32_t timeout_ms)
waitForDRDYHtoL() Waits for a nDRDY GPIO to go from High to Low or until a timeout condition occurs T...
Definition: hal.c:577
void sendRESET(SPI_Handle spiHdl)
sendRESET() Sends RESET Command through SPI, then waits 4096 tCLKs
Definition: hal.c:476
void setDRDYinterruptStatus(const bool value)
setDRDYinterruptStatus() Sets the value of the nDRDY interrupt flag.
Definition: hal.c:91
void setSTART(bool state)
setSTART() Sets the state of the MCU START GPIO pin
Definition: hal.c:384
void delay_ms(const uint32_t delay_time_ms)
delay_ms() Provides a timing delay with 'ms' resolution.
Definition: hal.c:135
void sendSTART(SPI_Handle spiHdl)
sendSTART() Sends START Command through SPI
Definition: hal.c:440
void enableDRDYinterrupt(const bool intEnable)
enableDRDYinterrupt() Enables or disables the nDRDY interrupt.
Definition: hal.c:104
void toggleRESET(void)
toggleRESET() Pulses the /RESET GPIO pin low
Definition: hal.c:345
bool getDRDYinterruptStatus(void)
getDRDYinterruptStatus() Gets the current status of nDRDY interrupt flag.
Definition: hal.c:78
bool getCS(void)
getCS() Returns the state of the MCU's ADC_CS GPIO pin
Definition: hal.c:546
void delay_us(const uint32_t delay_time_us)
delay_us() Provides a timing delay with 'us' resolution.
Definition: hal.c:154
uint8_t spiSendReceiveByte(SPI_Handle spiHdl, uint8_t dataTx)
spiSendReceiveByte() Sends a single byte to ADC and returns a response
Definition: hal.c:657
void InitSPI(void)
InitSPI() Configures the MCU's SPI peripheral, for interfacing with the ADC.
Definition: hal.c:231
void sendSTOP(SPI_Handle spiHdl)
sendSTOP() Sends STOP Command through SPI
Definition: hal.c:458
void toggleSTART(bool direction)
toggleSTART() Pulses the START GPIO pin low param[in] direction sets the toggle direction base on ini...
Definition: hal.c:405
void sendWakeup(SPI_Handle spiHdl)
sendWakeup() Sends WAKEUP command through SPI
Definition: hal.c:494
void sendPowerDown(SPI_Handle spiHdl)