BLDC control on ATAVRMC303 with ATxMega128A1
awex_driver.c
Go to the documentation of this file.
1 /* This file has been prepared for Doxygen automatic documentation generation.*/
59 #include "awex_driver.h"
60 
73 void AWEX_EnableDeadTimeInsertion( AWEX_t * awex, uint8_t enableMask )
74 {
75  /* Make sure only the DTI enable bits are affected. */
76  enableMask &= ( AWEX_DTICCAEN_bm |
77  AWEX_DTICCBEN_bm |
78  AWEX_DTICCCEN_bm |
79  AWEX_DTICCDEN_bm );
80 
81  /* Enable DTI for the selected channels. */
82  awex->CTRL |= enableMask;
83 }
84 
85 
98 void AWEX_DisableDeadTimeInsertion(AWEX_t * awex, uint8_t disableMask)
99 {
100  /* Make sure only the DTI enable bits are affected. */
101  disableMask &= ( AWEX_DTICCAEN_bm |
102  AWEX_DTICCBEN_bm |
103  AWEX_DTICCCEN_bm |
104  AWEX_DTICCDEN_bm );
105 
106  /* Disable DTI for the selected channels. */
107  awex->CTRL &= ~disableMask;
108 }
109 
110 
117 void AWEX_ConfigureFaultDetection( AWEX_t * awex,
118  AWEX_FDACT_t faultAction,
119  uint8_t eventMask)
120 {
121  awex->FDCTRL = ( awex->FDCTRL & ~AWEX_FDACT_gm ) | faultAction;
122  awex->FDEMASK = eventMask;
123 }
void AWEX_EnableDeadTimeInsertion(AWEX_t *awex, uint8_t enableMask)
Enable Dead Time Insertion.
Definition: awex_driver.c:73
void AWEX_ConfigureFaultDetection(AWEX_t *awex, AWEX_FDACT_t faultAction, uint8_t eventMask)
This function configures the Fault Detection function for this AWEX.
Definition: awex_driver.c:117
void AWEX_DisableDeadTimeInsertion(AWEX_t *awex, uint8_t disableMask)
Disable Dead Time Insertion.
Definition: awex_driver.c:98
XMEGA AWeX driver header file.