![]() |
Contains functions prototype for PDCP protocol. More...
Go to the source code of this file.
Classes | |
struct | errorStr |
Defines | |
#define | MCP_ACTIVATE ( HW_CS_MCP2515_PORT &= ~( 1<<HW_CS_MCP2515 ) ) |
#define | MCP_DEACTIVATE ( HW_CS_MCP2515_PORT |= ( 1<<HW_CS_MCP2515 ) ) |
#define | MASK_ARBITRATOR 0x00 |
#define | MASK_DEVICE 0xFF |
#define | DUMMY_DATA 0x00 |
Enumerations | |
enum | SPI_INIT_STATUS { SPI_INIT_OK = 0, SPI_INIT_FAILED } |
Status of SPI interface initialization. | |
enum | SPI_TRANS_STATUS { SPI_TRANS_OK = 0, SPI_TRANS_FAILED } |
Status of SPI transmission. | |
enum | CAN_INIT_STATUS { CAN_INIT_OK = 0, CAN_INIT_FAILED } |
Status of CAN interface initialization. | |
Functions | |
SPI_INIT_STATUS | initSpi (void) |
SPI Interface Initialization. | |
uint8_t | transmitSpi (uint8_t data) |
SPI Transmit Data. | |
CAN_INIT_STATUS | initCan (uint8_t id) |
Can initialization. | |
void | hal_set_filter (uint8_t id) |
Function to set filters of node indicated by ID. | |
void | hal_set_mask (uint8_t id) |
Function to set mask of node indicated by ID. | |
void | initEEPROM (void) |
Init EEPROM. | |
uint8_t | readEEPROM (uint8_t address) |
Read EEPROM. | |
void | writeEEPROM (uint8_t address, uint8_t data) |
Write EEPROM. | |
void | initInterrupts (void) |
Initialize all needed interrupts (TIMERS, EXTx..) | |
void | initIOPort (void) |
Place for I/O pins initialization. | |
void | initIOPort_appDesigner (void) |
Place for I/O pins initialization left for application designer. | |
void | initInterrupts_appDesigner (void) |
Place for interrupt initialization left for application designer. | |
void | initSPIPorts (void) |
Spi ports initialization. | |
void | initINTPorts (void) |
Software interrupt ports initialization. | |
void | initUSART (uint16_t baud) |
Function to initialize all important ports and methods for LLP hardware. | |
void | checkTransmissionErrors (struct errorStr *readErrStr) |
Callback function to check whether errors in transmission have occured. | |
void | clearTransmissionErrors (void) |
Function to clear error structure. | |
uint8_t | mcp2515TransmitData (uint8_t mode, uint8_t reg, uint8_t val, uint8_t setClearFlag) |
Function to transmit data between MCU and MCP2515. | |
void | triggerSoftwareInterrupt (uint8_t port) |
Function to trigger software interrupt. | |
void | initLowLevelProtocolHardware (void) |
Function to initialize all important ports and methods for LLP hardware. | |
void | printCharUsart (char sign) |
Function to send single char through UART. | |
void | printUsart (char *str) |
Function to send string of chars through UART. | |
void | hal_msg_take (void) |
Function to trigger message sending. | |
void | wdtEnable (uint8_t time) |
void | wdtDisable (void) |
Function to disable watchdog timer. | |
void | forceReset (void) |
Function to call reset handler. | |
Variables | |
struct errorStr | errorStructure |
Contains functions prototype for PDCP protocol.
void checkTransmissionErrors | ( | struct errorStr * | readErrStr | ) |
Callback function to check whether errors in transmission have occured.
[in] | struct | errorStr* Pointer to structure (type of errorStr) to read errors |
void clearTransmissionErrors | ( | void | ) |
Function to clear error structure.
[in] | void |
void forceReset | ( | void | ) |
Function to call reset handler.
[in] | void |
void hal_msg_take | ( | ) |
Function to trigger message sending.
void hal_set_filter | ( | uint8_t | id | ) |
Function to set filters of node indicated by ID.
Can be called after PIN initialization
[in] | id | CONFIG_BUS_MODE |
void hal_set_mask | ( | uint8_t | id | ) |
Function to set mask of node indicated by ID.
Can be called after PIN initialization
[in] | id | CONFIG_BUS_MODE |
CAN_INIT_STATUS initCan | ( | uint8_t | id | ) |
Can initialization.
Can be called after PIN initialization
[in] | id | Id CONFIG_BUS_MODE |
[in] | moduleMode | CONFIG_BUS_MODE type |
void initEEPROM | ( | void | ) |
Init EEPROM.
void initInterrupts | ( | void | ) |
Initialize all needed interrupts (TIMERS, EXTx..)
Contains call to function initInterrupts_appDesigner() which should contain
initialization of interrupts indispensible for application (empty by default)
[in] | void |
void initInterrupts_appDesigner | ( | void | ) |
Place for interrupt initialization left for application designer.
[in] | void |
void initINTPorts | ( | void | ) |
Software interrupt ports initialization.
[in] | void |
void initIOPort | ( | void | ) |
Place for I/O pins initialization.
Contains call to function initIOPort_appDesigner() which should contain
initialization of IO Ports indispensible for application (empty by default)
[in] | void |
void initIOPort_appDesigner | ( | void | ) |
Place for I/O pins initialization left for application designer.
Can consist of I2C, pins, interfaces etc. initialization
[in] | void |
void initLowLevelProtocolHardware | ( | void | ) |
Function to initialize all important ports and methods for LLP hardware.
[in] | void |
SPI_INIT_STATUS initSpi | ( | void | ) |
SPI Interface Initialization.
Port initialization done in InitPorts function
void initSPIPorts | ( | void | ) |
Spi ports initialization.
[in] | void |
look at uCmaskFile.h where ports are defined
void initUSART | ( | uint16_t | baud | ) |
Function to initialize all important ports and methods for LLP hardware.
[in] | baud | Baudrate |
uint8_t mcp2515TransmitData | ( | uint8_t | mode, |
uint8_t | reg, | ||
uint8_t | val, | ||
uint8_t | setClearFlag | ||
) |
Function to transmit data between MCU and MCP2515.
Can be called after PIN initialization
[in] | mode | Mode of operation MCP_WRITE_CMD, MCP_READ_CMD or MPC_BIT_MODIFY |
[in] | reg | Address of register to change/read |
[in] | val | Value to to change: must be a shift value if MPC_BIT_MODIFY is specified, otherwise full value register |
[in] | setClearFlag | If MPC_BIT_MODIFY specified, SET_BIT or CLR_BIT (defined in MCP2515_CAN_control.h file) defines clearing of setting mode |
void printCharUsart | ( | char | sign | ) |
Function to send single char through UART.
[in] | sign | Sign to send through USART |
void printUsart | ( | char * | str | ) |
Function to send string of chars through UART.
[in] | str | String to send through UART |
uint8_t readEEPROM | ( | uint8_t | address | ) |
Read EEPROM.
[in] | address | EEPROM read address |
uint8_t transmitSpi | ( | uint8_t | data | ) |
SPI Transmit Data.
May be called after PIN initialization
[in] | data | Data to transmission |
void triggerSoftwareInterrupt | ( | uint8_t | port | ) |
Function to trigger software interrupt.
[in] | void |
void wdtDisable | ( | void | ) |
Function to disable watchdog timer.
void writeEEPROM | ( | uint8_t | address, |
uint8_t | data | ||
) |
Write EEPROM.
[in] | address | EEPROM write address |
[in] | data | EEPROM write data |