27 lines
1.2 KiB
Plaintext
27 lines
1.2 KiB
Plaintext
% var moduleName = "spi"
|
|
% var module = system.modules['/driverlib/' + moduleName + '.js'];
|
|
%if (module != null)
|
|
%{
|
|
//*****************************************************************************
|
|
//
|
|
// SPI Configurations
|
|
//
|
|
//*****************************************************************************
|
|
% for(var i = 0; i < module.$instances.length; i++) {
|
|
% var instance = module.$instances[i];
|
|
% let modInst = instance[moduleName];
|
|
% let solution = modInst.$solution;
|
|
%let peripheral = system.deviceData.peripherals[solution.peripheralName];
|
|
#define `instance.$name`_BASE `peripheral.name`_BASE
|
|
#define `instance.$name`_BITRATE `parseInt(instance.bitRate)`
|
|
% if (instance.useDMARX) {
|
|
#define `instance.spiRXDMA.$name`_TRIGGER DMA_TRIGGER_`peripheral.name`RX
|
|
#define `instance.spiRXDMA.$name`_ADDRESS ((uint16_t *)(`peripheral.name`_BASE + SPI_O_RXBUF))
|
|
% }
|
|
% if (instance.useDMATX) {
|
|
#define `instance.spiTXDMA.$name`_TRIGGER DMA_TRIGGER_`peripheral.name`TX
|
|
#define `instance.spiTXDMA.$name`_ADDRESS ((uint16_t *)(`peripheral.name`_BASE + SPI_O_TXBUF))
|
|
% }
|
|
void `instance.$name`_init();
|
|
% }
|
|
%} |