-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDAC5.cpp
More file actions
30 lines (28 loc) · 1.02 KB
/
DAC5.cpp
File metadata and controls
30 lines (28 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* DAC5.cpp
* Students put your names here
* Modified: January 1, 2024
* 5-bit binary-weighted DAC connected to PB4-PB0
*/
#include <ti/devices/msp/msp.h>
#define PB0INDEX 11 // UART0_TX SPI1_CS2 TIMA1_C0 TIMA0_C2
#define PB1INDEX 12 // UART0_RX SPI1_CS3 TIMA1_C1 TIMA0_C2N
#define PB2INDEX 14 // UART3_TX UART2_CTS I2C1_SCL TIMA0_C3 UART1_CTS TIMG6_C0 TIMA1_C0
#define PB3INDEX 15 // UART3_RX UART2_RTS I2C1_SDA TIMA0_C3N UART1_RTS TIMG6_C1 TIMA1_C1
#define PB4INDEX 16 // UART1_TX UART3_CTS TIMA1_C0 TIMA0_C2 TIMA1_C0N
// **************DAC5_Init*********************
// Initialize 5-bit DAC, called once
// Input: none
// Output: none
void DAC5_Init(void){
// Assumes LaunchPad_Init has been called
// I.e., PortB has already been reset and activated (do not reset PortB here again)
// write this
}
// **************DAC5_Out*********************
// output to DAC5
// Input: data is 5-bit integer, 0 to 31
// Output: none
// Note: this solution must be friendly
void DAC5_Out(uint32_t data){
// write this
}