#include "config.h"


Go to the source code of this file.
Defines | |
| #define | DISABLE_INTERRUPT() (SREG &= (~GLOBAL_INTERRUPT_BIT_MASK)) |
| Disable global interrupt flag. | |
| #define | GLOBAL_INTERRUPT_BIT_MASK 0x80 |
| Bit mask for the global interrupt flag in SREG. | |
| #define | RESTORE_INTERRUPT(state) (SREG = (state)) |
| Restore the interrupt state. | |
| #define | SAVE_INTERRUPT() SREG |
| Save the current interrupt state. | |
| #define | TC0_READ_16_BIT_OCR0AB(destinationVariable) |
| Read 16 bit value from OCR0A/B. | |
| #define | TC0_READ_16_BIT_OCR0AB_INT_SAFE(destinationVariable) |
| Atomic 16 bit read from OCRA/B. | |
| #define | TC0_READ_TCNT0(destinationVariable) |
| Read 16 bit value from TCNT0. | |
| #define | TC0_READ_TCNT0_INT_SAFE(destinationVariable) |
| Atomic 16 bit read from TCNT0. | |
| #define | TC0_WRITE_16_BIT_OCR0AB(value) |
| Write 16 bit value to OCR0A/B. | |
| #define | TC0_WRITE_16_BIT_OCR0AB_INT_SAFE(value) |
| Write 16 bit value to OCR0A/B. | |
| #define | TC0_WRITE_TCNT0(value) |
| Write 16 bit value to TCNT0. | |
| #define | TC0_WRITE_TCNT0_INT_SAFE(value) |
| Atomic 16 bit write to TCNT0. | |
| #define | TC1_READ_10_BIT_REGISTER(sourceRegister, destinationVariable) |
| Read 10 bit value from a Timer/Counter1 register. | |
| #define | TC1_READ_10_BIT_REGISTER_INT_SAFE(sourceRegister, destinationVariable) |
| Atomic 10 bit read from a Timer/Counter1 register. | |
| #define | TC1_SET_ALL_COMPARE_VALUES(compareValue) |
| Set same output compare value for all output channels of Timer/counter1. | |
| #define | TC1_WRITE_10_BIT_REGISTER(destinationRegister, value) |
| Write 10 bit value to a Timer/Counter1 register. | |
| #define | TC1_WRITE_10_BIT_REGISTER_INT_SAFE(destinationRegister, value) |
| Atomic 10 bit write to a Timer/Counter1 register. | |
Definition in file TinyX61_macros.h.
| #define DISABLE_INTERRUPT | ( | ) | (SREG &= (~GLOBAL_INTERRUPT_BIT_MASK)) |
| #define GLOBAL_INTERRUPT_BIT_MASK 0x80 |
| #define RESTORE_INTERRUPT | ( | state | ) | (SREG = (state)) |
| #define SAVE_INTERRUPT | ( | ) | SREG |
| #define TC0_READ_16_BIT_OCR0AB | ( | destinationVariable | ) |
Value:
Read 16 bit value from OCR0A/B.Reads the 16 bit OCR0A/B value.
| destinationVariable | Destination variable. |
Definition at line 158 of file TinyX61_macros.h.
| #define TC0_READ_16_BIT_OCR0AB_INT_SAFE | ( | destinationVariable | ) |
Value:
{ \
uint8_t iFlagTemp; \
iFlagTemp = SAVE_INTERRUPT(); \
DISABLE_INTERRUPT(); \
uint8_t tempL = OCR0A; \
(destinationVariable) = ((uint16_t)OCR0B << 8) | tempL; \
RESTORE_INTERRUPT(iFlagTemp); \
}
Reads the 16 bit OCR0A/B value in one atomic operation.
| destinationVariable | Destination variable. |
Definition at line 171 of file TinyX61_macros.h.
| #define TC0_READ_TCNT0 | ( | destinationVariable | ) |
Value:
{ \
uint8_t tempL; \
tempL = TCNT0L; \
(destinationVariable) = ((TCNT0H << 8) | tempL); \
}
Reads the 16 bit value of TCNT0 (TCNT0L/H).
| destinationVariable | Destination variable. |
Definition at line 96 of file TinyX61_macros.h.
Referenced by HallChangeISR().
| #define TC0_READ_TCNT0_INT_SAFE | ( | destinationVariable | ) |
Value:
{ \
uint8_t iFlagTemp; \
uint8_t tempL; \
iFlagTemp = SAVE_INTERRUPT(); \
DISABLE_INTERRUPT(); \
tempL = TCNT0L; \
(destinationVariable) = ((TCNT0H << 8) | tempL); \
RESTORE_INTERRUPT(iFlagTemp); \
}
Reads the 16 bit value of TCNT0 (TCNT0L/H) in one atomic operation.
| destinationVariable | Destination variable. |
Definition at line 127 of file TinyX61_macros.h.
| #define TC0_WRITE_16_BIT_OCR0AB | ( | value | ) |
Value:
Write 16 bit value to OCR0A/B.Writes a 16 bit value to OCR0A/B.
| value | New 16 bit OCR0A/B value. |
Definition at line 145 of file TinyX61_macros.h.
| #define TC0_WRITE_16_BIT_OCR0AB_INT_SAFE | ( | value | ) |
Value:
{ \
uint8_t iFlagTemp; \
iFlagTemp = SAVE_INTERRUPT(); \
DISABLE_INTERRUPT(); \
OCR0B = (uint8_t)((value) >> 8); \
OCR0A = (uint8_t)(value);\
RESTORE_INTERRUPT(iFlagTemp); \
}
Writes a 16 bit value to OCR0A/B.
| value | New 16 bit OCR0A/B value. |
Definition at line 188 of file TinyX61_macros.h.
| #define TC0_WRITE_TCNT0 | ( | value | ) |
Value:
Write 16 bit value to TCNT0.Writes a 16 bit value to TCNT0 (TCNT0L/H).
| value | New 16 bit TCNT0 value. |
Definition at line 83 of file TinyX61_macros.h.
Referenced by HallChangeISR(), ovfl_timer0(), and Timer0Init().
| #define TC0_WRITE_TCNT0_INT_SAFE | ( | value | ) |
Value:
{ \
uint8_t iFlagTemp; \
iFlagTemp = SAVE_INTERRUPT(); \
DISABLE_INTERRUPT(); \
TCNT0H = (uint8_t)((value) >> 8); \
TCNT0L = (uint8_t)(value); \
RESTORE_INTERRUPT(iFlagTemp); \
}
Writes a 16 bit value to TCNT0 (TCNT0L/H) in one atomic operation.
| value | New 16 bit TCNT0 value. |
Definition at line 110 of file TinyX61_macros.h.
| #define TC1_READ_10_BIT_REGISTER | ( | sourceRegister, | |||
| destinationVariable | ) |
Value:
{ \
uint8_t tempL; \
tempL = (sourceRegister); \
(destinationVariable) = ( ((uint16_t)TC1H << 8) | tempL); \
}
Reads a 10 bit value from any 10 bit Timer/counter1 register.
| sourceRegister | Source register | |
| destinationVariable | Destination variable. |
Definition at line 220 of file TinyX61_macros.h.
| #define TC1_READ_10_BIT_REGISTER_INT_SAFE | ( | sourceRegister, | |||
| destinationVariable | ) |
Value:
{ \
uint8_t iFlagTemp; \
uint8_t tempL; \
iFlagTemp = SAVE_INTERRUPT(); \
tempL = (sourceRegister); \
(destinationVariable) = ( ((uint16_t)TC1H << 8) | tempL); \
RESTORE_INTERRUPT(iFlagTemp); \
}
Reads a 10 bit value from any 10 bit Timer/counter1 register in one atomic operation.
| sourceRegister | Source register | |
| destinationVariable | Destination variable |
Definition at line 255 of file TinyX61_macros.h.
| #define TC1_SET_ALL_COMPARE_VALUES | ( | compareValue | ) |
Value:
{ \
uint16_t tempValue = compareValue; \
TC1H = ((uint8_t)((tempValue) >> 8)); \
OCR1A = ((uint8_t)tempValue); \
OCR1B = ((uint8_t)tempValue); \
OCR1D = ((uint8_t)tempValue); \
}
This macro sets the same output compare value to all three output channels of Timer/counter1. This does not apply to PWM6 mode, where all channels controlled by a single compare register.
| compareValue | New output compare value. |
Definition at line 274 of file TinyX61_macros.h.
| #define TC1_WRITE_10_BIT_REGISTER | ( | destinationRegister, | |||
| value | ) |
Value:
{ \
TC1H = ((value) >> 8); \
(destinationRegister) = (uint8_t)(value); \
}
Writes a 10 bit value to any 10 bit Timer/Counter1 register.
| destinationRegister | Destination register. | |
| value | Register value. |
Definition at line 206 of file TinyX61_macros.h.
Referenced by MotorSetDutyCycle(), and PWMInit().
| #define TC1_WRITE_10_BIT_REGISTER_INT_SAFE | ( | destinationRegister, | |||
| value | ) |
Value:
{ \
uint8_t iFlagTemp; \
iFlagTemp = SAVE_INTERRUPT(); \
DISABLE_INTERRUPT(); \
TC1H = ((value) >> 8); \
(destinationRegister) = (uint8_t)(value); \
RESTORE_INTERRUPT(iFlagTemp); \
}
Writes a 10 bit value to any 10 bit Timer/Counter1 register in one atomic. operation.
| destinationRegister | Destination register. | |
| value | Register value. |
Definition at line 236 of file TinyX61_macros.h.
1.5.7.1