Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add supporto for ATmega64 and ATmega128 #32

Open
TheFidax opened this issue Mar 23, 2022 · 0 comments
Open

Add supporto for ATmega64 and ATmega128 #32

TheFidax opened this issue Mar 23, 2022 · 0 comments

Comments

@TheFidax
Copy link

TheFidax commented Mar 23, 2022

I've add support for ATmega64 and 128 in ln_config.h

#ifdef PINL // For the Mega 2560 (should work with 1280, etc)
#define _LNET_USE_MEGA
#elif defined (AVR_ATmega64) || defined (AVR_ATmega128)
#define _LNET_USE_ATMEGA64_128
#else // For the UNO:
#define _LNET_USE_UNO
#endif

........

#if defined( _LNET_USE_MEGA ) // twk
.....

#elif defined( _LNET_USE_ATMEGA64_128 )
#define LN_RX_PORT PIND //ICP1
#define LN_RX_DDR DDRD
#define LN_RX_BIT PD4

// From sysdef.h:
#define LN_SB_SIGNAL TIMER1_CAPT_vect
#define LN_SB_INT_ENABLE_REG TIMSK
#define LN_SB_INT_ENABLE_BIT TICIE1
#define LN_SB_INT_STATUS_REG TIFR
#define LN_SB_INT_STATUS_BIT ICF1
#define LN_TMR_SIGNAL TIMER1_COMPA_vect
#define LN_TMR_INT_ENABLE_REG TIMSK
#define LN_TMR_INT_STATUS_REG TIFR
#define LN_TMR_INT_ENABLE_BIT OCIE1A
#define LN_TMR_INT_STATUS_BIT OCF1A
#define LN_TMR_INP_CAPT_REG ICR1 // [BA040319] added defines for:
#define LN_TMR_OUTP_CAPT_REG OCR1A // ICR1, OCR1A, TCNT1, TCCR1B
#define LN_TMR_COUNT_REG TCNT1 // and replaced their occurence in
#define LN_TMR_CONTROL_REG TCCR1B // the code.
#define LN_INIT_COMPARATOR() { TCCR1A = 0; TCCR1B = 0x01; } // no prescaler, normal mode

#elif defined( _LNET_USE_UNO )
......

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant