### SisInit Function for Port Direction Setup Source: https://github.com/begeistert/microcontrollers-ccs-c-compiler/blob/main/src/fast_io/README.md Defines the `SisInit()` function, which configures the data direction registers (TRIS) for PORT A as all inputs (0XFF) and PORT B as all outputs (0X00). It also initializes the output state of PORT A to low (0X00). This setup is crucial when using `fast_io`. ```C void SisInit(){ set_tris_a(0XFF); set_tris_b(0X00); output_a(0X00); } ``` -------------------------------- ### Alternative Port Configuration within main() Source: https://github.com/begeistert/microcontrollers-ccs-c-compiler/blob/main/src/fast_io/README.md Illustrates an alternative method to configure port directions directly within the `main()` function. It sets PORT A as inputs and PORT B as outputs, and initializes PORT A, demonstrating that a separate `SisInit()` function is not strictly necessary. ```C void main(){ set_tris_a(0XFF); set_tris_b(0X00); output_a(0X00); ... } ``` -------------------------------- ### PIC 18F45K50 Configuration Directives Source: https://github.com/begeistert/microcontrollers-ccs-c-compiler/blob/main/src/fast_io/README.md Essential configuration lines for the PIC 18F45K50 microcontroller. Includes library import, internal oscillator frequency declaration (48MHz), and special build directives for the XTRAINER LITE board's bootloader, assigning reset and interrupt vectors and reserving memory space. ```C #include <18F45K50.h> ///< Importación de librería para el PIC #use delay(internal=48Mhz) ///< Declaración de la frec. del Oscilador /* Lineas especiales de configuración para el bootloader de la tarjeta XTRAINER LITE de Microside */ #build(reset=0x02000,interrupt=0x02008)///< Asignación de los vectores de reset e interrupción #org 0x0000,0x1FFF {} ///< Reservación espacio en la memoría ``` -------------------------------- ### Turn LED ON when PIN_A0 is Low Source: https://github.com/begeistert/microcontrollers-ccs-c-compiler/blob/main/src/fast_io/README.md Sets `PIN_B0` to a high state (`output_HIGH`), turning on the LED connected to it. This action is executed when `PIN_A0` reads a low value (0), indicating the button is pressed. ```C else { output_HIGH(PIN_B0); } ``` -------------------------------- ### Enable fast_io for PORT A and B Source: https://github.com/begeistert/microcontrollers-ccs-c-compiler/blob/main/src/fast_io/README.md Applies the `fast_io` directive to PORT A and PORT B. This optimizes I/O operations by instructing the compiler to perform I/O without programming the direction register, leading to faster execution. ```C #use fast_io(A) ///< Configuracion E/S para el PORT A #use fast_io(B) ///< Configuracion E/S para el PORT B ``` -------------------------------- ### Conditional Check for PIN_A0 Input Source: https://github.com/begeistert/microcontrollers-ccs-c-compiler/blob/main/src/fast_io/README.md Implements a conditional statement to check the input state of `PIN_A0`. This pin is connected to a button in a pull-up configuration. The logic within this block determines the behavior of the LED based on whether the button is pressed or not. ```C if(input(PIN_A0) == 1){ ... } else { ... } ``` -------------------------------- ### Turn LED OFF when PIN_A0 is High Source: https://github.com/begeistert/microcontrollers-ccs-c-compiler/blob/main/src/fast_io/README.md Sets `PIN_B0` to a low state (`output_LOW`), effectively turning off the LED connected to it. This action is executed when `PIN_A0` reads a high value (1), indicating the button is not pressed. ```C if(input(PIN_A0) == 1){ output_LOW(PIN_B0); } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.