ADS131A04 Example C Code  1.0.0
hal.h
Go to the documentation of this file.
1 
34 #ifndef INTERFACE_H_
35 #define INTERFACE_H_
36 
37 #include "ads131a04.h"
38 
39 
40 //****************************************************************************
41 //
42 // Standard libraries
43 //
44 //****************************************************************************
45 
46 #include <assert.h>
47 #include <stdbool.h>
48 #include <stdint.h>
49 
50 
51 
52 //****************************************************************************
53 //
54 // Insert processor specific header file(s) here
55 //
56 //****************************************************************************
57 
58 /* --- INSERT YOUR CODE HERE --- */
59 #include "ti/devices/msp432e4/driverlib/driverlib.h"
60 
61 
62 
63 //****************************************************************************
64 //
65 // LaunchPad pinout...
66 //
67 //****************************************************************************
68 //
69 // LEFT RIGHT
70 // /--------\ /--------\
71 // +3.3V -|3V3 +5V|- +5V CLK -|PG1 GND|- GND
72 // -|PD2 GND|- GND nRESET -|PK4 PM7|-
73 // -|PP0 PB4|- nCS -|PK5 PP5|-
74 // -|PP1 PB5|- nDRDY -|PM0 PA7|-
75 // -|PD4 PK0|- -|PM1 RST|-
76 // -|PD5 PK1|- -|PM2 PQ2|- DIN
77 // SCLK -|PQ0 PK2|- -|PH0 PQ3|- DOUT
78 // -|PP4 PK3|- -|PH1 PP3|-
79 // -|PN5 PA4|- -|PK6 PQ1|-
80 // -|PN4 PA5|- -|PK7 PM6|-
81 // \--------/ \--------/
82 //
83 
84 
85 
86 //*****************************************************************************
87 //
88 // Pin definitions (MSP432E401Y)
89 //
90 //*****************************************************************************
91 
92 #define nDRDY_PORT (GPIO_PORTM_BASE)
93 #define nDRDY_PIN (GPIO_PIN_0)
94 #define nDRDY_INT (INT_GPIOM)
95 
96 #define nCS_PORT (GPIO_PORTK_BASE)
97 #define nCS_PIN (GPIO_PIN_5)
98 
99 #define nRESET_PORT (GPIO_PORTK_BASE)
100 #define nRESET_PIN (GPIO_PIN_4)
101 
102 // (OPTIONAL) External clock source
103 //#define CLKIN_PORT (GPIO_PORTG_BASE)
104 //#define CLKIN_PIN (GPIO_PIN_1)
105 
106 
107 
108 //*****************************************************************************
109 //
110 // Function Prototypes
111 //
112 //*****************************************************************************
113 
114 void InitADC(void);
115 void delay_ms(const uint32_t delay_time_ms);
116 void delay_us(const uint32_t delay_time_us);
117 void setCS(const bool state);
118 void setRESET(const bool state);
119 void toggleRESET(void);
120 void spiSendReceiveArrays(const uint8_t DataTx[], uint8_t DataRx[], const uint8_t byteLength);
121 uint8_t spiSendReceiveByte(const uint8_t dataTx);
122 bool waitForDRDYinterrupt(const uint32_t timeout_ms);
123 
124 
125 
126 //*****************************************************************************
127 //
128 // Macros
129 //
130 //*****************************************************************************
132 #define HIGH ((bool) true)
133 
135 #define LOW ((bool) false)
136 
137 
138 
139 #endif /* INTERFACE_H_ */
static uint8_t dataTx[6 *(((uint8_t) 24) >> 3)]
Definition: ads131a04.c:73
void setCS(const bool state)
Definition: hal.c:261
bool waitForDRDYinterrupt(const uint32_t timeout_ms)
Definition: hal.c:341
void setRESET(const bool state)
Definition: hal.c:291
void InitADC(void)
Definition: hal.c:76
void delay_ms(const uint32_t delay_time_ms)
Definition: hal.c:110
void toggleRESET(void)
Definition: hal.c:311
void delay_us(const uint32_t delay_time_us)
Definition: hal.c:131
void spiSendReceiveArrays(const uint8_t DataTx[], uint8_t DataRx[], const uint8_t byteLength)
Definition: hal.c:463
uint8_t spiSendReceiveByte(const uint8_t dataTx)
Definition: hal.c:511