Finished three more functions

This commit is contained in:
William Miceli
2021-06-07 18:36:29 -04:00
parent 8d30742bb8
commit 9a150dbd90
2 changed files with 21 additions and 0 deletions

View File

@@ -61,6 +61,21 @@ void usci_A2_disable(void){
UCA2CTL1 |= UCSWRST; // Software Reset Enable - Set high, disabling the USCI module UCA2CTL1 |= UCSWRST; // Software Reset Enable - Set high, disabling the USCI module
} }
void usci_A2_enableInterrupt(void){
UCA2IE |= (UCTXIE | UCRXIE); // Enable transmit and receive interrupts
}
void usci_A2_disableInterrupt(void){
UCA2IE &= ~(UCTXIE | UCRXIE); // Disable transmit and receive interrupts
}
void usci_A2_transmitChar(char charToTransmit){
while((UCA2IFG & UCTXIFG) == 0){ // If the USCI module is not yet ready for the next value to transmit, wait indefinitely
_NOP(); // Processor will do nothing until loop exits; should be converted to interrupt in the future
}
UCA2TXBUF = charToTransmit; // When USCI module signals that it is ready, the next character value is moved into the transmit buffer
}
/*************************************************************************/ /*************************************************************************/

View File

@@ -36,6 +36,12 @@ void usci_A2_enable(void);
void usci_A2_disable(void); void usci_A2_disable(void);
void usci_A2_enableInterrupt(void);
void usci_A2_disableInterrupt(void);
void usci_A2_transmitChar(char charToTransmit);
void usci_A3_init(void); void usci_A3_init(void);
void usci_B0_init(void); void usci_B0_init(void);