Timer module config for PWM fucntion
This commit is contained in:
6
inc/timer_module.h
Normal file
6
inc/timer_module.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef _TIMER_MODULE_
|
||||
#define _TIMER_MODULE_
|
||||
|
||||
void buzz_init();
|
||||
|
||||
#endif
|
||||
16
src/timer_module.c
Normal file
16
src/timer_module.c
Normal file
@@ -0,0 +1,16 @@
|
||||
#include "BA45F5250.h"
|
||||
#include "stdint.h"
|
||||
#include "build-in.h"
|
||||
#include "timer_module.h"
|
||||
|
||||
void buzz_init()
|
||||
{
|
||||
_pas15 = 0;
|
||||
_pas14 = 1;
|
||||
_ptmc0 = 0b00100000;
|
||||
_ptmc1 = 0b10101000;
|
||||
_ptmrpl = 0b11110100;
|
||||
_ptmrph = 0b00000001;
|
||||
_ptmal = 0b11111010;
|
||||
_ptmah = 0b00000000;
|
||||
}
|
||||
Reference in New Issue
Block a user