This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Demonstration of the BeagleBone's PRU, using a timer. | |
* Ken Shirriff, http://righto.com | |
*/ | |
#include <stdint.h> | |
#define DELAY_NS 100 // Use 500000000 for 0.5 second delay | |
#define WRITE_PIN 15 /* P8_11, Ethernet output data, pr1_PRU0_pru_r30_15 */ | |
// PRU Interrupt control registers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/ | |
* | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* * Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# prussd.py - Daemon to process PRU access requests | |
# for non-root processes | |
# | |
# Copyright (c) 2018 Mohammed Muneeb | |
# | |
# This program is free software: you can redistribute it and/or modify it | |
# under the terms of the GNU General Public License version 3 as published by | |
# the Free Software Foundation. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "pruss.h" | |
using namespace std; | |
Socket::Socket() | |
{ | |
this->fd = -1; | |
this->socketpath = "/tmp/prussd.sock"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef PRUSS_H_ | |
#define PRUSS_H_ | |
#include <stdlib.h> | |
#include <linux/limits.h> // realpath | |
#include <string> // string handling | |
#include <sys/socket.h> // socket | |
#include <sys/un.h> // socket | |
#include <unistd.h> // close() | |
#include <errno.h> // error codes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/ | |
* | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* * Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/ | |
* | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: | |
* | |
* * Redistributions of source code must retain the above copyright | |
* notice, this list of conditions and the following disclaimer. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;****************************************************************************** | |
;* PRU C/C++ Codegen Unix v2.1.5 * | |
;* Date/Time created: Wed Jul 17 08:36:15 2019 * | |
;****************************************************************************** | |
.compiler_opts --abi=eabi --endian=little --hll_source=on --object_format=elf --silicon_version=3 --symdebug:dwarf --symdebug:dwarf_version=3 | |
$C$DW$CU .dwtag DW_TAG_compile_unit | |
.dwattr $C$DW$CU, DW_AT_name("main_pru0.c") | |
.dwattr $C$DW$CU, DW_AT_producer("TI PRU C/C++ Codegen Unix v2.1.5 Copyright (c) 2012-2017 Texas Instruments Incorporated") | |
.dwattr $C$DW$CU, DW_AT_TI_version(0x01) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "driver_lib.h" | |
#include <iostream> | |
using namespace std; | |
int main(){ | |
Driver& d = Driver::get(); | |
d.wake(); | |
d.activateMotor(360.0, 60.0, FULL, ANTICLOCKWISE); // 360 degrees at 60 RPM in full step mode in anticlockwise direction |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;* Source written by Pratim Ugale <pratim.ugale@gmail.com> | |
;* This example is used to control a stepper motor by sending out precise number of pulse trains at required frequency(RPM). | |
;* The 4 byte ON_Cycles input must be in memory location 0x00010000 - 0x00010003 in little-endian byte order | |
;* The 4 byte Total_Cycles input must be in memory location 0x00010004 - 0x00010007 in little endian byte order | |
;* The 4 byte Number of Pulses input must be in memory location 0x00010008 - 0x000100011 in little-endian byte order | |
.cdecls "main_pru0.c" | |
PRU_SRAM .set 0x00010000 ; Set the location of PRU Shared Memory |
OlderNewer