mirror of
https://github.com/SemvdH/OBD2-car-display.git
synced 2025-12-14 19:51:04 +00:00
Add TC start
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#include "sam3xa/include/component/component_tc.h"
|
||||||
#include "obd2_timer.h"
|
#include "obd2_timer.h"
|
||||||
|
|
||||||
void obd2_RTT_init(void)
|
void obd2_RTT_init(void)
|
||||||
@@ -45,6 +46,14 @@ void obd2_RTT_set_period(__UINT32_TYPE__ period)
|
|||||||
|
|
||||||
void obd2_TC_init()
|
void obd2_TC_init()
|
||||||
{
|
{
|
||||||
/* enable the timer/counter 0*/
|
/* enable the timer/counter 0 */
|
||||||
TC0->TC_CHANNEL[0].TC_CCR |= TC_CCR_CLKEN;
|
TC0->TC_CHANNEL[0].TC_CCR |= TC_CCR_CLKEN;
|
||||||
|
/* disable the quadrature decoder, to route the IO pins of TIOA and TIOB directly to the timer counter function (36.6.14.1) */
|
||||||
|
TC0->TC_BMR &= ~(TC_BMR_QDEN);
|
||||||
|
}
|
||||||
|
|
||||||
|
void obd2_TC_start()
|
||||||
|
{
|
||||||
|
/* software trigger the timer reset it and start the clock */
|
||||||
|
TC0->TC_CHANNEL[0].TC_CCR |= TC_CCR_SWTRG;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ void obd2_RTT_enable();
|
|||||||
void obd2_RTT_set_period(__UINT32_TYPE__ period);
|
void obd2_RTT_set_period(__UINT32_TYPE__ period);
|
||||||
|
|
||||||
void obd2_TC_init();
|
void obd2_TC_init();
|
||||||
|
void obd2_TC_start();
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user