Altera SoCAL  16.0
The Altera SoC Abstraction Layer (SoCAL) API Reference Manual
 All Data Structures Variables Typedefs Groups
Register : Bit Timing / BRP Extension Register - CBT

Description

This register is only writable if bits CCTRL.CCE and CCTRL.Init are set. The CAN bit time may be programed in the range of [4 .. 25] time quanta. The CAN time quantum may be programmed in the range of [1 .. 1024] CAN_CLK periods. For details see Application Note 001 "Configuration of Bit Timing". The actual interpretation by the hardware of this value is such that one more than the value programmed here is used. TSeg1 is the sum of Prop_Seg and Phase_Seg1. TSeg2 is Phase_Seg2. Therefore the length of the bit time is (programmed values) [TSeg1 + TSeg2 + 3] tq or (functional values) [Sync_Seg + Prop_Seg + Phase_Seg1

Register Layout

Bits Access Reset Description
[5:0] RW 0x1 Baud Rate Prescaler
[7:6] RW 0x0 (Re) Synchronization Jump Width
[11:8] RW 0x3 The time segment before the sample point
[14:12] RW 0x2 The time segment after the sample point
[15] ??? 0x0 UNDEFINED
[19:16] RW 0x0 Baud Rate Prescaler Extension
[31:20] ??? 0x0 UNDEFINED

Field : Baud Rate Prescaler - BRP

The value by which the oscillator frequency is divided for generating the bit time quanta. The bit time is built up from a multiple of this quanta. Valid values for the Baud Rate Prescaler are [0 .. 63]. The actual interpretation by the hardware of this value is such that one more than the value programmed here is used.

Field Access Macros:

#define ALT_CAN_PROTO_CBT_BRP_LSB   0
 
#define ALT_CAN_PROTO_CBT_BRP_MSB   5
 
#define ALT_CAN_PROTO_CBT_BRP_WIDTH   6
 
#define ALT_CAN_PROTO_CBT_BRP_SET_MSK   0x0000003f
 
#define ALT_CAN_PROTO_CBT_BRP_CLR_MSK   0xffffffc0
 
#define ALT_CAN_PROTO_CBT_BRP_RESET   0x1
 
#define ALT_CAN_PROTO_CBT_BRP_GET(value)   (((value) & 0x0000003f) >> 0)
 
#define ALT_CAN_PROTO_CBT_BRP_SET(value)   (((value) << 0) & 0x0000003f)
 

Field : (Re) Synchronization Jump Width - SJW

Valid programmed values are [0 .. 3]. The actual interpretation by the hardware of this value is such that one more than the value programmed here is used.

Field Access Macros:

#define ALT_CAN_PROTO_CBT_SJW_LSB   6
 
#define ALT_CAN_PROTO_CBT_SJW_MSB   7
 
#define ALT_CAN_PROTO_CBT_SJW_WIDTH   2
 
#define ALT_CAN_PROTO_CBT_SJW_SET_MSK   0x000000c0
 
#define ALT_CAN_PROTO_CBT_SJW_CLR_MSK   0xffffff3f
 
#define ALT_CAN_PROTO_CBT_SJW_RESET   0x0
 
#define ALT_CAN_PROTO_CBT_SJW_GET(value)   (((value) & 0x000000c0) >> 6)
 
#define ALT_CAN_PROTO_CBT_SJW_SET(value)   (((value) << 6) & 0x000000c0)
 

Field : The time segment before the sample point - TSeg1

Valid values for TSeg1 are [1 .. 15].

Field Access Macros:

#define ALT_CAN_PROTO_CBT_TSEG1_LSB   8
 
#define ALT_CAN_PROTO_CBT_TSEG1_MSB   11
 
#define ALT_CAN_PROTO_CBT_TSEG1_WIDTH   4
 
#define ALT_CAN_PROTO_CBT_TSEG1_SET_MSK   0x00000f00
 
#define ALT_CAN_PROTO_CBT_TSEG1_CLR_MSK   0xfffff0ff
 
#define ALT_CAN_PROTO_CBT_TSEG1_RESET   0x3
 
#define ALT_CAN_PROTO_CBT_TSEG1_GET(value)   (((value) & 0x00000f00) >> 8)
 
#define ALT_CAN_PROTO_CBT_TSEG1_SET(value)   (((value) << 8) & 0x00000f00)
 

Field : The time segment after the sample point - TSeg2

Valid values for TSeg2 are [0 .. 7].

Field Access Macros:

#define ALT_CAN_PROTO_CBT_TSEG2_LSB   12
 
#define ALT_CAN_PROTO_CBT_TSEG2_MSB   14
 
#define ALT_CAN_PROTO_CBT_TSEG2_WIDTH   3
 
#define ALT_CAN_PROTO_CBT_TSEG2_SET_MSK   0x00007000
 
#define ALT_CAN_PROTO_CBT_TSEG2_CLR_MSK   0xffff8fff
 
#define ALT_CAN_PROTO_CBT_TSEG2_RESET   0x2
 
#define ALT_CAN_PROTO_CBT_TSEG2_GET(value)   (((value) & 0x00007000) >> 12)
 
#define ALT_CAN_PROTO_CBT_TSEG2_SET(value)   (((value) << 12) & 0x00007000)
 

Field : Baud Rate Prescaler Extension - BRPE

By programming BRPE the Baud Rate Prescaler can be extended to values up to

  1. The actual interpretation by the hardware is that one more than the value programmed by BRPE (MSBs) and BRP (LSBs) is used.

Field Access Macros:

#define ALT_CAN_PROTO_CBT_BRPE_LSB   16
 
#define ALT_CAN_PROTO_CBT_BRPE_MSB   19
 
#define ALT_CAN_PROTO_CBT_BRPE_WIDTH   4
 
#define ALT_CAN_PROTO_CBT_BRPE_SET_MSK   0x000f0000
 
#define ALT_CAN_PROTO_CBT_BRPE_CLR_MSK   0xfff0ffff
 
#define ALT_CAN_PROTO_CBT_BRPE_RESET   0x0
 
#define ALT_CAN_PROTO_CBT_BRPE_GET(value)   (((value) & 0x000f0000) >> 16)
 
#define ALT_CAN_PROTO_CBT_BRPE_SET(value)   (((value) << 16) & 0x000f0000)
 

Data Structures

struct  ALT_CAN_PROTO_CBT_s
 

Macros

#define ALT_CAN_PROTO_CBT_OFST   0xc
 
#define ALT_CAN_PROTO_CBT_ADDR(base)   ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_CAN_PROTO_CBT_OFST))
 

Typedefs

typedef struct ALT_CAN_PROTO_CBT_s ALT_CAN_PROTO_CBT_t
 

Data Structure Documentation

struct ALT_CAN_PROTO_CBT_s

WARNING: The C register and register group struct declarations are provided for convenience and illustrative purposes. They should, however, be used with caution as the C language standard provides no guarantees about the alignment or atomicity of device memory accesses. The recommended practice for writing hardware drivers is to use the SoCAL access macros and alt_read_word() and alt_write_word() functions.

The struct declaration for register ALT_CAN_PROTO_CBT.

Data Fields
uint32_t BRP: 6 Baud Rate Prescaler
uint32_t SJW: 2 (Re) Synchronization Jump Width
uint32_t TSeg1: 4 The time segment before the sample point
uint32_t TSeg2: 3 The time segment after the sample point
uint32_t __pad0__: 1 UNDEFINED
uint32_t BRPE: 4 Baud Rate Prescaler Extension
uint32_t __pad1__: 12 UNDEFINED

Macro Definitions

#define ALT_CAN_PROTO_CBT_BRP_LSB   0

The Least Significant Bit (LSB) position of the ALT_CAN_PROTO_CBT_BRP register field.

#define ALT_CAN_PROTO_CBT_BRP_MSB   5

The Most Significant Bit (MSB) position of the ALT_CAN_PROTO_CBT_BRP register field.

#define ALT_CAN_PROTO_CBT_BRP_WIDTH   6

The width in bits of the ALT_CAN_PROTO_CBT_BRP register field.

#define ALT_CAN_PROTO_CBT_BRP_SET_MSK   0x0000003f

The mask used to set the ALT_CAN_PROTO_CBT_BRP register field value.

#define ALT_CAN_PROTO_CBT_BRP_CLR_MSK   0xffffffc0

The mask used to clear the ALT_CAN_PROTO_CBT_BRP register field value.

#define ALT_CAN_PROTO_CBT_BRP_RESET   0x1

The reset value of the ALT_CAN_PROTO_CBT_BRP register field.

#define ALT_CAN_PROTO_CBT_BRP_GET (   value)    (((value) & 0x0000003f) >> 0)

Extracts the ALT_CAN_PROTO_CBT_BRP field value from a register.

#define ALT_CAN_PROTO_CBT_BRP_SET (   value)    (((value) << 0) & 0x0000003f)

Produces a ALT_CAN_PROTO_CBT_BRP register field value suitable for setting the register.

#define ALT_CAN_PROTO_CBT_SJW_LSB   6

The Least Significant Bit (LSB) position of the ALT_CAN_PROTO_CBT_SJW register field.

#define ALT_CAN_PROTO_CBT_SJW_MSB   7

The Most Significant Bit (MSB) position of the ALT_CAN_PROTO_CBT_SJW register field.

#define ALT_CAN_PROTO_CBT_SJW_WIDTH   2

The width in bits of the ALT_CAN_PROTO_CBT_SJW register field.

#define ALT_CAN_PROTO_CBT_SJW_SET_MSK   0x000000c0

The mask used to set the ALT_CAN_PROTO_CBT_SJW register field value.

#define ALT_CAN_PROTO_CBT_SJW_CLR_MSK   0xffffff3f

The mask used to clear the ALT_CAN_PROTO_CBT_SJW register field value.

#define ALT_CAN_PROTO_CBT_SJW_RESET   0x0

The reset value of the ALT_CAN_PROTO_CBT_SJW register field.

#define ALT_CAN_PROTO_CBT_SJW_GET (   value)    (((value) & 0x000000c0) >> 6)

Extracts the ALT_CAN_PROTO_CBT_SJW field value from a register.

#define ALT_CAN_PROTO_CBT_SJW_SET (   value)    (((value) << 6) & 0x000000c0)

Produces a ALT_CAN_PROTO_CBT_SJW register field value suitable for setting the register.

#define ALT_CAN_PROTO_CBT_TSEG1_LSB   8

The Least Significant Bit (LSB) position of the ALT_CAN_PROTO_CBT_TSEG1 register field.

#define ALT_CAN_PROTO_CBT_TSEG1_MSB   11

The Most Significant Bit (MSB) position of the ALT_CAN_PROTO_CBT_TSEG1 register field.

#define ALT_CAN_PROTO_CBT_TSEG1_WIDTH   4

The width in bits of the ALT_CAN_PROTO_CBT_TSEG1 register field.

#define ALT_CAN_PROTO_CBT_TSEG1_SET_MSK   0x00000f00

The mask used to set the ALT_CAN_PROTO_CBT_TSEG1 register field value.

#define ALT_CAN_PROTO_CBT_TSEG1_CLR_MSK   0xfffff0ff

The mask used to clear the ALT_CAN_PROTO_CBT_TSEG1 register field value.

#define ALT_CAN_PROTO_CBT_TSEG1_RESET   0x3

The reset value of the ALT_CAN_PROTO_CBT_TSEG1 register field.

#define ALT_CAN_PROTO_CBT_TSEG1_GET (   value)    (((value) & 0x00000f00) >> 8)

Extracts the ALT_CAN_PROTO_CBT_TSEG1 field value from a register.

#define ALT_CAN_PROTO_CBT_TSEG1_SET (   value)    (((value) << 8) & 0x00000f00)

Produces a ALT_CAN_PROTO_CBT_TSEG1 register field value suitable for setting the register.

#define ALT_CAN_PROTO_CBT_TSEG2_LSB   12

The Least Significant Bit (LSB) position of the ALT_CAN_PROTO_CBT_TSEG2 register field.

#define ALT_CAN_PROTO_CBT_TSEG2_MSB   14

The Most Significant Bit (MSB) position of the ALT_CAN_PROTO_CBT_TSEG2 register field.

#define ALT_CAN_PROTO_CBT_TSEG2_WIDTH   3

The width in bits of the ALT_CAN_PROTO_CBT_TSEG2 register field.

#define ALT_CAN_PROTO_CBT_TSEG2_SET_MSK   0x00007000

The mask used to set the ALT_CAN_PROTO_CBT_TSEG2 register field value.

#define ALT_CAN_PROTO_CBT_TSEG2_CLR_MSK   0xffff8fff

The mask used to clear the ALT_CAN_PROTO_CBT_TSEG2 register field value.

#define ALT_CAN_PROTO_CBT_TSEG2_RESET   0x2

The reset value of the ALT_CAN_PROTO_CBT_TSEG2 register field.

#define ALT_CAN_PROTO_CBT_TSEG2_GET (   value)    (((value) & 0x00007000) >> 12)

Extracts the ALT_CAN_PROTO_CBT_TSEG2 field value from a register.

#define ALT_CAN_PROTO_CBT_TSEG2_SET (   value)    (((value) << 12) & 0x00007000)

Produces a ALT_CAN_PROTO_CBT_TSEG2 register field value suitable for setting the register.

#define ALT_CAN_PROTO_CBT_BRPE_LSB   16

The Least Significant Bit (LSB) position of the ALT_CAN_PROTO_CBT_BRPE register field.

#define ALT_CAN_PROTO_CBT_BRPE_MSB   19

The Most Significant Bit (MSB) position of the ALT_CAN_PROTO_CBT_BRPE register field.

#define ALT_CAN_PROTO_CBT_BRPE_WIDTH   4

The width in bits of the ALT_CAN_PROTO_CBT_BRPE register field.

#define ALT_CAN_PROTO_CBT_BRPE_SET_MSK   0x000f0000

The mask used to set the ALT_CAN_PROTO_CBT_BRPE register field value.

#define ALT_CAN_PROTO_CBT_BRPE_CLR_MSK   0xfff0ffff

The mask used to clear the ALT_CAN_PROTO_CBT_BRPE register field value.

#define ALT_CAN_PROTO_CBT_BRPE_RESET   0x0

The reset value of the ALT_CAN_PROTO_CBT_BRPE register field.

#define ALT_CAN_PROTO_CBT_BRPE_GET (   value)    (((value) & 0x000f0000) >> 16)

Extracts the ALT_CAN_PROTO_CBT_BRPE field value from a register.

#define ALT_CAN_PROTO_CBT_BRPE_SET (   value)    (((value) << 16) & 0x000f0000)

Produces a ALT_CAN_PROTO_CBT_BRPE register field value suitable for setting the register.

#define ALT_CAN_PROTO_CBT_OFST   0xc

The byte offset of the ALT_CAN_PROTO_CBT register from the beginning of the component.

#define ALT_CAN_PROTO_CBT_ADDR (   base)    ALT_CAST(void *, (ALT_CAST(char *, (base)) + ALT_CAN_PROTO_CBT_OFST))

The address of the ALT_CAN_PROTO_CBT register.

Typedef Documentation

The typedef declaration for register ALT_CAN_PROTO_CBT.