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

Madison McCarthy m.madison.mccarthy at gmail.com
Tue Dec 12 16:18:19 CET 2017


Hi Hauke and Arndt,

*Hauke:* your answer is sufficient for me to progress forward, thanks a
bunch! My main concern has about adding additional functionality such as
interrupts, slave mode, etc. into already defined RIOT peripheral headers.
I'll locate the new features that are not encapsulated within the RIOT-core
or RIOT-drivers as device-specific functionality for now.

*Arndt:* I'll message you directly about collaborating on an Atxmega port
that can be pushed to the RIOT repository. I'll finish my port first (1-2
days hopefully) before I examine your port so we can blend the two products
together into something worth sharing :)

Thanks again!

Madison McCarthy



On Tue, Dec 12, 2017 at 6:35 AM, Hauke Petersen <hauke.petersen at fu-berlin.de
> wrote:

> 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!
>
> Cheers,
> Hauke
>
>
>>
>> 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
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/devel/attachments/20171212/166de3a5/attachment.html>


More information about the devel mailing list