[riot-devel] Atxmega Port with RIOT OS - Where to put abundance of new driver features?

Hauke Petersen hauke.petersen at fu-berlin.de
Tue Dec 12 12:35:35 CET 2017

Hi Madison,

awesome to hear about your port, it will be very nice to have ATxmega 
support in RIOT. I will try to answer your questions inline below.

On 11.12.2017 22:04, Madison McCarthy wrote:
> Hi Everyone,
> I'm nearing completion of a port for RIOT OS to the ATxmega family of 
> devices (targeting the atxmega128). The Atxmega is feature rich when 
> contrasted against the Atmega counterpart which I am using as a 
> porting guideline.
> 1) Since I would like to contribute my port to the git repository, how 
> should I go about implementing new CPU features not found in the core 
> RIOT OS functionality (enhanced TWI, USART, etc.)?
I don't quite get the question. TWI (i2c) and UART are interfaces 
provided by RIOT, which are simply implemented by the specific CPU 
implementations, hence their implementation code should reside in the 
corresponding cpu folder (as in /cpu/atxmega_common/periph/uart.c, etc.).
> 2) How should I implement the addition of both Master and Slave 
> functionality to my peripheral interfaces?
For the master mode of SPI and I2C (TWI) there are interfaces designed 
by RIOT (-> drivers/include/periph/[spi|i2c].h). So simply implement 
them for the ATxmega and you should be good to go.

Currently there are no interfaces for the slave mode of these buses, so 
my proposal would be that you include slave interfaces together with the 
CPU code (so to make the slave implementations CPU specific for now), 
and adapt the code at a later point in time once we introduce slave 
interfaces to RIOT.
> 3) How should I go about adding interrupt functionality for these 
> peripherals?
Not sure what you mean: peripheral specific interrupts should be handled 
inside the corresponding periph drivers. The global interrupt handling 
is abstracted by the core/include/irq.h interface, which needs to be 
implemented for the CPU family.

Hope this information helps, let me know where clarification is needed!


> Currently I am just smashing these extra features right into the 
> driver's .C files as I am trying to preserve the OS-Core files.
> Any suggestions would be appreciated!
> Madison McCarthy
> _______________________________________________
> devel mailing list
> devel at riot-os.org
> https://lists.riot-os.org/mailman/listinfo/devel

More information about the devel mailing list