MATLAB EMBEDDED IDE LINK 4 Guía de usuario Pagina 24

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 58
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 23
22
The DSP-board
A.3.1 – The LEDs
The LEDs are connected to the P7-connection on the DSP-board. Here’s a code segment
displaying how to use them:
(please note that setting the corresponding flag to 0 illuminates the LED)
void Init_Diode(void){
EALLOW;
GpioMuxRegs.GPBMUX.bit.C4TRIP_GPIOB13=0; //Right
GpioMuxRegs.GPBMUX.bit.C5TRIP_GPIOB14=0; //Center
GpioMuxRegs.GPBMUX.bit.C6TRIP_GPIOB15=0; //Left
GpioMuxRegs.GPBDIR.bit.GPIOB13=1; //Write
GpioMuxRegs.GPBDIR.bit.GPIOB14=1;
GpioMuxRegs.GPBDIR.bit.GPIOB15=1;
GpioDataRegs.GPBDAT.bit.GPIOB13=1; //0=ON, 1=OFF
GpioDataRegs.GPBDAT.bit.GPIOB14=1;
GpioDataRegs.GPBDAT.bit.GPIOB15=1;
EDIS;
}
void DiodOn(int diodNbr){
if (diodNbr==1) GpioDataRegs.GPBDAT.bit.GPIOB15=0;
if (diodNbr==2) GpioDataRegs.GPBDAT.bit.GPIOB14=0;
if (diodNbr==3) GpioDataRegs.GPBDAT.bit.GPIOB13=0;
}
void DiodOff(int diodNbr){
if (diodNbr==1) GpioDataRegs.GPBDAT.bit.GPIOB15=1;
if (diodNbr==2) GpioDataRegs.GPBDAT.bit.GPIOB14=1;
if (diodNbr==3) GpioDataRegs.GPBDAT.bit.GPIOB13=1;
}
Vista de pagina 23
1 2 ... 19 20 21 22 23 24 25 26 27 28 29 ... 57 58

Comentarios a estos manuales

Sin comentarios