bug fixes
This commit is contained in:
parent
dca0fe9bcb
commit
153f4ac508
@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
|
* These arguments were used when this file was generated. They will be automatically applied on subsequent loads
|
||||||
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
|
* via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
|
||||||
* @cliArgs --board "/ti/boards/CC3220S_LAUNCHXL" --product "simplelink_cc32xx_sdk@4_20_00_07"
|
* @cliArgs --board "/ti/boards/CC3220S_LAUNCHXL" --product "simplelink_cc32xx_sdk@4.30.00.06"
|
||||||
* @versions {"data":"2020052512","timestamp":"2020052512","tool":"1.5.0+1397","templates":"2020052512"}
|
* @versions {"data":"2020090214","timestamp":"2020090214","tool":"1.6.0+1543","templates":"2020090214"}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -11,23 +11,40 @@
|
|||||||
const DriverLib = scripting.addModule("/ti/devices/DriverLib");
|
const DriverLib = scripting.addModule("/ti/devices/DriverLib");
|
||||||
const Board = scripting.addModule("/ti/drivers/Board");
|
const Board = scripting.addModule("/ti/drivers/Board");
|
||||||
const DMA = scripting.addModule("/ti/drivers/DMA");
|
const DMA = scripting.addModule("/ti/drivers/DMA");
|
||||||
|
const GPIO = scripting.addModule("/ti/drivers/GPIO", {}, false);
|
||||||
|
const GPIO1 = GPIO.addInstance();
|
||||||
const I2C = scripting.addModule("/ti/drivers/I2C", {}, false);
|
const I2C = scripting.addModule("/ti/drivers/I2C", {}, false);
|
||||||
const I2C1 = I2C.addInstance();
|
const I2C1 = I2C.addInstance();
|
||||||
|
const PWM = scripting.addModule("/ti/drivers/PWM", {}, false);
|
||||||
|
const PWM1 = PWM.addInstance();
|
||||||
const Power = scripting.addModule("/ti/drivers/Power");
|
const Power = scripting.addModule("/ti/drivers/Power");
|
||||||
|
const SPI = scripting.addModule("/ti/drivers/SPI");
|
||||||
|
const SPI1 = SPI.addInstance();
|
||||||
const Watchdog = scripting.addModule("/ti/drivers/Watchdog");
|
const Watchdog = scripting.addModule("/ti/drivers/Watchdog");
|
||||||
const Watchdog1 = Watchdog.addInstance();
|
const Watchdog1 = Watchdog.addInstance();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write custom configuration values to the imported modules.
|
* Write custom configuration values to the imported modules.
|
||||||
*/
|
*/
|
||||||
|
GPIO1.$name = "CONF_GPIO_NOODSTOP";
|
||||||
|
GPIO1.interruptTrigger = "Falling Edge";
|
||||||
|
GPIO1.pull = "Pull Up";
|
||||||
|
GPIO1.mode = "Dynamic";
|
||||||
|
GPIO1.callbackFunction = "noodstop_noodstopISR";
|
||||||
|
|
||||||
I2C1.$name = "CONFIG_I2C_0";
|
I2C1.$name = "CONFIG_I2C_0";
|
||||||
I2C1.$hardware = system.deviceData.board.components.LP_I2C;
|
I2C1.$hardware = system.deviceData.board.components.LP_I2C;
|
||||||
I2C1.i2c.sdaPin.$assign = "boosterpack.10";
|
I2C1.i2c.sdaPin.$assign = "boosterpack.10";
|
||||||
I2C1.i2c.sclPin.$assign = "boosterpack.9";
|
I2C1.i2c.sclPin.$assign = "boosterpack.9";
|
||||||
|
|
||||||
|
PWM1.$name = "CONFIG_PWM_0";
|
||||||
|
PWM1.$hardware = system.deviceData.board.components.LED_RED;
|
||||||
|
|
||||||
Power.ioRetentionShutdown = ["GRP_1"];
|
Power.ioRetentionShutdown = ["GRP_1"];
|
||||||
Power.parkPins.$name = "ti_drivers_power_PowerCC32XXPins0";
|
Power.parkPins.$name = "ti_drivers_power_PowerCC32XXPins0";
|
||||||
|
|
||||||
|
SPI1.$name = "CONFIG_SPI_MASTER";
|
||||||
|
|
||||||
Watchdog1.$name = "CONFIG_WATCHDOG_0";
|
Watchdog1.$name = "CONFIG_WATCHDOG_0";
|
||||||
Watchdog1.watchdog.$assign = "WATCHDOG0";
|
Watchdog1.watchdog.$assign = "WATCHDOG0";
|
||||||
|
|
||||||
@ -36,4 +53,13 @@ Watchdog1.watchdog.$assign = "WATCHDOG0";
|
|||||||
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
|
* version of the tool will not impact the pinmux you originally saw. These lines can be completely deleted in order to
|
||||||
* re-solve from scratch.
|
* re-solve from scratch.
|
||||||
*/
|
*/
|
||||||
I2C1.i2c.$suggestSolution = "I2C0";
|
GPIO1.gpioPin.$suggestSolution = "boosterpack.4";
|
||||||
|
I2C1.i2c.$suggestSolution = "I2C0";
|
||||||
|
PWM1.timer.$suggestSolution = "Timer2";
|
||||||
|
PWM1.timer.pwmPin.$suggestSolution = "boosterpack.29";
|
||||||
|
SPI1.spi.$suggestSolution = "SPI0";
|
||||||
|
SPI1.spi.sclkPin.$suggestSolution = "boosterpack.7";
|
||||||
|
SPI1.spi.misoPin.$suggestSolution = "boosterpack.14";
|
||||||
|
SPI1.spi.mosiPin.$suggestSolution = "boosterpack.15";
|
||||||
|
SPI1.spi.dmaRxChannel.$suggestSolution = "UDMA_CH30";
|
||||||
|
SPI1.spi.dmaTxChannel.$suggestSolution = "UDMA_CH31";
|
||||||
@ -16,7 +16,7 @@ typedef struct {
|
|||||||
bool overheeat;
|
bool overheeat;
|
||||||
bool overload;
|
bool overload;
|
||||||
bool overspeed;
|
bool overspeed;
|
||||||
} initAandrijving;
|
} noodstop;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
packetID_t id;
|
packetID_t id;
|
||||||
@ -67,4 +67,4 @@ union {
|
|||||||
|
|
||||||
void comm_spi();
|
void comm_spi();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
|
#include "global.h"
|
||||||
#include "communicatie.h"
|
#include "communicatie.h"
|
||||||
|
|
||||||
#define SPI_PACKET_LENGTH 4
|
#define SPI_PACKET_LENGTH 4
|
||||||
|
|
||||||
extern pthread_t createSimplePTread(int prio, void * fn);
|
|
||||||
|
|
||||||
unsigned char ReciveBuffer[SPI_PACKET_LENGTH];
|
unsigned char ReciveBuffer[SPI_PACKET_LENGTH];
|
||||||
unsigned char TransmitBuffer[SPI_PACKET_LENGTH];
|
unsigned char TransmitBuffer[SPI_PACKET_LENGTH];
|
||||||
@ -28,7 +28,7 @@ void comm_spi(){
|
|||||||
SPI_Params_init(&spiParams);
|
SPI_Params_init(&spiParams);
|
||||||
spiParams.frameFormat = SPI_POL0_PHA0; // mode0
|
spiParams.frameFormat = SPI_POL0_PHA0; // mode0
|
||||||
spiParams.bitRate = 1E6; // 1 MHz
|
spiParams.bitRate = 1E6; // 1 MHz
|
||||||
masterSpi = SPI_open(CONFIG_SPI_MASTER, &spiParams);
|
SPI_Handle masterSpi = SPI_open(CONFIG_SPI_MASTER, &spiParams);
|
||||||
if (masterSpi == NULL) {
|
if (masterSpi == NULL) {
|
||||||
// Display_printf(display, 0, 0, "Error initializing master SPI\n");
|
// Display_printf(display, 0, 0, "Error initializing master SPI\n");
|
||||||
while (1);
|
while (1);
|
||||||
@ -37,10 +37,10 @@ void comm_spi(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// create transaction
|
// create transaction
|
||||||
SPI_Transaction transaction;
|
SPI_Transaction spiTransaction;
|
||||||
transaction.count = SPI_PACKET_LENGTH;
|
spiTransaction.count = SPI_PACKET_LENGTH;
|
||||||
transaction.txBuf = (void *) TransmitBuffer;
|
spiTransaction.txBuf = (void *) TransmitBuffer;
|
||||||
transaction.rxBuf = (void *) ReciveBuffer;
|
spiTransaction.rxBuf = (void *) ReciveBuffer;
|
||||||
|
|
||||||
// start the loop
|
// start the loop
|
||||||
TransmitBuffer[0] = 0;
|
TransmitBuffer[0] = 0;
|
||||||
@ -65,25 +65,25 @@ void comm_spi(){
|
|||||||
|
|
||||||
// do the transaction
|
// do the transaction
|
||||||
//TODO: set the CS
|
//TODO: set the CS
|
||||||
SPI_transaction(masterSpi, &transaction);
|
SPI_transaction(masterSpi, &spiTransaction);
|
||||||
|
|
||||||
// read the data out the recive buffer
|
// read the data out the recive buffer
|
||||||
switch (ReciveBuffer[0]){
|
switch (ReciveBuffer[0]){
|
||||||
case SPIPARM_maxVermogen:
|
case SPIPARM_maxVermogen:
|
||||||
uint8_t *maxVermogen = &ReciveBuffer[1];
|
uint8_t maxVermogen = ReciveBuffer[2];
|
||||||
noodstop_setMaxVermogen(*maxVermogen);
|
noodstop_setMaxVermogen(maxVermogen);
|
||||||
break;
|
break;
|
||||||
case SPIPARM_maxSnelheid:
|
case SPIPARM_maxSnelheid:
|
||||||
uint16_t *maxSnelheid = &ReciveBuffer[1];
|
uint16_t maxSnelheid = ReciveBuffer[2] + ReciveBuffer[3]*0x100; // convert littelendien
|
||||||
noodstop_setMaxSnelheid(*maxSnelheid);
|
noodstop_setMaxSnelheid(maxSnelheid);
|
||||||
break;
|
break;
|
||||||
case SPIPARM_maxTempratuur:
|
case SPIPARM_maxTempratuur:
|
||||||
uint8_t *maxTemptratuur = &ReciveBuffer[1];
|
uint8_t maxTemptratuur = &ReciveBuffer[2];
|
||||||
noodstop_setMaxTemptratuur(*maxTemptratuur);
|
noodstop_setMaxTemptratuur(maxTemptratuur);
|
||||||
break;
|
break;
|
||||||
case SPIPARM_setpoint:
|
case SPIPARM_setpoint:
|
||||||
uint8_t *setpoint = &ReciveBuffer[1];
|
uint8_t setpoint = &ReciveBuffer[2];
|
||||||
mppt_setpoint(*setpoint);
|
mppt_setpoint(setpoint);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
#ifndef GLOBALS_H
|
#ifndef GLOBALS_H
|
||||||
#define GLOBALS_H
|
#define GLOBALS_H
|
||||||
|
|
||||||
|
#include <pthread.h>
|
||||||
#include "ti_drivers_config.h"
|
#include "ti_drivers_config.h"
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
@ -16,4 +17,6 @@ enum {
|
|||||||
EXT_NOODSTOP
|
EXT_NOODSTOP
|
||||||
} Status;
|
} Status;
|
||||||
|
|
||||||
#endif
|
pthread_t createSimplePTread(int prio, void * fn);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user