Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ARM_MATH_CM7
- #include <stdint.h>
- #include "main.h"
- #include "stm32h753xx.h"
- #include "arm_math.h"
- #include "DSP_FACTORY.h"
- #include "EXIT_FACTORY.h"
- #include "CLOCK_FACTORY.h"
- #include "I2S_FACTORY.h"
- #include "UART_FACTORY.h"
- #include "WS2812B_FACTORY.h"
- #include "OPCODE.h"
- #include "AUDIO_SELECTOR_FACTORY.h"
- #include "CONSTANTS.h"
- #include "UART_PACKET_PROCESSOR.h"
- uint8_t I2S1_TC = 0;
- uint8_t I2S1_HC = 0;
- uint8_t UART4_TC = 0;
- int main (void) {
- //Gotta test I2S bus
- INIT_CLOCK(); // GOOD
- INIT_I2S(); // So much noise now?
- INIT_UART(); //GOOD
- INIT_EXIT(); // GOOD
- INIT_WS2812B(); // GOOD
- while(1) {
- if (I2S1_HC == OK) {
- I2S_HALFCOMPLETE_CALLBACK();
- I2S1_HC = RESET;
- }
- if (I2S1_TC == OK) {
- I2S_TRANSFERCOMPLETE_CALLBACK();
- I2S1_TC = RESET;
- }
- if (UART4_TC == OK) {
- UART4_TRANSFERCOMPELTE_CALLBACK();
- UART4_TC = RESET;
- }
- }
- }
- void DMA1_Stream2_IRQHandler() {
- if (((DMA1->LISR) & (DMA_LISR_TCIF2)) != 0) {
- DMA1->LIFCR |= DMA_LIFCR_CTCIF2;
- UART4_TC = OK;
- }
- }
- void DMA1_Stream0_IRQHandler() {
- if (((DMA1->LISR) & (DMA_LISR_HTIF0)) != 0) {
- DMA1->LIFCR |= DMA_LIFCR_CHTIF0;
- I2S1_HC = OK;
- }
- if (((DMA1->LISR) & (DMA_LISR_TCIF0)) != 0) {
- DMA1->LIFCR |= DMA_LIFCR_CTCIF0;
- I2S1_TC = OK;
- }
- }
- void EXTI0_IRQHandler(void){
- if (((EXTI->PR1) & (EXTI_PR1_PR0)) != 0) {
- EXTI->PR1 |= EXTI_PR1_PR0;
- }
- }
- void EXTI4_IRQHandler(void){
- if (((EXTI->PR1) & (EXTI_PR1_PR4)) != 0) {
- EXTI->PR1 |= EXTI_PR1_PR4;
- }
- }
- void EXTI9_5_IRQHandler(void){
- if (((EXTI->PR1) & (EXTI_PR1_PR6)) != 0) {
- EXTI->PR1 |= EXTI_PR1_PR6;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement