ADS1282 Example C Code  1.0.0
hal.h
Go to the documentation of this file.
1 
39 #ifndef HAL_H_
40 #define HAL_H_
41 
42 /* Standard libraries */
43 #include <stdbool.h>
44 #include <stdint.h>
45 
46 /* Custom Includes */
47 #include "ads1282.h"
48 
49 //****************************************************************************
50 //
51 // Insert processor specific header file(s) here
52 //
53 //****************************************************************************
54 
55 /* --- INSERT YOUR CODE HERE --- */
56 #include "ti/drivers/GPIO.h"
57 #include "ti/drivers/SPI.h"
58 #include "ti_drivers_config.h" // SysConfig auto-generated file
59 #include "ti/devices/msp432e4/driverlib/driverlib.h"
60 
61 
62 //*****************************************************************************
63 //
64 // Constants
65 //
66 //*****************************************************************************
67 
69 #define HIGH ((bool) true)
70 
72 #define LOW ((bool) false)
73 
75 #define SCLK_FREQ_HZ ((uint32_t) 1000000)
76 
79 #define FCLK_FREQ_HZ ((uint32_t) 4096000)
80 
81 
82 //****************************************************************************
83 //
84 // Pin definitions (MSP-EXP432E401Y BoosterPack #2)
85 //
86 //****************************************************************************
87 //
88 // LEFT RIGHT
89 // /--------\ /--------\
90 // +3.3V -|3V3 +5V|- +5V -|PG1 GND|- GND
91 // -|PD2 GND|- GND -|PK4 PM7|- SYNC
92 // -|PP0 PB4|- -|PK5 PP5|-
93 // -|PP1 PB5|- -|PM0 PA7|-
94 // -|PD4* PK0|- nDRDY -|PM1 RST|-
95 // -|PD5* PK1|- -|PM2 PQ2|- DIN
96 // SCLK -|PQ0 PK2|- -|PH0 PQ3|- DOUT
97 // -|PP4 PK3|- nPWDN -|PH1 PP3|-
98 // -|PN5 PA4|- -|PK6 PQ1|-
99 // -|PN4 PA5|- -|PK7 PM6|- nRESET
100 // \--------/ \--------/
101 //
102 // * Pin connection depends on jumper setting
103 //
104 //****************************************************************************
105 
106 
107 //*****************************************************************************
108 //
109 // Function Prototypes
110 //
111 //*****************************************************************************
112 
113 void initADCperhiperhals(void);
114 void delay_us(const uint32_t delay_time_us);
115 void delay_ms(const uint32_t delay_time_ms);
116 void setPWDN(const bool state);
117 void setRESET(const bool state);
118 void toggleRESET(void);
119 bool spiSendReceive(const uint8_t transmitBuffer[], uint8_t receiveBuffer[], const uint8_t byteLength);
120 bool waitForDRDYinterrupt(uint32_t timeout_ms);
121 
122 
123 #endif /* HAL_H_ */
void setRESET(const bool state)
Definition: hal.c:159
ADS1282 Descriptor.
void initADCperhiperhals(void)
Definition: hal.c:79
void delay_ms(const uint32_t delay_time_ms)
Definition: hal.c:364
bool waitForDRDYinterrupt(uint32_t timeout_ms)
Definition: hal.c:224
void setPWDN(const bool state)
Definition: hal.c:134
void toggleRESET(void)
Definition: hal.c:181
void delay_us(const uint32_t delay_time_us)
Definition: hal.c:345
bool spiSendReceive(const uint8_t transmitBuffer[], uint8_t receiveBuffer[], const uint8_t byteLength)
Definition: hal.c:313